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

#include <nmrLSEISolver.h>

Public Member Functions

 nmrLSEISolver (void)
 
 nmrLSEISolver (CISSTNETLIB_INTEGER me, CISSTNETLIB_INTEGER ma, CISSTNETLIB_INTEGER mg, CISSTNETLIB_INTEGER n)
 
 nmrLSEISolver (vctDynamicMatrix< CISSTNETLIB_DOUBLE > &E, vctDynamicMatrix< CISSTNETLIB_DOUBLE > &A, vctDynamicMatrix< CISSTNETLIB_DOUBLE > &G)
 
void Allocate (CISSTNETLIB_INTEGER me, CISSTNETLIB_INTEGER ma, CISSTNETLIB_INTEGER mg, CISSTNETLIB_INTEGER n)
 
void Allocate (vctDynamicMatrix< CISSTNETLIB_DOUBLE > &E, vctDynamicMatrix< CISSTNETLIB_DOUBLE > &A, vctDynamicMatrix< CISSTNETLIB_DOUBLE > &G)
 
void Solve (vctDynamicMatrix< CISSTNETLIB_DOUBLE > &E, vctDynamicMatrix< CISSTNETLIB_DOUBLE > &f, vctDynamicMatrix< CISSTNETLIB_DOUBLE > &A, vctDynamicMatrix< CISSTNETLIB_DOUBLE > &b, vctDynamicMatrix< CISSTNETLIB_DOUBLE > &G, vctDynamicMatrix< CISSTNETLIB_DOUBLE > &h) throw (std::runtime_error)
 
void Solve (vctDynamicMatrix< CISSTNETLIB_DOUBLE > &W) throw (std::runtime_error)
 
const vctDynamicMatrix
< CISSTNETLIB_DOUBLE > & 
GetX (void) const
 
CISSTNETLIB_DOUBLE GetRNormE (void) const
 
CISSTNETLIB_DOUBLE GetRNormL (void) const
 

Protected Attributes

CISSTNETLIB_INTEGER ME
 
CISSTNETLIB_INTEGER MA
 
CISSTNETLIB_INTEGER MG
 
CISSTNETLIB_INTEGER MDW
 
CISSTNETLIB_INTEGER N
 
CISSTNETLIB_INTEGER Mode
 
CISSTNETLIB_DOUBLE RNormE
 
CISSTNETLIB_DOUBLE RNormL
 
vctDynamicMatrix
< CISSTNETLIB_DOUBLE > 
Options
 
vctDynamicMatrix
< CISSTNETLIB_DOUBLE > 
X
 
vctDynamicMatrix
< CISSTNETLIB_DOUBLE > 
W
 
vctDynamicMatrix
< CISSTNETLIB_DOUBLE >
::Submatrix::Type 
ERef
 
vctDynamicMatrix
< CISSTNETLIB_DOUBLE >
::Submatrix::Type 
ARef
 
vctDynamicMatrix
< CISSTNETLIB_DOUBLE >
::Submatrix::Type 
GRef
 
vctDynamicMatrix
< CISSTNETLIB_DOUBLE >
::Submatrix::Type 
fRef
 
vctDynamicMatrix
< CISSTNETLIB_DOUBLE >
::Submatrix::Type 
bRef
 
vctDynamicMatrix
< CISSTNETLIB_DOUBLE >
::Submatrix::Type 
hRef
 
vctDynamicMatrix
< CISSTNETLIB_DOUBLE > 
Work
 
vctDynamicMatrix
< CISSTNETLIB_INTEGER > 
Index
 

Constructor & Destructor Documentation

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

nmrLSEISolver::nmrLSEISolver ( CISSTNETLIB_INTEGER  me,
CISSTNETLIB_INTEGER  ma,
CISSTNETLIB_INTEGER  mg,
CISSTNETLIB_INTEGER  n 
)
inline

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

