27 #ifndef GOPTIMIZERLM_HPP
28 #define GOPTIMIZERLM_HPP
37 #define G_LM_CONVERGED 0
38 #define G_LM_STALLED 1
39 #define G_LM_SINGULAR 2
40 #define G_LM_NOT_POSTIVE_DEFINITE 3
41 #define G_LM_BAD_ERRORS 4
65 virtual void clear(
void);
67 virtual std::string
classname(
void)
const;
70 virtual double value(
void)
const;
71 virtual int status(
void)
const;
72 virtual int iter(
void)
const;
83 void eps(
const double&
eps);
85 const int&
npars(
void)
const;
86 const int&
nfree(
void)
const;
93 const double&
lambda(
void)
const;
94 const double&
eps(
void)
const;
142 return (
"GOptimizerLM");
GOptimizerLM & operator=(const GOptimizerLM &opt)
Assignment operator.
const double & lambda_inc(void) const
Return lambda increment value.
double step_size(const GVector &grad, const GOptimizerPars &pars)
Return LM step size.
Optimizer function abstract base class.
void init_members(void)
Initialise class members.
virtual double value(void) const
Return function value.
Optimizer parameter container class.
virtual void optimize(GOptimizerFunction &fct, GOptimizerPars &pars)
Optimize function parameters.
double m_lambda_start
Initial start value.
double m_lambda
Actual lambda.
void copy_members(const GOptimizerLM &opt)
Copy class members.
double m_eps
Absolute precision.
std::vector< bool > m_hit_boundary
Bookkeeping array for boundary hits.
int m_npars
Number of parameters.
const double & lambda(void) const
Return lambda value.
GOptimizerLM(void)
Void constructor.
std::vector< bool > m_par_remove
Bookkeeping of parameter removal.
int m_max_dec
Maximum number of function decrease.
const int & nfree(void) const
Return number of free model parameters.
double m_value
Actual function value.
Abstract optimizer abstract base class interface definition.
const double & lambda_start(void) const
Return lambda starting value.
GLog * m_logger
Pointer to optional logger.
const int & max_boundary_hits(void) const
Return maximum number of parameter boundary hits.
Information logger interface definition.
Optimizer function abstract base class.
virtual GOptimizerLM * clone(void) const
Clone object.
int m_nfree
Number of free parameters.
bool m_step_adjust
Adjust step size to boundaries.
virtual void clear(void)
Clear object.
double m_delta
Function improvement.
double m_accept_dec
Acceptable function decrease.
GVector log(const GVector &vector)
Computes natural logarithm of vector elements.
const int & max_iter(void) const
Return maximum number of iterations.
virtual ~GOptimizerLM(void)
Destructor.
double m_lambda_dec
Lambda decrease.
Abstract optimizer abstract base class.
const double & lambda_dec(void) const
Return lambda decrement value.
std::vector< bool > m_par_freeze
Bookkeeping of parameter freeze.
double m_lambda_inc
Lambda increase.
const double & accept_dec(void) const
Return acceptable function decrease.
int m_num_dec
Number of function decreases.
void free_members(void)
Delete class members.
const int & npars(void) const
Return number of model parameters.
int m_max_iter
Maximum number of iterations.
int m_max_hit
Maximum number of successive hits.
std::vector< int > m_hit_maximum
Bookkeeping of successive maximum hits.
const int & max_stalls(void) const
Return maximum number of allowed subsequent stalls.
void logger(GLog *log)
Set logger.
Information logger class definition.
virtual int iter(void) const
Return number of iterations.
const double & eps(void) const
Return requested absolute convergence precision.
virtual void errors(GOptimizerFunction &fct, GOptimizerPars &pars)
Compute parameter uncertainties.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print optimizer information.
std::vector< int > m_hit_minimum
Bookkeeping of successive minimum hits.
virtual std::string classname(void) const
Return class name.
Levenberg Marquardt optimizer class.
int m_max_stall
Maximum number of stalls.
virtual int status(void) const
Return optimizer status.
double iteration(GOptimizerFunction &fct, GOptimizerPars &pars)
Perform one LM iteration.