cisst-saw
Loading...
Searching...
No Matches
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) CISST_THROW(std
void Solve (vctDynamicMatrix< CISSTNETLIB_DOUBLE > &W) CISST_THROW(std
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() [1/3]

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() [2/3]

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() [3/3]

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

◆ Allocate() [1/2]

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

◆ Allocate() [2/2]

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.

◆ GetRNormE()

CISSTNETLIB_DOUBLE nmrLSEISolver::GetRNormE ( void ) const
inline

◆ GetRNormL()

CISSTNETLIB_DOUBLE nmrLSEISolver::GetRNormL ( void ) const
inline

◆ GetX()

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

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

◆ Solve() [1/2]

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

◆ Solve() [2/2]

void nmrLSEISolver::Solve ( vctDynamicMatrix< CISSTNETLIB_DOUBLE > & W)
inline

Member Data Documentation

◆ ARef

vctDynamicMatrix<CISSTNETLIB_DOUBLE>::Submatrix::Type nmrLSEISolver::ARef
protected

◆ bRef

vctDynamicMatrix<CISSTNETLIB_DOUBLE>::Submatrix::Type nmrLSEISolver::bRef
protected

◆ ERef

vctDynamicMatrix<CISSTNETLIB_DOUBLE>::Submatrix::Type nmrLSEISolver::ERef
protected

◆ fRef

vctDynamicMatrix<CISSTNETLIB_DOUBLE>::Submatrix::Type nmrLSEISolver::fRef
protected

◆ GRef

vctDynamicMatrix<CISSTNETLIB_DOUBLE>::Submatrix::Type nmrLSEISolver::GRef
protected

◆ hRef

vctDynamicMatrix<CISSTNETLIB_DOUBLE>::Submatrix::Type nmrLSEISolver::hRef
protected

◆ Index

vctDynamicMatrix<CISSTNETLIB_INTEGER> nmrLSEISolver::Index
protected

◆ MA

CISSTNETLIB_INTEGER nmrLSEISolver::MA
protected

◆ MDW

CISSTNETLIB_INTEGER nmrLSEISolver::MDW
protected

◆ ME

CISSTNETLIB_INTEGER nmrLSEISolver::ME
protected

◆ MG

CISSTNETLIB_INTEGER nmrLSEISolver::MG
protected

◆ Mode

CISSTNETLIB_INTEGER nmrLSEISolver::Mode
protected

◆ N

CISSTNETLIB_INTEGER nmrLSEISolver::N
protected

◆ Options

vctDynamicMatrix<CISSTNETLIB_DOUBLE> nmrLSEISolver::Options
protected

◆ RNormE

CISSTNETLIB_DOUBLE nmrLSEISolver::RNormE
protected

◆ RNormL

CISSTNETLIB_DOUBLE nmrLSEISolver::RNormL
protected

◆ W

vctDynamicMatrix<CISSTNETLIB_DOUBLE> nmrLSEISolver::W
protected

◆ Work

vctDynamicMatrix<CISSTNETLIB_DOUBLE> nmrLSEISolver::Work
protected

◆ X

vctDynamicMatrix<CISSTNETLIB_DOUBLE> nmrLSEISolver::X
protected

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