#include <nmrLSNonLinJacobianSolver.h>
Collaboration diagram for nmrLSNonLinJacobianSolver:

Rather than compute the value f(x) (the sum of squares), LSNonLin requires the user-defined function to compute the vector-valued function.
Then, in vector terms, you can restate this optimization problem as
where
is a vector and
is a function that returns a vector value.
The data members of this class are:
info = 0 improper input parameters.
info = 1 algorithm estimates that the relative error in the sum of squares is at most tol.
info = 2 algorithm estimates that the relative error between x and the solution is at most tol.
info = 3 conditions for info = 1 and info = 2 both hold.
info = 4 fvec is orthogonal to the columns of the jacobian to machine precision.
info = 5 number of calls to fcn with Flag = 1 has reached or exceeded 200*(n+1).
info = 6 tol is too small. no further reduction in the sum of squares is possible.
info = 7 tol is too small. no further improvement in the approximate solution x is possible
The input/output from this class is:
The solver calls this method when needed to obtain values for F for a given variable values X.
The following constructor can be used to contruct the nmrCallBackLSNonLinSolver object required to be passed to the Solve() method. This object needs to be created only once per given set of nonlinear functions to be minized. nmrCallBackLSNonLinSolver<nmrUNIQUE_IDENTIFIER_LINE, Cfoo> callBackObject(this, &Cfoo::Mbar);
Definition at line 125 of file nmrLSNonLinJacobianSolver.h.
| nmrLSNonLinJacobianSolver::nmrLSNonLinJacobianSolver | ( | void | ) | [inline] |
Default constructor. This constructor doesn't allocate any memory. If you use this constructor, you will need to use one of the Allocate() methods before you can use the Solve method.
Definition at line 145 of file nmrLSNonLinJacobianSolver.h.
References Allocate().
| nmrLSNonLinJacobianSolver::nmrLSNonLinJacobianSolver | ( | CISSTNETLIB_INTEGER | m, | |
| CISSTNETLIB_INTEGER | n | |||
| ) | [inline] |
Constructor with memory allocation. This constructor allocates the memory based on M and N. It relies on the method Allocate(). The next call to the Solve() method will check that the parameters match the dimension.
| m | Number of nonlinear functions. | |
| n | Number of variables This order will be used for the output as well. |
Definition at line 160 of file nmrLSNonLinJacobianSolver.h.
References Allocate().
| nmrLSNonLinJacobianSolver::nmrLSNonLinJacobianSolver | ( | vctDynamicVector< CISSTNETLIB_DOUBLE > & | X, | |
| vctDynamicVector< CISSTNETLIB_DOUBLE > & | F | |||
| ) | [inline] |
Constructor with memory allocation. This constructor allocates the memory based on the actual input of the Solve() method. It relies on the method Allocate(). The next call to the Solve() method will check that the parameters match the dimension and storage order.
Definition at line 172 of file nmrLSNonLinJacobianSolver.h.
References Allocate().
| nmrLSNonLinJacobianSolver::nmrLSNonLinJacobianSolver | ( | vctDynamicVector< CISSTNETLIB_DOUBLE > & | X, | |
| vctDynamicVector< CISSTNETLIB_DOUBLE > & | F | |||
| ) | [inline] |
Constructor with memory allocation. This constructor allocates the memory based on the actual input of the Solve() method. It relies on the method Allocate(). The next call to the Solve() method will check that the parameters match the dimension and storage order.
Definition at line 172 of file nmrLSNonLinJacobianSolver.h.
References Allocate().
| void nmrLSNonLinJacobianSolver::Allocate | ( | CISSTNETLIB_INTEGER | m, | |
| CISSTNETLIB_INTEGER | n | |||
| ) | [inline] |
This method allocates the memory based on M and N. The next call to the Solve() method will check that the parameters match the dimension.
| m | Number of nonlinear functions | |
| n | Number of variables |
Definition at line 185 of file nmrLSNonLinJacobianSolver.h.
References IWork, Ldfjac, Lwork, M, N, vctDynamicVector< _elementType >::SetSize(), Tolerance, and Work.
Referenced by Allocate(), and nmrLSNonLinJacobianSolver().
| void nmrLSNonLinJacobianSolver::Allocate | ( | vctDynamicVector< CISSTNETLIB_DOUBLE > & | X, | |
| vctDynamicVector< CISSTNETLIB_DOUBLE > & | F | |||
| ) | [inline] |
Allocate memory to solve this problem. This method provides a convenient way to extract the required sizes from the input containers. The next call to the Solve() method will check that the parameters match the dimension.
Definition at line 201 of file nmrLSNonLinJacobianSolver.h.
References Allocate(), and vctDynamicConstVectorBase< vctDynamicVectorOwner< _elementType >, _elementType >::size().
| void nmrLSNonLinJacobianSolver::Solve | ( | nmrCallBackFunctionF< __instanceLineF, __elementTypeF > & | callBackF, | |
| nmrCallBackFunctionJ< __instanceLineJ, __elementTypeJ > & | callBackJ, | |||
| vctDynamicVector< CISSTNETLIB_DOUBLE > & | X, | |||
| vctDynamicVector< CISSTNETLIB_DOUBLE > & | F, | |||
| vctDynamicVector< CISSTNETLIB_DOUBLE > & | J, | |||
| CISSTNETLIB_DOUBLE | tolerance | |||
| ) | throw (std::runtime_error) [inline] |
This computes the solves nonlinear least squares problem invloving M functions in N variables. On input, X contains the starting point, On output, X contains the final estimate, F contrains the final value
Definition at line 218 of file nmrLSNonLinJacobianSolver.h.
References cmnThrow(), Info, IWork, Ldfjac, Lwork, M, N, vctDynamicVectorBase< _vectorOwnerType, _elementType >::Pointer(), Tolerance, and Work.