ERC CISST - cisst software

nmrFnSolver Class Reference
[Numerical Methods]

#include <nmrFnSolver.h>

Collaboration diagram for nmrFnSolver:

Collaboration graph
[legend]
List of all members.

Detailed Description

Algorithm Fn: Solve nonlinear set of equations using Powell's method The purpose of this class is to find a zero of a system of N nonlinear functions in N variables by a modification of the powell hybrid method. the user must provide a subroutine which calculates the functions and the jacobian.

The data members of this class are:

info = 0 improper input parameters.

info = 1 algorithm estimates that the relative error between x and the solution is at most tol.

info = 2 number of calls to user function has reached 200*(n+1).

info = 3 tol is too small. no further improvement in the approximate solution x is possible.

info = 4 iteration is not making good progress.

The input/output from this class is:

The following constructor can be used to contruct the nmrCallBackFnSolver 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. nmrCallBackFnSolver<nmrUNIQUE_IDENTIFIER_LINE, Cfoo> callBackObject(this, &Cfoo::Mbar);

Note:
This code relies on the ERC CISST cnetlib library. Since cnetlib is optional, make sure that CISST_HAS_CNETLIB has been turned ON during the configuration with CMake.

Definition at line 97 of file nmrFnSolver.h.

Public Member Functions

Protected Attributes


Constructor & Destructor Documentation

nmrFnSolver::nmrFnSolver ( 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 114 of file nmrFnSolver.h.

References Allocate().

nmrFnSolver::nmrFnSolver ( CISSTNETLIB_INTEGER  n  )  [inline]

Constructor with memory allocation. This constructor allocates the memory based on N. It relies on the method Allocate(). The next call to the Solve() method will check that the parameters match the dimension.

Parameters:
n Number of variables This order will be used for the output as well.

Definition at line 128 of file nmrFnSolver.h.

References Allocate().

nmrFnSolver::nmrFnSolver ( vctDynamicVector< CISSTNETLIB_DOUBLE > &  X  )  [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 140 of file nmrFnSolver.h.

References Allocate().

nmrFnSolver::nmrFnSolver ( vctDynamicVector< CISSTNETLIB_DOUBLE > &  X  )  [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 140 of file nmrFnSolver.h.

References Allocate().


Member Function Documentation

void nmrFnSolver::Allocate ( CISSTNETLIB_INTEGER  n  )  [inline]

This method allocates the memory based on N. The next call to the Solve() method will check that the parameters match the dimension.

Parameters:
n Number of variables

Definition at line 152 of file nmrFnSolver.h.

References Lwork, N, vctDynamicVector< _elementType >::SetSize(), Tolerance, and Work.

Referenced by Allocate(), and nmrFnSolver().

void nmrFnSolver::Allocate ( vctDynamicVector< CISSTNETLIB_DOUBLE > &  X  )  [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 165 of file nmrFnSolver.h.

References Allocate(), and vctDynamicConstVectorBase< vctDynamicVectorOwner< _elementType >, _elementType >::size().

template<int __instanceLine, class __elementType>
void nmrFnSolver::Solve ( nmrCallBackFunctionF< __instanceLine, __elementType > &  callBack,
vctDynamicVector< CISSTNETLIB_DOUBLE > &  X,
vctDynamicVector< CISSTNETLIB_DOUBLE > &  F,
CISSTNETLIB_DOUBLE  tolerance 
) throw (std::runtime_error) [inline]

This computes the solves nonlinear equations problem invloving N functions in N variables. On input, X contains the starting point, On output, X contains the final estimate F contains the final values

Definition at line 180 of file nmrFnSolver.h.

References cmnThrow(), Info, Lwork, N, vctDynamicVectorBase< _vectorOwnerType, _elementType >::Pointer(), Tolerance, and Work.


The documentation for this class was generated from the following file:
erc-cisst-devel<at>lists.johnshopkins.edu