cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
nmrLDPSolver Class Reference

#include <nmrLDPSolver.h>

Public Member Functions

 nmrLDPSolver (void)
 
 nmrLDPSolver (CISSTNETLIB_INTEGER m, CISSTNETLIB_INTEGER n)
 
 nmrLDPSolver (vctDynamicMatrix< CISSTNETLIB_DOUBLE > &G, vctDynamicMatrix< CISSTNETLIB_DOUBLE > &h)
 
void Allocate (CISSTNETLIB_INTEGER m, CISSTNETLIB_INTEGER n)
 
void Allocate (vctDynamicMatrix< CISSTNETLIB_DOUBLE > &G, vctDynamicMatrix< CISSTNETLIB_DOUBLE > &CMN_UNUSED(h))
 
CISST_EXPORT void Solve (vctDynamicMatrix< CISSTNETLIB_DOUBLE > &G, vctDynamicMatrix< CISSTNETLIB_DOUBLE > &h) throw (std::runtime_error)
 
const vctDynamicMatrix
< CISSTNETLIB_DOUBLE > & 
GetX (void) const
 

Protected Attributes

CISSTNETLIB_INTEGER M
 
CISSTNETLIB_INTEGER N
 
vctDynamicMatrix
< CISSTNETLIB_DOUBLE > 
E
 
vctDynamicMatrix
< CISSTNETLIB_DOUBLE > 
CopyE
 
vctDynamicMatrix
< CISSTNETLIB_DOUBLE > 
F
 
vctDynamicMatrix
< CISSTNETLIB_DOUBLE > 
R
 
vctDynamicMatrix
< CISSTNETLIB_DOUBLE > 
U
 
vctDynamicMatrix
< CISSTNETLIB_DOUBLE > 
W
 
vctDynamicMatrix
< CISSTNETLIB_INTEGER > 
Index
 
vctDynamicMatrix
< CISSTNETLIB_DOUBLE > 
Zz
 
vctDynamicMatrix
< CISSTNETLIB_DOUBLE > 
X
 

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.

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.

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
mNumber of rows of G
nNumber of columns of G
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.

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
mNumber of rows of G
nNumber of columns of G
void nmrLDPSolver::Allocate ( vctDynamicMatrix< CISSTNETLIB_DOUBLE > &  G,
vctDynamicMatrix< CISSTNETLIB_DOUBLE > &  CMN_UNUSED
)
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.

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

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

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).

Member Data Documentation

vctDynamicMatrix<CISSTNETLIB_DOUBLE> nmrLDPSolver::CopyE
protected
vctDynamicMatrix<CISSTNETLIB_DOUBLE> nmrLDPSolver::E
protected
vctDynamicMatrix<CISSTNETLIB_DOUBLE> nmrLDPSolver::F
protected
vctDynamicMatrix<CISSTNETLIB_INTEGER> nmrLDPSolver::Index
protected
CISSTNETLIB_INTEGER nmrLDPSolver::M
protected
CISSTNETLIB_INTEGER nmrLDPSolver::N
protected
vctDynamicMatrix<CISSTNETLIB_DOUBLE> nmrLDPSolver::R
protected
vctDynamicMatrix<CISSTNETLIB_DOUBLE> nmrLDPSolver::U
protected
vctDynamicMatrix<CISSTNETLIB_DOUBLE> nmrLDPSolver::W
protected
vctDynamicMatrix<CISSTNETLIB_DOUBLE> nmrLDPSolver::X
protected
vctDynamicMatrix<CISSTNETLIB_DOUBLE> nmrLDPSolver::Zz
protected

The documentation for this class was generated from the following file: