ERC CISST - cisst software

nmrLDPSolver Class Reference
[Numerical Methods]

#include <nmrLDPSolver.h>

Collaboration diagram for nmrLDPSolver:

Collaboration graph
[legend]
List of all members.

Detailed Description

Algorithm LDP: Least Distance Programming

The original version of this code was developed by Charles L. Lawson and Richard J. Hanson at Jet Propulsion Laboratory 1974 MAR 1, and published in the book "Solving Least Squares Problems", Prentice-Hall, 1974.

Given a $ M \times N $ matrix G and a $ M \times 1 $ vector h, compute a $ N \times 1 $ vector X, that solves the linear distance problem:

$ \mbox{min} \; \| X \| \; \mbox{subject to} \; GX \geq h $

The data members of this class are:

Note:
The input matrices of this class must use a column major storage order. To do so, use VCT_COL_MAJOR whenever you declare a matrix. They must also be compact (see vctDynamicMatrix::IsFortran()).

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 75 of file nmrLDPSolver.h.

Public Member Functions

Protected Attributes


Constructor & Destructor Documentation

nmrLDPSolver::nmrLDPSolver ( 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 95 of file nmrLDPSolver.h.

References Allocate(), M, and N.

nmrLDPSolver::nmrLDPSolver ( 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.

Parameters:
m Number of rows of G
n Number of columns of G

Definition at line 111 of file nmrLDPSolver.h.

References Allocate().

nmrLDPSolver::nmrLDPSolver ( vctDynamicMatrix< CISSTNETLIB_DOUBLE > &  G,
vctDynamicMatrix< CISSTNETLIB_DOUBLE > &  h 
) [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.

Definition at line 121 of file nmrLDPSolver.h.

References Allocate().


Member Function Documentation

void nmrLDPSolver::Allocate ( CISSTNETLIB_INTEGER  m,
CISSTNETLIB_INTEGER  n 
) [inline]

This method allocates the memory based on Ma, Na and Mg. The next call to the Solve() method will check that the parameters match the dimension.

Parameters:
m Number of rows of G
n Number of columns of G

Definition at line 133 of file nmrLDPSolver.h.

References CopyE, E, F, Index, M, N, R, vctDynamicMatrix< _elementType >::SetSize(), U, VCT_COL_MAJOR, W, X, and Zz.

Referenced by Allocate(), nmrLSISolver::Allocate(), and nmrLDPSolver().

void nmrLDPSolver::Allocate ( vctDynamicMatrix< CISSTNETLIB_DOUBLE > &  G,
vctDynamicMatrix< CISSTNETLIB_DOUBLE > &  CMN_UNUSED(h) 
) [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 152 of file nmrLDPSolver.h.

References Allocate(), vctDynamicConstMatrixBase< vctDynamicMatrixOwner< _elementType >, _elementType >::cols(), and vctDynamicConstMatrixBase< vctDynamicMatrixOwner< _elementType >, _elementType >::rows().

CISST_EXPORT void nmrLDPSolver::Solve ( vctDynamicMatrix< CISSTNETLIB_DOUBLE > &  G,
vctDynamicMatrix< CISSTNETLIB_DOUBLE > &  h 
) throw (std::runtime_error)

Given a $ M \times N $ matrix G and a $ M \times 1 $ vector h, compute a $ N \times 1 $ vector X, that solves the linear distance problem:

$ \mbox{min} \; \| X \| \; \mbox{subject to} \; GX \geq h $

Note:
This method verifies that the input parameters are using a column major storage order and that they are compact. Both conditions are tested using vctDynamicMatrix::IsFortran(). If the parameters don't meet all the requirements, an exception is thrown (std::runtime_error).

const vctDynamicMatrix<CISSTNETLIB_DOUBLE>& nmrLDPSolver::GetX ( void   )  const [inline]

Get X. This method must be used after Solve().

Definition at line 173 of file nmrLDPSolver.h.

References X.


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