Skip to content
Snippets Groups Projects
Commit 74b41900 authored by Jesper Andersson's avatar Jesper Andersson
Browse files

Added gradient descent

parent dcc81c41
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,8 @@ namespace MISCMATHS {
enum NLMethod {NL_VM, // Variable-Metric (see NRinC)
NL_CG, // Conjugate-Gradient (see NRinC)
NL_SCG, // Scaled Conjugate-Gradient (See Moller 1993).
NL_LM}; // Levenberg-Marquardt (see NRinC)
NL_LM, // Levenberg-Marquardt (see NRinC)
NL_GD}; // Gradient Descent
enum LMType {LM_L, LM_LM}; // Levenberg or Levenberg-Marquardt
......@@ -144,6 +145,8 @@ public:
double InitialCF() const {if (logcf) return(cf[0]); else {throw NonlinException("InitialCF: Cost-function not logged"); return(cf[0]);}}
const std::vector<double> CFHistory() const {if (logcf) return(cf); else {throw NonlinException("CFHistory: Cost-function not logged"); return(cf);}}
NonlinOut Status() const {return(status);}
bool Success() const { switch(status) { case NL_UNDEFINED: case NL_MAXITER: case NL_LM_MAXITER: return(false); break; default: return(true); } };
std::string TextStatus() const;
// Routines to set values of steering parameters
void SetMethod(NLMethod pmtd) {mtd = pmtd;}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment