cisst-saw
|
#include <nmrLSqLin.h>
Classes | |
class | Friend |
Public Member Functions | |
nmrLSqLinSolutionDynamic () | |
nmrLSqLinSolutionDynamic (size_t ma, size_t n) | |
nmrLSqLinSolutionDynamic (size_t ma, size_t mg, size_t n) | |
nmrLSqLinSolutionDynamic (size_t ma, size_t me, size_t mg, size_t n) | |
template<typename _matrixOwnerTypeA > | |
nmrLSqLinSolutionDynamic (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A) | |
template<typename _matrixOwnerTypeA , typename _vectorOwnerTypeWork > | |
nmrLSqLinSolutionDynamic (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &inWork) | |
template<typename _vectorOwnerTypeX , typename _vectorOwnerTypeWork > | |
nmrLSqLinSolutionDynamic (size_t ma, size_t n, vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > &inX, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &inWork) | |
template<typename _vectorOwnerTypeX > | |
nmrLSqLinSolutionDynamic (size_t ma, size_t n, vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > &inX) | |
template<typename _matrixOwnerTypeA , typename _vectorOwnerTypeX , typename _vectorOwnerTypeWork > | |
nmrLSqLinSolutionDynamic (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &inA, vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > &inX, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &inWork) | |
template<typename _matrixOwnerTypeA , typename _matrixOwnerTypeG > | |
nmrLSqLinSolutionDynamic (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A, vctDynamicMatrixBase< _matrixOwnerTypeG, CISSTNETLIB_DOUBLE > &G) | |
template<typename _matrixOwnerTypeA , typename _matrixOwnerTypeG , typename _vectorOwnerTypeWork , typename _vectorOwnerTypeIWork > | |
nmrLSqLinSolutionDynamic (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A, vctDynamicMatrixBase< _matrixOwnerTypeG, CISSTNETLIB_DOUBLE > &G, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &inWork, vctDynamicVectorBase< _vectorOwnerTypeIWork, CISSTNETLIB_INTEGER > &inIWork) | |
template<typename _vectorOwnerTypeX , typename _vectorOwnerTypeWork , typename _vectorOwnerTypeIWork > | |
nmrLSqLinSolutionDynamic (size_t ma, size_t mg, size_t n, vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > &inX, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &inWork, vctDynamicVectorBase< _vectorOwnerTypeIWork, CISSTNETLIB_INTEGER > &inIWork) | |
template<typename _vectorOwnerTypeX > | |
nmrLSqLinSolutionDynamic (size_t ma, size_t mg, size_t n, vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > &inX) | |
template<typename _matrixOwnerTypeA , typename _matrixOwnerTypeG , typename _vectorOwnerTypeX , typename _vectorOwnerTypeWork , typename _vectorOwnerTypeIWork > | |
nmrLSqLinSolutionDynamic (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &inA, vctDynamicMatrixBase< _matrixOwnerTypeG, CISSTNETLIB_DOUBLE > &inG, vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > &inX, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &inWork, vctDynamicVectorBase< _vectorOwnerTypeIWork, CISSTNETLIB_INTEGER > &inIWork) | |
template<typename _matrixOwnerTypeA , typename _matrixOwnerTypeE , typename _matrixOwnerTypeG > | |
nmrLSqLinSolutionDynamic (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A, vctDynamicMatrixBase< _matrixOwnerTypeE, CISSTNETLIB_DOUBLE > &E, vctDynamicMatrixBase< _matrixOwnerTypeG, CISSTNETLIB_DOUBLE > &G) | |
template<typename _matrixOwnerTypeA , typename _matrixOwnerTypeE , typename _matrixOwnerTypeG , typename _vectorOwnerTypeWork , typename _vectorOwnerTypeIWork > | |
nmrLSqLinSolutionDynamic (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A, vctDynamicMatrixBase< _matrixOwnerTypeE, CISSTNETLIB_DOUBLE > &E, vctDynamicMatrixBase< _matrixOwnerTypeG, CISSTNETLIB_DOUBLE > &G, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &inWork, vctDynamicVectorBase< _vectorOwnerTypeIWork, CISSTNETLIB_INTEGER > &inIWork) | |
template<typename _vectorOwnerTypeX , typename _vectorOwnerTypeWork , typename _vectorOwnerTypeIWork > | |
nmrLSqLinSolutionDynamic (size_t ma, size_t me, size_t mg, size_t n, vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > &inX, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &inWork, vctDynamicVectorBase< _vectorOwnerTypeIWork, CISSTNETLIB_INTEGER > &inIWork) | |
template<typename _vectorOwnerTypeX > | |
nmrLSqLinSolutionDynamic (size_t ma, size_t me, size_t mg, size_t n, vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > &inX) | |
template<typename _matrixOwnerTypeA , typename _matrixOwnerTypeE , typename _matrixOwnerTypeG , typename _vectorOwnerTypeX , typename _vectorOwnerTypeWork , typename _vectorOwnerTypeIWork > | |
nmrLSqLinSolutionDynamic (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &inA, vctDynamicMatrixBase< _matrixOwnerTypeE, CISSTNETLIB_DOUBLE > &inE, vctDynamicMatrixBase< _matrixOwnerTypeG, CISSTNETLIB_DOUBLE > &inG, vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > &inX, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &inWork, vctDynamicVectorBase< _vectorOwnerTypeIWork, CISSTNETLIB_INTEGER > &inIWork) | |
template<typename _matrixOwnerTypeA > | |
void | Allocate (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A) |
template<typename _matrixOwnerTypeA , typename _vectorOwnerTypeWork > | |
void | Allocate (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &inWork) |
template<typename _matrixOwnerTypeA , typename _vectorOwnerTypeX , typename _vectorOwnerTypeWork > | |
void | SetRef (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &inA, vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > &inX, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &inWork) |
template<typename _matrixOwnerTypeA , typename _vectorOwnerTypeX > | |
void | SetRef (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &inA, vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > &inX) |
template<typename _matrixOwnerTypeA , typename _matrixOwnerTypeG > | |
void | Allocate (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A, vctDynamicMatrixBase< _matrixOwnerTypeG, CISSTNETLIB_DOUBLE > &G) |
template<typename _matrixOwnerTypeA , typename _matrixOwnerTypeG , typename _vectorOwnerTypeWork , typename _vectorOwnerTypeIWork > | |
void | Allocate (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A, vctDynamicMatrixBase< _matrixOwnerTypeG, CISSTNETLIB_DOUBLE > &G, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &inWork, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &inIWork) |
template<typename _matrixOwnerTypeA , typename _matrixOwnerTypeG , typename _vectorOwnerTypeX , typename _vectorOwnerTypeWork , typename _vectorOwnerTypeIWork > | |
void | SetRef (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &inA, vctDynamicMatrixBase< _matrixOwnerTypeG, CISSTNETLIB_DOUBLE > &inG, vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > &inX, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &inWork, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &inIWork) |
template<typename _matrixOwnerTypeA , typename _matrixOwnerTypeG , typename _vectorOwnerTypeX > | |
void | SetRef (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &inA, vctDynamicMatrixBase< _matrixOwnerTypeG, CISSTNETLIB_DOUBLE > &inG, vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > &inX) |
template<typename _matrixOwnerTypeA , typename _matrixOwnerTypeE , typename _matrixOwnerTypeG > | |
void | Allocate (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A, vctDynamicMatrixBase< _matrixOwnerTypeE, CISSTNETLIB_DOUBLE > &E, vctDynamicMatrixBase< _matrixOwnerTypeG, CISSTNETLIB_DOUBLE > &G) |
template<typename _matrixOwnerTypeA , typename _matrixOwnerTypeE , typename _matrixOwnerTypeG , typename _vectorOwnerTypeWork , typename _vectorOwnerTypeIWork > | |
void | Allocate (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A, vctDynamicMatrixBase< _matrixOwnerTypeE, CISSTNETLIB_DOUBLE > &E, vctDynamicMatrixBase< _matrixOwnerTypeG, CISSTNETLIB_DOUBLE > &G, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &inWork, vctDynamicVectorBase< _vectorOwnerTypeIWork, CISSTNETLIB_DOUBLE > &inIWork) |
template<typename _matrixOwnerTypeA , typename _matrixOwnerTypeE , typename _matrixOwnerTypeG , typename _vectorOwnerTypeX , typename _vectorOwnerTypeWork , typename _vectorOwnerTypeIWork > | |
void | SetRef (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &inA, vctDynamicMatrixBase< _matrixOwnerTypeE, CISSTNETLIB_DOUBLE > &inE, vctDynamicMatrixBase< _matrixOwnerTypeG, CISSTNETLIB_DOUBLE > &inG, vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > &inX, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &inWork, vctDynamicVectorBase< _vectorOwnerTypeIWork, CISSTNETLIB_DOUBLE > &inIWork) |
template<typename _matrixOwnerTypeA , typename _matrixOwnerTypeE , typename _matrixOwnerTypeG , typename _vectorOwnerTypeX > | |
void | SetRef (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &inA, vctDynamicMatrixBase< _matrixOwnerTypeE, CISSTNETLIB_DOUBLE > &inE, vctDynamicMatrixBase< _matrixOwnerTypeG, CISSTNETLIB_DOUBLE > &inG, vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > &inX) |
void | Allocate (size_t ma, size_t me, size_t mg, size_t n) |
template<typename _vectorOwnerTypeWork > | |
void | Allocate (size_t ma, size_t me, size_t mg, size_t n, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &inWork) |
template<typename _vectorOwnerTypeWork , typename _vectorOwnerTypeIWork > | |
void | Allocate (size_t ma, size_t me, size_t mg, size_t n, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &inWork, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &inIWork) |
template<typename _vectorOwnerTypeX , typename _vectorOwnerTypeWork > | |
void | SetRef (size_t ma, size_t me, size_t mg, size_t n, vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > &inX, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &inWork) |
template<typename _vectorOwnerTypeX , typename _vectorOwnerTypeWork , typename _vectorOwnerTypeIWork > | |
void | SetRef (size_t ma, size_t me, size_t mg, size_t n, vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > &inX, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &inWork, vctDynamicVectorBase< _vectorOwnerTypeIWork, CISSTNETLIB_DOUBLE > &inIWork) |
template<typename _vectorOwnerTypeX > | |
void | SetRef (size_t ma, size_t me, size_t mg, size_t n, vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > &inX) |
const vctDynamicVectorRef < CISSTNETLIB_DOUBLE > & | GetX (void) const |
const vctDynamicVectorRef < CISSTNETLIB_DOUBLE > & | GetRNorm (void) const |
const vctDynamicVectorRef < CISSTNETLIB_DOUBLE > & | GetRNormE (void) const |
Static Public Member Functions | |
static CISSTNETLIB_INTEGER | GetWorkspaceSize (size_t ma, size_t me, size_t mg, size_t n) |
static CISSTNETLIB_INTEGER | GetIWorkspaceSize (size_t CMN_UNUSED(ma), size_t me, size_t mg, size_t n) |
static CISSTNETLIB_INTEGER | QueryWorkspaceSize_LS (size_t ma, size_t n) |
template<typename _matrixOwnerTypeA > | |
static CISSTNETLIB_INTEGER | GetWorkspaceSize (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &inA) |
template<typename _matrixOwnerTypeA , typename _matrixOwnerTypeG > | |
static CISSTNETLIB_INTEGER | GetWorkspaceSize (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &inA, vctDynamicMatrixBase< _matrixOwnerTypeG, CISSTNETLIB_DOUBLE > &inG) |
template<typename _matrixOwnerTypeA , typename _matrixOwnerTypeG > | |
static CISSTNETLIB_INTEGER | GetIWorkspaceSize (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &inA, vctDynamicMatrixBase< _matrixOwnerTypeG, CISSTNETLIB_DOUBLE > &inG) |
template<typename _matrixOwnerTypeA , typename _matrixOwnerTypeE , typename _matrixOwnerTypeG > | |
static CISSTNETLIB_INTEGER | GetWorkspaceSize (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &inA, vctDynamicMatrixBase< _matrixOwnerTypeE, CISSTNETLIB_DOUBLE > &inE, vctDynamicMatrixBase< _matrixOwnerTypeG, CISSTNETLIB_DOUBLE > &inG) |
template<typename _matrixOwnerTypeA , typename _matrixOwnerTypeE , typename _matrixOwnerTypeG > | |
static CISSTNETLIB_INTEGER | GetIWorkspaceSize (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &inA, vctDynamicMatrixBase< _matrixOwnerTypeE, CISSTNETLIB_DOUBLE > &inE, vctDynamicMatrixBase< _matrixOwnerTypeG, CISSTNETLIB_DOUBLE > &inG) |
static void | AllocateWorkspace (CISSTNETLIB_INTEGER ma, CISSTNETLIB_INTEGER me, CISSTNETLIB_INTEGER mg, CISSTNETLIB_INTEGER n, vctDynamicVector< CISSTNETLIB_DOUBLE > &inWork) |
static void | AllocateIWorkspace (CISSTNETLIB_INTEGER ma, CISSTNETLIB_INTEGER me, CISSTNETLIB_INTEGER mg, CISSTNETLIB_INTEGER n, vctDynamicVector< CISSTNETLIB_INTEGER > &inIWork) |
template<typename _matrixOwnerTypeA > | |
static void | AllocateWorkspace (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &inA, vctDynamicVector< CISSTNETLIB_DOUBLE > &inWork) |
template<typename _matrixOwnerTypeA , typename _matrixOwnerTypeG > | |
static void | AllocateWorkspace (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &inA, vctDynamicMatrixBase< _matrixOwnerTypeG, CISSTNETLIB_DOUBLE > &inG, vctDynamicVector< CISSTNETLIB_DOUBLE > &inWork) |
template<typename _matrixOwnerTypeA , typename _matrixOwnerTypeG > | |
static void | AllocateIWorkspace (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &inA, vctDynamicMatrixBase< _matrixOwnerTypeG, CISSTNETLIB_DOUBLE > &inG, vctDynamicVector< CISSTNETLIB_INTEGER > &inIWork) |
template<typename _matrixOwnerTypeA , typename _matrixOwnerTypeE , typename _matrixOwnerTypeG > | |
static void | AllocateWorkspace (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &inA, vctDynamicMatrixBase< _matrixOwnerTypeE, CISSTNETLIB_DOUBLE > &inE, vctDynamicMatrixBase< _matrixOwnerTypeG, CISSTNETLIB_DOUBLE > &inG, vctDynamicVector< CISSTNETLIB_DOUBLE > &inWork) |
template<typename _matrixOwnerTypeA , typename _matrixOwnerTypeE , typename _matrixOwnerTypeG > | |
static void | AllocateIWorkspace (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &inA, vctDynamicMatrixBase< _matrixOwnerTypeE, CISSTNETLIB_DOUBLE > &inE, vctDynamicMatrixBase< _matrixOwnerTypeG, CISSTNETLIB_DOUBLE > &inG, vctDynamicVector< CISSTNETLIB_INTEGER > &inIWork) |
Protected Member Functions | |
void | Malloc (size_t ma, size_t me, size_t mg, size_t n, bool allocateWorkspace, bool allocateInput, bool allocateOutput) |
template<typename _vectorOwnerTypeWork , typename _matrixOwnerTypeI , typename _vectorOwnerTypeX > | |
void | SetRef (size_t ma, size_t me, size_t mg, size_t n, vctDynamicVectorBase< _vectorOwnerTypeWork, CISSTNETLIB_DOUBLE > &work, vctDynamicMatrixBase< _matrixOwnerTypeI, CISSTNETLIB_DOUBLE > &input, vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > &x) |
Protected Attributes | |
vctDynamicVector < CISSTNETLIB_DOUBLE > | WorkspaceMemory |
vctDynamicVector < CISSTNETLIB_INTEGER > | IWorkspaceMemory |
vctDynamicVector < CISSTNETLIB_DOUBLE > | OutputMemory |
vctDynamicVector < CISSTNETLIB_DOUBLE > | RNorm |
vctDynamicMatrix < CISSTNETLIB_DOUBLE > | InputMemory |
vctDynamicMatrixRef < CISSTNETLIB_DOUBLE > | A |
vctDynamicMatrixRef < CISSTNETLIB_DOUBLE > | E |
vctDynamicMatrixRef < CISSTNETLIB_DOUBLE > | G |
vctDynamicVectorRef < CISSTNETLIB_DOUBLE > | b |
vctDynamicVectorRef < CISSTNETLIB_DOUBLE > | f |
vctDynamicVectorRef < CISSTNETLIB_DOUBLE > | h |
vctDynamicVectorRef < CISSTNETLIB_DOUBLE > | X |
vctDynamicVectorRef < CISSTNETLIB_DOUBLE > | RNormL |
vctDynamicVectorRef < CISSTNETLIB_DOUBLE > | RNormE |
vctDynamicVectorRef < CISSTNETLIB_DOUBLE > | Work |
vctDynamicVectorRef < CISSTNETLIB_INTEGER > | IWork |
size_t | m_Ma |
size_t | m_Me |
size_t | m_Mg |
size_t | m_N |
Friends | |
class | Friend |
There are three ways to call this method to solve the least-squares problem Ax = b, possibly subject to constraints. LS: Solves Ax = b LSI: Solves Ax = b, subject to Gx >= h (inequality constraint) LSEI: Solves Ax = b, subject to Ex = f and Gx >= h (inequality and equality constraints) Following examples illustrate the LS solution.
METHOD 1: User provides input and output matrices/vectors 1) The User allocates memory for these matrices and vectors. vctDynamicMatrix<CISSTNETLIB_DOUBLE> A(5, 4, VCT_COL_MAJOR); vctDynamicVector<CISSTNETLIB_DOUBLE> b(5); vctDynamicVector<CISSTNETLIB_DOUBLE> x(4); 2) The user calls the LS routine nmrLSqLin(A, b, x); The LSqLin method verifies that the size of the solution object matches the input, and allocates workspace memory, which is deallocated when the function ends. The LSqLin function alters the contents of matrix A and vector b. For fixed size the function call is templated by size, e.g. nmrLSqLin<4, 3>(A, b, x);
METHOD 2: Using a preallocated solution object 1) The user creates the input matrix/vector vctDynamicMatrix<CISSTNETLIB_DOUBLE> A(rows, cols, VCT_COL_MAJOR); vctDynamicVector<CISSTNETLIB_DOUBLE> b(rows); 2) The user allocates a solution object which could be of type nmrLSqLinSolutionFixedSize, nmrLSqLinSolutionDynamic and nmrLSqLinSolutionDynamicRef corresponding to fixed size, dynamic matrix or dynamic matrix reference. nmrLSqLinSolutionDynamic solution(A); 3) Call the nmrLSqLin function nmrLSqLin(A, b, solution); The contents of the input matrix A and vector b are modified by this routine. The output vector is available through solution.GetX().
METHOD 3: User provides input and output matrices/vectors and workspace required by LAPACK routine. 1) User creates input and output matrices and vector vctDynamicMatrix<CISSTNETLIB_DOUBLE> A(5, 4, VCT_COL_MAJOR); vctDynamicVector<CISSTNETLIB_DOUBLE> b(5); vctDynamicVector<CISSTNETLIB_DOUBLE> x(4); 2) User also needs to allocate memory for the workspace. This method is particularly useful when the user is using more than one numerical method from the library and is willing to share the workspace between them. In such a case, the user can allocate memory greater than the maximum required by the different methods. To aid the user to determine the minimum workspace required (and not spend time digging into LAPACK documentation) the library provides helper function nmrLSqLinSolutionDynamic::GetWorkspaceSize(input) vctDynamicVector<CISSTNETLIB_DOUBLE> Work(nmrLSqLinSolutionDynamic::GetWorkspaceSize(A)); 3) Call the LS function nmrLSqLin(A, b, x, Work); or For fixed size the above two steps are replaced by nmrLSqLinSolutionFixedSize<5, 0, 0, 4>::TypeWork Work; nmrLSqLin<5, 4>(A, b, x, Work);
This is the class for the composite solution container of LSqLin.
|
inline |
The default constuctor. For dynamic size, there are assigned default values, which MUST be changed by calling appropriate methods. (See nmrLSqLinSolutionDynamic::Allocate and nmrLSqLinSolutionDynamic::SetRef)
|
inline |
constructor to use with LS
|
inline |
constructor to use with LSI
|
inline |
constructor to use with LSEI
|
inline |
Constructor where user provides the input matrix to specify size. Memory allocation is done for output vector as well as for the Workspace used by LAPACK. This case covers the scenario where the user wants to make all system calls for memory allocation before entering time critical code sections.
A | input matrix |
|
inline |
Constructor where user provides the input matrix to specify size. Memory allocation is done for the workspace, inWork. This case covers the scenario where the user wants to make all system calls for memory allocation before entering time critical code sections and might be using more than one numerical method in the same thread, allowing him/her to share the workspace for LAPACK.
A | input matrix inWork workspace for LS |
|
inline |
Constructor where user provides the size of the input matrix, along with the output vector X and workspace. The solution object now acts as a composite container to hold, pass and manipulate a convenient storage for the LSqLin algorithm. Checks are made on the validity of the input and its consistency with the size of the input matrix.
ma,n | The size of input matrix |
inX | The output vector for LSqLin |
inWork | The workspace for LAPACK. |
|
inline |
Constructor where user provides the size of the input matrix, along with vector X. The solution object now acts as a composite container to hold, pass and manipulate a convenient storage for the LS algorithm. Checks are made on the validity of the input and its consistency with the size of input matrix. Memory allocation for the workspace is done by the method. This case covers the scenario where user wants to make all system calls for memory allocation before entering time critical code sections and might be using the LS matrix elsewhere in the same thread.
ma,n | The size of input matrix |
inX | The output vector for LSqLin |
|
inline |
Constructor where user provides the input matrix to specify size, along with vector X and workspace. The solution object now acts as a composite container to hold, pass and manipulate a convenient storage for the LS algorithm. Checks are made on the validity of the input and its consistency with the size of input matrix.
inA | The input matrix |
inX | The output vector for LSqLin |
inWork | The workspace for LAPACK. |
|
inline |
Constructor where user provides the input matrices to specify size. Memory allocation is done for the output vector as well as for the Workspace used by LAPACK. This case covers the scenario where the user wants to make all system calls for memory allocation before entering time critical code sections.
A,G | input matrices |
|
inline |
Constructor where user provides the input matrices to specify size and the workspaces. Memory allocation is done for the output vectors. This case covers the scenario where the user wants to make all system calls for memory allocation before entering time critical code sections and might be using more than one numerical method in the same thread, allowing him/her to share the workspace for LAPACK.
A,G | input matrices inWork, inIWork workspace for LSI |
|
inline |
Constructor where user provides the size of the input matrices along with output X and workspaces. The solution object now acts as a composite container to hold, pass and manipulate a convenient storage for the LSqLin algorithm. Checks are made on the validity of the input and its consistency with the size of the input matrices.
ma,mg,n | The size of input matrices |
inX | The output vector for LSqLin inWork, inIWork workspace for LSI |
|
inline |
Constructor where user provides the size and storage order of the input matrices, along with vector X. The solution object now acts as a composite container to hold, pass and manipulate a convenient storage for the LSI algorithm. Checks are made on the validity of the input and its consistency with the size of input matrices. Memory allocation for the workspace is done by the method. This case covers the scenario where the user wants to make all system calls for memory allocation before entering time critical code sections and might be using the LSI matrix elsewhere in the same thread.
ma,mg,n | The size of input matrices |
inX | The output vector for LSqLin |
|
inline |
Constructor where user provides the input matrices to specify size, along with vector X. The solution object now acts as a composite container to hold, pass and manipulate a convenient storage for the LSI algorithm. Checks are made on the validity of the input and its consistency with the size of the input matrix.
inA,inG | The input matrices |
inX | The output vector for LSqLin inWork, inIWork workspace for LSI |
|
inline |
Constructor where user provides the input matrices to specify size. Memory allocation is done for the output vector as well as the Workspace used by LAPACK. This case covers the scenario where the user wants to make all system calls for memory allocation before entering time critical code sections.
A,E,G | input matrices |
|
inline |
Constructor where user provides the input matrices to specify size and the workspaces. Memory allocation is done for the output vector. This case covers the scenario where the user wants to make all system calls for memory allocation before entering time critical code sections and might be using more than one numerical method in the same thread, allowing him/her to share the workspace for LAPACK.
A,E,G | input matrices inWork, inIWork workspace for LSI |
|
inline |
Constructor where user provides the size of the input matrices, the output vector X, and the workspaces. The solution object now acts as a composite container to hold, pass and manipulate a convenient storage for the LSqLin algorithm. Checks are made on the validity of the input and its consistency with the sizes of the input matrices.
ma,me,mg,n | The sizes of input matrices |
inX | The output vector for LSqLin inWork, inIWork workspace for LSI |
|
inline |
Constructor where user provides the size of the input matrices, along with vector X. The solution object now acts as a composite container to hold, pass and manipulate a convenient storage for the LSEI algorithm. Checks are made on the validity of the input and its consistency with the size of input matrices. Memory allocation for the workspace is done by the method. This case covers the scenario where the user wants to make all system calls for memory allocation before entering time critical code sections and might be using the LSEI matrix elsewhere in the same thread.
ma,me,mg,n | The size of input matrices |
inX | The output vector for LSqLin |
|
inline |
Constructor where user provides the input matrices to specify size, along with vector X and the workspaces The solution object now acts as a composite container to hold, pass and manipulate a convenient storage for the LSEI algorithm. Checks are made on the validity of the input and its consistency with the sizes of input matrices.
inA,inE,inG | The input matrices |
inX | The output vector for LSqLin inWork, inIWork workspace for LSI |
|
inline |
This method allocates memory of the output vector as well as the workspace. This method should be called before the nmrLSqLinSolutionDynamic object is passed to the nmrLSqLin function, as the memory required for the output matrices and workspace are allocated here or to reallocate memory previously allocated by the constructor. Typically, this method is called from a code segment where it is safe to allocate memory and use the solution and workspace later.
A | The matrix for which LS needs to be computed, size MxN |
|
inline |
This method allocates memory of the output vector and uses the memory provided by the user for the workspace. Check is made to ensure that memory provided by user is sufficient for LS routine of LAPACK. This method should be called before the nmrLSqLinSolutionDynamic object is passed on to the nmrLSqLin function, as the memory required for the output vector and workspace are allocated here or to reallocate memory previously allocated by the constructor. This case covers the scenario where the user wants to make all system calls for memory allocation before entering time critical code sections and might be using more than one numerical method in the same thread, allowing him/her to share the workspace for LAPACK. Typically this method is called from a code segment where it is safe to allocate memory and use the solution and workspace later.
A | The matrix for which LS needs to be computed, size MxN |
inWork | The vector used for workspace by LS. |
|
inline |
This method allocates memory of the output vector as well as the workspace. This method should be called before the nmrLSqLinSolutionDynamic object is passed to the nmrLSqLin function, as the memory required for the output vector and workspace are allocated here or to reallocate memory previously allocated by the constructor. Typically, this method is called from a code segment where it is safe to allocate memory and use the solution and workspace later.
A | The matrix for which LSI needs to be computed, size Ma x N |
G | The constraints matrix for LSI, size Mg x N |
|
inline |
This method allocates memory of the output vector and uses the memory provided by the user for the workspace. Check is made to ensure that memory provided by user is sufficient for LSI routine of LAPACK. This method should be called before the nmrLSqLinSolutionDynamic object is passed to the nmrLSqLin function, as the memory required for the output vector and workspace are allocated here or to reallocate memory previously allocated by the constructor. This case covers the scenario where the user wants to make all system calls for memory allocation before entering time critical code sections and might be using more than one numerical method in the same thread, allowing him/her to share the workspace for LAPACK. Typically this method is called from a code segment where it is safe to allocate memory and use the solution and workspace later.
A | The matrix for which LSI needs to be computed, size Ma x N |
G | The constraints matrix for LSI, size Mg x N |
inWork,inIWork | The workspace for LSI. |
|
inline |
This method allocates memory of output vector as well as the workspace. This method should be called before the nmrLSqLinSolutionDynamic object is passed to the nmrLSqLin function, as the memory required for the output vector and workspace are allocated here or to reallocate memory previously allocated by the constructor. Typically, this method is called from a code segment where it is safe to allocate memory and use the solution and workspace later.
A | The matrix for which LSEI needs to be computed, size MxN |
E | The equality constraints matrix for LSEI, size Me x N |
G | The inequality constraints matrix for LSEI, size Mg x N |
|
inline |
This method allocates memory of output vector and uses the memory provided by user for workspace. Check is made to ensure that memory provided by user is sufficient for LSEI routine of LAPACK. This method should be called before the nmrLSqLinSolutionDynamic object is passed to the nmrLSqLin function, as the memory required for the output vector and workspace are allocated here or to reallocate memory previously allocated by the constructor. This case covers the scenario where the user wants to make all system calls for memory allocation before entering time critical code sections and might be using more than one numerical method in the same thread, allowing him/her to share the workspace for LAPACK. Typically this method is called from a code segment where it is safe to allocate memory and use the solution and workspace later.
A | The matrix for which LSEI needs to be computed, size MxN |
E | The equality constraints matrix for LSEI, size Me x N |
G | The inequality constraints matrix for LSEI, size Mg x N |
inWork,inIWork | The vector used for workspace by LSEI. |
|
inline |
This method allocates memory of the output vector and optionally for the workspace required by LS/LSI/LSEI. This method is not meant to be a top-level user API, but is used by other overloaded Allocate methods.
ma | Number of rows of input matrix A (objective) |
me | Number of rows of input matrix E (equality constraints) |
mg | Number of rows of input matrix G (inequality constraints) |
n | Number of cols of input matrix A |
|
inline |
This method allocates memory of the output vector and optionally for the workspace required by LS/LSI/LSEI. This method is not meant to be a top-level user API, but is used by other overloaded Allocate methods.
ma | Number of rows of input matrix A (objective) |
me | Number of rows of input matrix E (equality constraints) |
mg | Number of rows of input matrix G (inequality constraints) |
n | Number of cols of input matrix A |
inWork | Workspace provided by user |
|
inline |
This method allocates memory of the output vector and optionally for the workspace required by LS/LSI/LSEI. This method is not meant to be a top-level user API, but is used by other overloaded Allocate methods.
ma | Number of rows of input matrix A (objective) |
me | Number of rows of input matrix E (equality constraints) |
mg | Number of rows of input matrix G (inequality constraints) |
n | Number of cols of input matrix A |
inWork,inIWork | Workspace provided by user |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Helper methods for user to set min working space required by LAPACK LS/LSI/LSEI routine.
ma,me,mg,n | The size of matrix whose LS/LSI/LSEI needs to be computed |
inWork | A vector that would be resized to meet the requirements of LAPACK LS/LSI/LSEI routine. |
|
inlinestatic |
Helper methods for user to set min working space required by LAPACK LS routine.
inA | The matrix whose LS needs to be computed |
inWork | A vector that would be resized to meet the requirements of LAPACK LS routine. |
|
inlinestatic |
Helper methods for user to set min working space required by LAPACK LSI routine.
inA,inG | The input matrices for LSI. |
inWork | A vector that would be resized to meet the requirements of LAPACK LSI routine. |
|
inlinestatic |
Helper methods for user to set min working space required by LAPACK LSEI routine.
inA,inE,inG | The input matrices for LSEI. |
inWork | A vector that would be resized to meet the requirements of LAPACK LSEI routine. |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inlinestatic |
Helper methods for user to set min working space required by LAPACK LS routine.
ma,me,mg,n | The size of matrix whose LS/LSI/LSEI needs to be computed |
|
inlinestatic |
Helper method to determine the min working space required by LAPACK LS (dgels) routine.
inA | The matrix whose LS needs to be computed |
|
inlinestatic |
Helper method to determine the min working space required by LAPACK LSI routine.
inA,inG | The input matrices for LSI. |
|
inlinestatic |
Helper method to determine the min working space required by LAPACK LSEI routine.
inA,inE,inG | The input matrices for LSEI. |
|
inline |
In order to get access to X, after it has been computed by calling the nmrLSqLin function, use the following methods.
|
inlineprotected |
This method allocates memory of the output vector and optionally for the workspace required by LS/LSI/LSEI. This method is not meant to be a top-level user API, but is used by other overloaded Allocate methods.
ma | Number of rows of input matrix A (objective) |
me | Number of rows of input matrix E (equality constraints) |
mg | Number of rows of input matrix G (inequality constraints) |
n | Number of cols of input matrix A |
allocateWorkspace | If true, allocate memory of workspace as well. |
allocateInput | If true, allocate memory of input as well. |
allocateOutput | If true, allocate memory of output as well. |
|
inlinestatic |
Method to query LAPACK routine for optimal workspace size. So far, only implemented for LS (dgels). Not needed because result is same as GetWorkspaceSize() above.
<
|
inline |
This method must be called before the solution object is passed to the nmrLSqLin function. The user provides the input matrix to specify size, along with vector X and workspace. The solution object now acts as a composite container to hold, pass and manipulate a convenient storage for the LSqLin algorithm. Checks are made on the validity of the input and its consistency with the size of the input matrix.
inA | The input matrix |
inX | The output vector for LSqLin |
inWork | The workspace for LS. |
|
inline |
This method must be called before the solution object is passed to the nmrLSqLin function. The user provides the input matrix to specify size, along with vector X. The solution object now acts as a composite container to hold, pass and manipulate a convenient storage for the LSqLin algorithm. Checks are made on the validity of the input and its consistency with the size of the input matrix. Memory allocation for the workspace is done by the method. This case covers the scenario where the user wants to make all system calls for memory allocation before entering time critical code sections and might be using the LS matrix elsewhere in the same thread.
inA | The input matrix |
inX | The output matrix for LSqLin |
|
inline |
This method must be called before the solution object is passed to the nmrLSqLin function. The user provides the input matrices to specify size, along with vector X and workspace. The solution object now acts as a composite container to hold, pass and manipulate a convenient storage for the LSqLin algorithm. Checks are made on the validity of the input and its consistency with the size of input matrices.
inA,inG | The input matrices |
inX | The output vector for LSqLin |
inWork,inIWork | The workspace for LSI. |
|
inline |
This method must be called before the solution object is passed to the nmrLSqLin function. The user provides the input matrices to specify size, along with vector X. The solution object now acts as a composite container to hold, pass and manipulate a convenient storage for the LSqLin algorithm. Checks are made on the validity of the input and its consistency with the size of the input matrices. Memory allocation for the workspace is done by the method. This case covers the scenario where the user wants to make all system calls for memory allocation before entering time critical code sections and might be using the LS matrix elsewhere in the same thread.
inA,inG | The input matrices |
inX | The output matrix for LSqLin |
|
inline |
This method must be called before the solution object is passed to the nmrLSqLin function. The user provides the input matrices to specify size, along with vector X and workspace. The solution object now acts as a composite container to hold, pass and manipulate a convenient storage for the LSqLin algorithm. Checks are made on the validity of the input and its consistency with the size of the input matrices.
inA,inE,inG | The input matrices |
inX | The output vector for LSqLin |
inWork,inIWork | The workspace for LSI. |
|
inline |
This method must be called before the solution object is passed to the nmrLSqLin function. The user provides the input matrices to specify size, along with vector X. The solution object now acts as a composite container to hold, pass and manipulate a convenient storage for the LSqLin algorithm. Checks are made on the validity of the input and its consistency with the sizes of the input matrices. Memory allocation for the workspace is done by the method. This case covers the scenario where the user wants to make all system calls for memory allocation before entering time critical code sections and might be using the LSEI matrix elsewhere in the same thread.
inA,inE,inG | The input matrices |
inX | The output matrix for LSqLin |
|
inline |
This method sets memory references of the output vector and for the workspace required by LS/LSI/LSEI. This method is not meant to be a top-level user API, but is used by other overloaded SetRef methods.
ma,me,mg | Number of rows of input matrix A, E and G respectively |
n | Number of cols of input matrix A |
inX | The output matrix for LSqLin |
inWork | The workspace for LS. |
|
inline |
This method sets memory references of the output vector and for the workspace required by LS/LSI/LSEI. This method is not meant to be a top-level user API, but is used by other overloaded SetRef methods.
ma,me,mg | Number of rows of input matrix A, E and G respectively |
n | Number of cols of input matrix A |
inX | The output matrix for LSqLin |
inWork/inIWork | The workspace for LSI/LSEI. |
|
inline |
This method sets memory references of the output vector and for the workspace required by LS/LSI/LSEI. This method is not meant to be a top-level user API, but is used by other overloaded SetRef methods.
ma,me,mg | Number of rows of input matrix A, E and G respectively |
n | Number of cols of input matrix A |
inX | The output matrix for LSqLin |
|
inlineprotected |
|
friend |
|
protected |
References to work or return or input types, these point either to user allocated memory or our memory chunks if needed
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Memory allocated for input if needed The LSEI (constrained least squares) requires that the input matrices be in one continuous memory block ordered according to fortran order (Column Major format), such that first Mc rows and N columns represent A, Ma rows and N+1 th column represent b, next Me rows represent (E, f) and last Mg rows represent (G, h) where the original LSEI problem is arg min || A x - b ||, s.t. E x = f and G x >= h. The input for LSI is similar other than Me == 0.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Memory allocated for output X if needed.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Memory allocated for Workspace matrices if needed
|
protected |