OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
LMDif.h
Go to the documentation of this file.
1 #ifndef OPAL_LMDif_HH
2 #define OPAL_LMDif_HH 1
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: LMDif.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: LMDif
13 //
14 // ------------------------------------------------------------------------
15 //
16 // $Date: 2000/03/27 09:33:44 $
17 // $Author: Andreas Adelmann $
18 //
19 // ------------------------------------------------------------------------
20 
21 #include "AbstractObjects/Action.h"
22 #include "Algebra/Matrix.h"
23 #include "Match/MatchState.h"
24 
25 class QRSolver;
26 template <class T> class Array1D;
27 template <class T> class Vector;
28 
29 // Class LMDif
30 // ------------------------------------------------------------------------
32 // This class encapsulates a minimisation according to the method used
33 // by Levenberg and Marquardt in
34 // [center]
35 // B. S. Garbow, K. E. Hillstrom, and J. J. More,
36 // User Guide for MINPACK-1, ANL 80-74.
37 // [/center]
38 // Also described in
39 // [center]
40 // J. F. Bonnans et al., Optimisation Numerique, pp. 70-72.
41 // Springer, Berlin, 1997
42 // [/center]
43 // Algorithm rewritten following the MINPACK package.
44 
45 class LMDif: public Action {
46 
47 public:
48 
50  LMDif();
51 
52  virtual ~LMDif();
53 
55  virtual LMDif *clone(const std::string &name);
56 
58  virtual void execute();
59 
60 private:
61 
62  // Not implemented.
63  LMDif(const LMDif &);
64  void operator=(const LMDif &);
65 
66  // Clone constructor.
67  LMDif(const std::string &name, LMDif *parent);
68 
69  // Compute the Jacobian of the set of functions with respect to the
70  // set of variables.
71  bool findJacobian(Vector<double> &X, // Current variable values.
72  Vector<double> &F); // Current function values.
73 
74  // Compute the Levenberg-Marquardt parameter p.
75  void lmpar(QRSolver &solver, // The QR solver object.
76  const Array1D<double> &D, // The diagonal matrix D.
77  const Vector<double> &F, // The function vector.
78  Vector<double> &P); // The variable step.
79 
80  // The step size fraction.
81  double fraction;
82 
83  // The step size for the LM algorithm.
84  double delta;
85 
86  // The parameter for the LM algorithm.
87  double mu;
88 
89  // The Jacobian of the problem.
91 };
92 
93 #endif // OPAL_LMDif_HH
void operator=(const LMDif &)
Matrix< double > jacobian
Definition: LMDif.h:90
The LMDIF command.
Definition: LMDif.h:45
The base class for all OPAL actions.
Definition: Action.h:30
Definition: rbendmap.h:8
Least-square solution of systems of linear equations.
Definition: QRSolver.h:60
double mu
Definition: LMDif.h:87
double fraction
Definition: LMDif.h:81
LMDif()
Exemplar constructor.
Definition: LMDif.cpp:48
virtual void execute()
Execute the command.
Definition: LMDif.cpp:77
virtual LMDif * clone(const std::string &name)
Make clone.
Definition: LMDif.cpp:72
bool findJacobian(Vector< double > &X, Vector< double > &F)
Definition: LMDif.cpp:262
double delta
Definition: LMDif.h:84
const std::string name
virtual ~LMDif()
Definition: LMDif.cpp:68
One-dimensional array.
Definition: Array1D.h:36
void lmpar(QRSolver &solver, const Array1D< double > &D, const Vector< double > &F, Vector< double > &P)
Definition: LMDif.cpp:217
Vector.