#include <nmrLSSolver.h>
Collaboration diagram for nmrLSSolver:

The following options are provided:
1. If m >= n: find the least squares solution of an overdetermined system, i.e., solve the least squares problem 
2. If m < n: find the minimum norm solution of an underdetermined system 
The data members of this class are:
.
.
.
.
.
. For optimal performance,
. where
and
is the optimum block size.
.The input/output from this class is:
matrix A. On exit, if M >= N, A is overwritten by details of its QR factorization if M < N, A is overwritten by details of its LQ factorization
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 93 of file nmrLSSolver.h.
| nmrLSSolver::nmrLSSolver | ( | 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 115 of file nmrLSSolver.h.
References Allocate(), M, N, NRHS, and StorageOrder.
| nmrLSSolver::nmrLSSolver | ( | CISSTNETLIB_INTEGER | m, | |
| CISSTNETLIB_INTEGER | n, | |||
| CISSTNETLIB_INTEGER | nrhs, | |||
| bool | storageOrder | |||
| ) | [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.
| m | Number of rows of A | |
| n | Number of columns of A | |
| nrhs | Number of columns of B | |
| storageOrder | Storage order used for the input matrix. This order will be used for the output as well. |
Definition at line 136 of file nmrLSSolver.h.
References Allocate().
| nmrLSSolver::nmrLSSolver | ( | vctDynamicMatrix< double > & | A, | |
| vctDynamicMatrix< double > & | B | |||
| ) | [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 147 of file nmrLSSolver.h.
References Allocate().
| nmrLSSolver::nmrLSSolver | ( | vctDynamicMatrix< double > & | A, | |
| vctDynamicMatrix< double > & | B | |||
| ) | [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 147 of file nmrLSSolver.h.
References Allocate().
| void nmrLSSolver::Allocate | ( | CISSTNETLIB_INTEGER | m, | |
| CISSTNETLIB_INTEGER | n, | |||
| CISSTNETLIB_INTEGER | nrhs, | |||
| bool | storageOrder | |||
| ) | [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.
| m | Number of rows of A | |
| n | Number of columns of A | |
| nrhs | Number of columns of B | |
| storageOrder | Storage order used for all the matrices |
Definition at line 162 of file nmrLSSolver.h.
References Lda, Ldb, Lwork, M, N, NRHS, vctDynamicMatrix< _elementType >::SetSize(), StorageOrder, Trans, and Work.
Referenced by Allocate(), and nmrLSSolver().
| void nmrLSSolver::Allocate | ( | vctDynamicMatrix< double > & | A, | |
| vctDynamicMatrix< double > & | B | |||
| ) | [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 182 of file nmrLSSolver.h.
References Allocate(), vctDynamicConstMatrixBase< vctDynamicMatrixOwner< _elementType >, _elementType >::cols(), vctDynamicConstMatrixBase< vctDynamicMatrixOwner< _elementType >, _elementType >::IsRowMajor(), and vctDynamicConstMatrixBase< vctDynamicMatrixOwner< _elementType >, _elementType >::rows().
| void nmrLSSolver::Solve | ( | vctDynamicMatrixBase< _matrixOwnerType, double > & | A, | |
| vctDynamicMatrixBase< _matrixOwnerType, double > & | B | |||
| ) | throw (std::runtime_error) [inline] |
This computes the solves overdetermined or underdetermined real linear systems involving an M-by-N matrix A, using the right hand side M-by-NRHS matrix B.
Definition at line 194 of file nmrLSSolver.h.
References cmnThrow(), Info, Lda, Ldb, Lwork, M, N, NRHS, vctDynamicMatrixBase< _matrixOwnerType, _elementType >::Pointer(), StorageOrder, Trans, and Work.