nmrLSEISolver::nmrLSEISolver ( vctDynamicMatrix< CISSTNETLIB_DOUBLE > &  E,
vctDynamicMatrix< CISSTNETLIB_DOUBLE > &  A,
vctDynamicMatrix< CISSTNETLIB_DOUBLE > &  G 
)
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 nmrLSEISolver::Allocate ( CISSTNETLIB_INTEGER  me,
CISSTNETLIB_INTEGER  ma,
CISSTNETLIB_INTEGER  mg,
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.

Parameters
meNumber of rows of E
maNumber of rows of A
mgNumber of rows of G
nNumber of unknowns
void nmrLSEISolver::Allocate ( vctDynamicMatrix< CISSTNETLIB_DOUBLE > &  E,
vctDynamicMatrix< CISSTNETLIB_DOUBLE > &  A,
vctDynamicMatrix< CISSTNETLIB_DOUBLE > &  G 
)
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.

CISSTNETLIB_DOUBLE nmrLSEISolver::GetRNormE ( void  ) const
inline
CISSTNETLIB_DOUBLE nmrLSEISolver::GetRNormL ( void  ) const
inline
const vctDynamicMatrix<CISSTNETLIB_DOUBLE>& nmrLSEISolver::GetX ( void  ) const
inline

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

void nmrLSEISolver::Solve ( vctDynamicMatrix< CISSTNETLIB_DOUBLE > &  E,
vctDynamicMatrix< CISSTNETLIB_DOUBLE > &  f,
vctDynamicMatrix< CISSTNETLIB_DOUBLE > &  A,
vctDynamicMatrix< CISSTNETLIB_DOUBLE > &  b,
vctDynamicMatrix< CISSTNETLIB_DOUBLE > &  G,
vctDynamicMatrix< CISSTNETLIB_DOUBLE > &  h 
)
throw (std::runtime_error
)
inline

Given a $ M \times N$ matrix A, and a $ M \times 1 $ vector B, compute a $ N \times 1 $ vector X, that solves the least squares problem:

$ \mbox{min} \; 1 / 2 \| AX - B \| \; \mbox{subject to} \; EX = F; 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).
This version of Solve does a copy to ensure that the matrix passed to LSEI is one continous block of memory. If too large a matrix are used it is recommended to use the other version, where the user constructs the matrix W and passes it. The third alternative is to set get refrence to individual chunks of this objects W.
void nmrLSEISolver::Solve ( vctDynamicMatrix< CISSTNETLIB_DOUBLE > &  W)
throw (std::runtime_error
)
inline

Member Data Documentation

vctDynamicMatrix<CISSTNETLIB_DOUBLE>::Submatrix::Type nmrLSEISolver::ARef
protected
vctDynamicMatrix<CISSTNETLIB_DOUBLE>::Submatrix::Type nmrLSEISolver::bRef
protected
vctDynamicMatrix<CISSTNETLIB_DOUBLE>::Submatrix::Type nmrLSEISolver::ERef
protected
vctDynamicMatrix<CISSTNETLIB_DOUBLE>::Submatrix::Type nmrLSEISolver::fRef
protected
vctDynamicMatrix<CISSTNETLIB_DOUBLE>::Submatrix::Type nmrLSEISolver::GRef
protected
vctDynamicMatrix<CISSTNETLIB_DOUBLE>::Submatrix::Type nmrLSEISolver::hRef
protected
vctDynamicMatrix<CISSTNETLIB_INTEGER> nmrLSEISolver::Index
protected
CISSTNETLIB_INTEGER nmrLSEISolver::MA
protected
CISSTNETLIB_INTEGER nmrLSEISolver::MDW
protected
CISSTNETLIB_INTEGER nmrLSEISolver::ME
protected
CISSTNETLIB_INTEGER nmrLSEISolver::MG
protected
CISSTNETLIB_INTEGER nmrLSEISolver::Mode
protected
CISSTNETLIB_INTEGER nmrLSEISolver::N
protected
vctDynamicMatrix<CISSTNETLIB_DOUBLE> nmrLSEISolver::Options
protected
CISSTNETLIB_DOUBLE nmrLSEISolver::RNormE
protected
CISSTNETLIB_DOUBLE nmrLSEISolver::RNormL
protected
vctDynamicMatrix<CISSTNETLIB_DOUBLE> nmrLSEISolver::W
protected
vctDynamicMatrix<CISSTNETLIB_DOUBLE> nmrLSEISolver::Work
protected
vctDynamicMatrix<CISSTNETLIB_DOUBLE> nmrLSEISolver::X
protected

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