cisst-saw
|
#include <nmrPInverse.h>
Classes | |
class | Friend |
Public Types | |
typedef vct::size_type | size_type |
Public Member Functions | |
nmrPInverseDynamicData () | |
template<class _matrixOwnerTypeA > | |
nmrPInverseDynamicData (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A) | |
template<class _matrixOwnerTypeA , class _vectorOwnerTypeWorkspace > | |
nmrPInverseDynamicData (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A, vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > &workspace) | |
template<class _matrixOwnerTypeA , class _matrixOwnerTypePInverse , class _vectorOwnerTypeWorkspace > | |
nmrPInverseDynamicData (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &CMN_UNUSED(A), vctDynamicMatrixBase< _matrixOwnerTypePInverse, CISSTNETLIB_DOUBLE > &pInverse, vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > &workspace) | |
template<class _matrixOwnerTypeA , class _matrixOwnerTypePInverse > | |
nmrPInverseDynamicData (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &CMN_UNUSED(A), vctDynamicMatrixBase< _matrixOwnerTypePInverse, CISSTNETLIB_DOUBLE > &pInverse) | |
template<class _matrixOwnerTypeA > | |
void | Allocate (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A) |
template<class _matrixOwnerTypeA , class _vectorOwnerTypeWorkspace > | |
void | SetRefWorkspace (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A, vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > &workspace) |
template<class _matrixOwnerTypePInverse , class _vectorOwnerTypeWorkspace > | |
void | SetRef (vctDynamicMatrixBase< _matrixOwnerTypePInverse, CISSTNETLIB_DOUBLE > &pInverse, vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > &workspace) |
template<class _matrixOwnerTypePInverse > | |
void | SetRefOutput (vctDynamicMatrixBase< _matrixOwnerTypePInverse, CISSTNETLIB_DOUBLE > &pInverse) |
Retrieving results | |
In order to get access to U, V^t and S, after the have been computed by calling nmrPInverse function, use the following methods. | |
const vctDynamicVectorRef < CISSTNETLIB_DOUBLE > & | S (void) const |
const vctDynamicMatrixRef < CISSTNETLIB_DOUBLE > & | U (void) const |
const vctDynamicMatrixRef < CISSTNETLIB_DOUBLE > & | Vt (void) const |
const vctDynamicMatrixRef < CISSTNETLIB_DOUBLE > & | PInverse (void) const |
Static Public Member Functions | |
static size_type | WorkspaceSize (size_type m, size_type n) |
template<class _matrixOwnerTypeA > | |
static size_type | WorkspaceSize (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A) |
Protected Member Functions | |
void | SetDimension (size_type m, size_type n, bool storageOrder) |
void | AllocateOutputWorkspace (bool allocateOutput, bool allocateWorkspace) |
template<class _vectorOwnerTypeWorkspace > | |
void | SetRefSVD (vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > &workspace) |
template<typename _matrixOwnerTypePInverse > | |
void | ThrowUnlessOutputSizeIsCorrect (vctDynamicMatrixBase< _matrixOwnerTypePInverse, CISSTNETLIB_DOUBLE > &pInverse) const throw (std::runtime_error) |
template<typename _vectorOwnerTypeWorkspace > | |
void | ThrowUnlessWorkspaceSizeIsCorrect (vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > &workspace) const throw (std::runtime_error) |
Protected Attributes | |
vctDynamicVector < CISSTNETLIB_DOUBLE > | WorkspaceMemory |
vctDynamicVector < CISSTNETLIB_DOUBLE > | OutputMemory |
vctDynamicMatrixRef < CISSTNETLIB_DOUBLE > | PInverseReference |
vctDynamicMatrixRef < CISSTNETLIB_DOUBLE > | UReference |
vctDynamicMatrixRef < CISSTNETLIB_DOUBLE > | VtReference |
vctDynamicVectorRef < CISSTNETLIB_DOUBLE > | SReference |
vctDynamicVectorRef < CISSTNETLIB_DOUBLE > | WorkspaceReference |
size_type | MMember |
size_type | NMember |
bool | StorageOrderMember |
Friends | |
class | Friend |
This is the class for the composite data container of PInverse.
Type used for sizes within nmrSVDDynamicData. This type is compatible with the cisstVector containers such as vctDynamicMatrix and vctDynamicVector (unsigned int). To call the Fortran based routines, these values must be cast to #CISSTNETLIB_INTEGER.
|
inline |
The default constuctor. For dynamic size, there are assigned default values, which MUST be changed by calling appropriate methods. (See nmrPInverseDynamicData::Allocate and nmrPInverseDynamicData::SetRef)
|
inline |
Constructor where user provides the input matrix to specify size, Memory allocation is done for output matrices and vectors as well as Workspace used by LAPACK. This case covers the scenario when user wants to make all system calls for memory allocation before entrying time critical code sections.
A | input matrix |
|
inline |
Constructor where user provides the input matrix to specify size, Memory allocation is done for output matrices and vectors. This case covers the scenario when user wants to make all system calls for memory allocation before entrying time critical code sections and might be using more than one numerical method in the same thread, allowing her to share the workspace for LAPACK.
A | Input matrix |
workspace | Workspace for SVD |
|
inline |
Constructor where user provides the size and storage order of the input matrix, along with matrix AP and workspace. The data object now acts as a composite container to hold, pass and manipulate a convenitent storage for PInverse algorithm. Checks are made on the validity of the input and its consitency with the size of input matrix.
A | The input matrix |
pInverse | The output matrix for PInverse |
workspace | The workspace for LAPACK. |
|
inline |
Constructor where user provides the size and storage order of the input matrix, along with matrix PInverse. The data object now acts as a composite container to hold, pass and manipulate a convenitent storage for SVD algorithm. Checks are made on thec validity of the input and its consitency with the size of input matrix. Memory allocation for workspace is done by the method. This case covers the scenario when user wants to make all system calls for memory allocation before entrying time critical code sections and might be using the PInverse matrix elsewhere in the same thread.
A | The input matrix |
pInverse | The output matrix for PInverse |
|
inline |
This method allocates memory of output matrices and vector as well as the workspace. This method should be called before the nmrPInverseDynamicData object is passed on to nmrPInverse function, as the memory required for output matrices and workspace are allocated here or to reallocate memory previously allocated by constructor. Typically this method is called from a code segment where it is safe to allocate memory and use the data and workspace space later.
A | The matrix for which SVD needs to be computed, size MxN |
|
inlineprotected |
Private method to allocate memory for the output and the workspace if needed. This method assumes that the dimension m and n as well as the storage order are already set. It is important to use this method in all the methods provided in the user API, even if all the memory is provided by the user since this method will ensure that the data (nmrPInverseDynamicData) does not keep any memory allocated. This is for the case where a single data is used first to allocate everything and, later on, used with user allocated memory (for either the workspace or the output).
|
inline |
|
inline |
|
inlineprotected |
Private method to set the data members MMember, NMember and StorageOrder. This method must be called before AllocateOutputWorkspace, ThrowUnlessOutputSizeIsCorrect or ThrowUnlessWorkspaceSizeIsCorrect.
|
inline |
This method must be called before the data object is passed to nmrPInverse function. The user provides the input matrix to specify size, along with matrix PInverse and workspace. The data object now acts as a composite container to hold, pass and manipulate a convenitent storage for PInverse algorithm. Checks are made on the validity of the input and its consitency with the size of input matrix.
pInverse | The output matrix for PInverse |
workspace | The workspace for LAPACK. |
|
inline |
This method must be called before the data object is passed to nmrPInverse function. The user provides the input matrix to specify size, along with matrix PInverse. The data object now acts as a composite container to hold, pass and manipulate a convenitent storage for PInverse algorithm. Checks are made on thec validity of the input and its consitency with the size of input matrix. Memory allocation for workspace is done by the method. This case covers the scenario when user wants to make all system calls for memory allocation before entrying time critical code sections and might be using the PInverse matrix elsewhere in the same thread.
pInverse | The output matrix for PInverse |
|
inlineprotected |
Set all internal references used for the SVD problem. This method requires a valid workspace but it doesn't check the size. It is the caller responsability to do so.
|
inline |
This method allocates memory of output matrices and vector and uses the memory provided by user for workspace. Check is made to ensure that memory provided by user is sufficient for SVD routine of LAPACK. This method should be called before the nmrPInverseDynamicData object is passed on to nmrPInverse function, as the memory required for output matrices and workspace are allocated here or to reallocate memory previously allocated by constructor. This case covers the scenario when user wants to make all system calls for memory allocation before entrying time critical code sections and might be using more than one numerical method in the same thread, allowing 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 data and workspace space later.
A | The matrix for which SVD needs to be computed, size MxN |
workspace | The vector used for workspace by LAPACK. |
|
inlineprotected |
Verifies that the user provided reference for the output match the size of the data as set by SetDimension. This method also checks that the storage order is consistent.
|
inlineprotected |
Verifies that the user provided references for the workspace match (or is greated than) the size of the data as set by SetDimension. This method also checks that the workspace is compact.
|
inline |
|
inline |
Helper methods for user to set min working space required by LAPACK SVD routine plus memory needed for S, U & Vt matrices used to compute PInverse.
m,n | The size of matrix whose SVD needs to be computed |
|
inlinestatic |
Helper method to determine the min working space required by LAPACK SVD routine plus memory needed for S, U & Vt matrices used to compute PInverse.
A | The matrix whose SVD needs to be computed |
|
friend |
|
protected |
Stores M, N, and StorageOrder which are needed to check if A matrix passed to solve method matches the allocated size.
|
protected |
|
protected |
Memory allocated for PInverse if needed.
|
protected |
References to workspace or return types, these point either to user allocated memory or our memory chunks if needed
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Memory allocated for Workspace matrices if needed This includes memory needed for SVD as well. Order of storage is m x m elements of U followed by n x n elements of Vt followed by min (m, n) elements of S, followed by memory for LAPACK workspace.
|
protected |