cisst-saw
|
Declaration of nmrInverse. More...
#include <cisstCommon/cmnThrow.h>
#include <cisstVector/vctFixedSizeMatrix.h>
#include <cisstVector/vctDynamicMatrix.h>
#include <cisstNumerical/nmrNetlib.h>
#include <cisstNumerical/nmrExport.h>
Go to the source code of this file.
Classes | |
class | nmrInverseDynamicData |
Data for Inverse problem (Dynamic). More... | |
class | nmrInverseDynamicData::Friend |
class | nmrInverseFixedSizeData< _size, _storageOrder > |
Data for Inverse problem (Fixed size). More... | |
class | nmrInverseFixedSizeData< _size, _storageOrder >::Friend |
Functions | |
Algorithm Inverse: Compute the inverse of a square matrix | |
using Lower Upper Decomposition These functions are different wrappers for the LAPACK function dgetrf and dgetri. They compute the inverse factorization of a square matrix A. These functions are wrappers around the LAPACK routine dgetrf and dgetri, therefore they share some features with the LAPACK routine:
The nmrInverse functions add the following features:
There are different ways to call this function to compute the Inverse of the matrix A. These correspond to different overloaded nmrInverse functions:
| |
template<class _matrixOwnerType > | |
CISSTNETLIB_INTEGER | nmrInverse (vctDynamicMatrixBase< _matrixOwnerType, CISSTNETLIB_DOUBLE > &A, nmrInverseDynamicData &data) throw (std::runtime_error) |
template<class _matrixOwnerTypeA , class _vectorOwnerTypePivotIndices , class _vectorOwnerTypeWorkspace > | |
CISSTNETLIB_INTEGER | nmrInverse (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A, vctDynamicVectorBase< _vectorOwnerTypePivotIndices, CISSTNETLIB_INTEGER > &pivotIndices, vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > &workspace) |
template<class _matrixOwnerTypeA > | |
CISSTNETLIB_INTEGER | nmrInverse (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A) |
template<vct::size_type _size, vct::size_type _maxSize1, vct::size_type _lWork, bool _storageOrder> | |
CISSTNETLIB_INTEGER | nmrInverse (vctFixedSizeMatrix< CISSTNETLIB_DOUBLE, _size, _size, _storageOrder > &A, vctFixedSizeVector< CISSTNETLIB_INTEGER, _maxSize1 > &pivotIndices, vctFixedSizeVector< CISSTNETLIB_DOUBLE, _lWork > &workspace) |
template<vct::size_type _size, bool _storageOrder> | |
CISSTNETLIB_INTEGER | nmrInverse (vctFixedSizeMatrix< CISSTNETLIB_DOUBLE, _size, _size, _storageOrder > &A, nmrInverseFixedSizeData< _size, _storageOrder > &data) |
template<vct::size_type _size, bool _storageOrder> | |
CISSTNETLIB_INTEGER | nmrInverse (vctFixedSizeMatrix< CISSTNETLIB_DOUBLE, _size, _size, _storageOrder > &A) |
Declaration of nmrInverse.
|
inline |
This function solves the Inverse problem for a dynamic matrix using an nmrInverseDynamicData.
This function checks for valid input (size and compact) and calls the LAPACK function. If the input doesn't match the data, an exception is thrown (std::runtime_error
).
This function modifies the input matrix A and stores the results in the data.
A | A square matrix, either vctDynamicMatrix or vctDynamicMatrixRef. |
data | A data object corresponding to the input matrix. |
|
inline |
This function solves the Inverse problem for a dynamic matrix using the storage provided by the user (pivotIndices and workspace).
Internally, a data is created using the storage provided by the user (see nmrInverseDynamicData::SetRef). While the data is being build, the consistency of the output is checked. Then, the nmrInverse(A, data) function can be used safely.
A | is a reference to a dynamic square matrix |
pivotIndices | Vector created by the user to store the pivot indices. |
workspace | Vector created by the user for the workspace. |
|
inline |
This function solves the Inverse problem for a dynamic matrix.
Internally, a data object is created. This forces the dynamic allocation of the pivot indices vector as well as the workspace vector. Then, the nmrInverse(A, data) function can be used safely.
A | is a reference to a dynamic square matrix |
|
inline |
This function solves the Inverse problem for a fixed size matrix using the storage provided by the user for the pivot indices vector as well as the workspace vector.
The sizes of the matrices must match at compilation time. This is enforced by the template parameters and matching problems will lead to compilation errors. Since there is no easy way to enforce the size of the vector pivotIndices with template parameters, a runtime check is performed. The test uses CMN_ASSERT to determine what to do if the sizes don't match. By default CMN_ASSERT calls abort()
but it can be configured to be ignored or to throw an exception (see CMN_ASSERT for details).
This function modifies the input matrix A.
A | is a fixed size square matrix. |
pivotIndices | Vector created by the caller for the pivot indices. |
workspace | Vector created by the caller for the workspace. |
|
inline |
This function solves the Inverse problem for a fixed size matrix using nmrInverseFixedSizeData to allocate the memory required for the pivot indices and the workspace:
This method calls nmrInverse(A, pivotIndices, workspace).
A | A fixed size square matrix. |
data | A data object. |
|
inline |
This function solves the Inverse problem for a fixed size matrix.
Internally, a data object is created. This forces the allocation (stack) of the pivot indices vector as well as the workspace vector. Then, the nmrInverse(A, data) function can be used safely.
A | A fixed size square matrix. |