cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Functions
nmrPInverseEconomy.h File Reference

Declaration of nmrPInverseEconomy. More...

#include <cisstCommon/cmnThrow.h>
#include <cisstVector/vctFixedSizeMatrix.h>
#include <cisstVector/vctDynamicMatrix.h>
#include <cisstNumerical/nmrNetlib.h>
#include <cisstNumerical/nmrSVDEconomy.h>
#include <cisstNumerical/nmrExport.h>

Go to the source code of this file.

Classes

class  nmrPInverseEconomyDynamicData
 
class  nmrPInverseEconomyDynamicData::Friend
 

Functions

template<class _matrixOwnerType >
CISSTNETLIB_INTEGER nmrPInverseEconomy (vctDynamicMatrixBase< _matrixOwnerType, CISSTNETLIB_DOUBLE > &A, nmrPInverseEconomyDynamicData &data) throw (std::runtime_error)
 
template<class _matrixOwnerTypeA , class _matrixOwnerTypePInverse , class _vectorOwnerTypeWorkspace >
CISSTNETLIB_INTEGER nmrPInverseEconomy (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A, vctDynamicMatrixBase< _matrixOwnerTypePInverse, CISSTNETLIB_DOUBLE > &pInverse, vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > &workspace)
 
template<class _matrixOwnerTypeA , class _matrixOwnerTypePInverse >
CISSTNETLIB_INTEGER nmrPInverseEconomy (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A, vctDynamicMatrixBase< _matrixOwnerTypePInverse, CISSTNETLIB_DOUBLE > &pInverse)
 

Detailed Description

Declaration of nmrPInverseEconomy.

Function Documentation

template<class _matrixOwnerType >
CISSTNETLIB_INTEGER nmrPInverseEconomy ( vctDynamicMatrixBase< _matrixOwnerType, CISSTNETLIB_DOUBLE > &  A,
nmrPInverseEconomyDynamicData data 
)
throw (std::runtime_error
)
inline

This function checks for valid input and calls the LAPACK function. The approach behind this defintion of the function is that the user creates a data object from a code wherein it is safe to do memory allocation. This data object is then passed on to this method along with the matrix whose PInverse is to be computed. The data object has members S, U, Vt and PInverse, which can be accessed through calls to method *() along with adequate workspace for LAPACK. This function modifies the contents of matrix A. For details about nature of the data matrices see text above.

Parameters
AA matrix of size MxN
dataA data object of one of the types corresponding to input matrix
Test:
nmrPInverseEconomyTest::TestDynamicColumnMajor nmrPInverseEconomyTest::TestDynamicRowMajor nmrPInverseEconomyTest::TestDynamicColumnMajorUserAlloc nmrPInverseEconomyTest::TestDynamicRowMajorUserAlloc
template<class _matrixOwnerTypeA , class _matrixOwnerTypePInverse , class _vectorOwnerTypeWorkspace >
CISSTNETLIB_INTEGER nmrPInverseEconomy ( vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &  A,
vctDynamicMatrixBase< _matrixOwnerTypePInverse, CISSTNETLIB_DOUBLE > &  pInverse,
vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > &  workspace 
)
inline

Basic version of PInverse where user provides the input matrix as well as storage for output and workspace needed by LAPACK. No memory allocation is done in this function, user allocates everything including workspace. The PInverse method verifies that the size of the data objects matchesc the input. See static methods in nmrPInverseEconomyDynamicData for helper functions that help determine the min workspace required. This function modifies the contents of matrix A. For sizes of other matrices see text above.

Parameters
AA dynamic matrix of size MxN
pInverseThe output matrix for PInverse
workspaceThe workspace for LAPACK.
Test:
nmrPInverseEconomyTest::TestDynamicColumnMajorUserAlloc nmrPInverseEconomyTest::TestDynamicRowMajorUserAlloc
template<class _matrixOwnerTypeA , class _matrixOwnerTypePInverse >
CISSTNETLIB_INTEGER nmrPInverseEconomy ( vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &  A,
vctDynamicMatrixBase< _matrixOwnerTypePInverse, CISSTNETLIB_DOUBLE > &  pInverse 
)
inline

Basic version of PInverse where user provides the input matrix as well as storage for output. The PInverse method verifies that the size of the data objects matches the input and allocates workspace memory, which is deallocated when the function ends. This function modifies the contents of matrix A. For sizes of other matrices see text above.

Parameters
AA dynamic matrix of size MxN
pInverseThe output matrices and vector for PInverse
Test:
nmrPInverseEconomyTest::TestDynamicColumnMajorUserAlloc nmrPInverseEconomyTest::TestDynamicRowMajorUserAlloc