cisst-saw
|
Declaration of nmrLU. 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 | nmrLUDynamicData |
Data of LU problem (Dynamic). More... | |
class | nmrLUDynamicData::Friend |
class | nmrLUFixedSizeData< _rows, _cols > |
Data of LU problem (Fixed size). More... | |
class | nmrLUFixedSizeData< _rows, _cols >::Friend |
Functions | |
Algorithm LU: Lower Upper Decomposition | |
These functions are different wrappers for the LAPACK function dgetrf. They compute an LU factorization of a general M-by-N matrix A using partial pivoting with row interchanges. The factorization has the form These functions are wrappers around the LAPACK routine dgetrf, therefore they share some features with the LAPACK routine:
The nmrLU functions add the following features:
There are different ways to call this function to compute the LU of the matrix A. These correspond to different overloaded nmrLU functions:
| |
template<class _matrixOwnerType > | |
CISSTNETLIB_INTEGER | nmrLU (vctDynamicMatrixBase< _matrixOwnerType, CISSTNETLIB_DOUBLE > &A, nmrLUDynamicData &data) throw (std::runtime_error) |
template<class _matrixOwnerTypeA , class _vectorOwnerTypePivotIndices > | |
CISSTNETLIB_INTEGER | nmrLU (vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A, vctDynamicVectorBase< _vectorOwnerTypePivotIndices, CISSTNETLIB_INTEGER > &pivotIndices) |
template<vct::size_type _rows, vct::size_type _cols, vct::size_type _minmn> | |
CISSTNETLIB_INTEGER | nmrLU (vctFixedSizeMatrix< CISSTNETLIB_DOUBLE, _rows, _cols, VCT_COL_MAJOR > &A, vctFixedSizeVector< CISSTNETLIB_INTEGER, _minmn > &pivotIndices) |
template<vct::size_type _rows, vct::size_type _cols> | |
CISSTNETLIB_INTEGER | nmrLU (vctFixedSizeMatrix< CISSTNETLIB_DOUBLE, _rows, _cols, VCT_COL_MAJOR > &A, nmrLUFixedSizeData< _rows, _cols > &data) |
Declaration of nmrLU.
|
inline |
This function solves the LU problem for a dynamic matrix using an nmrLUDynamicData.
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. The result can be obtained via the const method nmrLUDynamicData::PivotIndices().
A | A matrix of size MxN, either vctDynamicMatrix or vctDynamicMatrixRef. |
data | A data object corresponding to the input matrix. |
|
inline |
This function solves the LU problem for a dynamic matrix using the storage provided by the user for both the output (PivotIndices).
Internally, a data is created using the storage provided by the user (see nmrLUDynamicData::SetRef). While the data is being build, the consistency of the output is checked. Then, the nmrLU(A, data) function can be used safely.
A | is a reference to a dynamic matrix of size MxN |
pivotIndices | Vector created by the user to store the pivot indices. |
|
inline |
This function solves the LU problem for a fixed size matrix using the storage provided by the user for the output (PivotIndices).
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. It stores the result in pivotIndices and A which now contains the elements of both L and U. The methods UpdateMatrixLU and UpdateMatrixP can ease the creation of more convenient matrices.
A | is a fixed size matrix of size MxN. |
pivotIndices | Vector to store the pivot indices. |
|
inline |
This function solves the LU problem for a fixed size matrix using nmrLUFixedSizeData to allocate the memory required for the output:
This method calls nmrLU(A, pivotIndices).
A | A fixed size matrix of size MxN. |
data | A data object. |