A sparse LU factorization and solver based on UmfPack. More...
#include <UmfPackSupport.h>
Inherits noncopyable.
Public Types | |
typedef MatrixType::Index | Index |
typedef Matrix< int, MatrixType::RowsAtCompileTime, 1 > | IntColVectorType |
typedef Matrix< int, 1, MatrixType::ColsAtCompileTime > | IntRowVectorType |
typedef SparseMatrix< Scalar > | LUMatrixType |
typedef _MatrixType | MatrixType |
typedef MatrixType::RealScalar | RealScalar |
typedef MatrixType::Scalar | Scalar |
typedef SparseMatrix< Scalar, ColMajor, int > | UmfpackMatrixType |
typedef Matrix< Scalar, Dynamic, 1 > | Vector |
Public Member Functions | |
void | analyzePattern (const MatrixType &matrix) |
Index | cols () const |
void | compute (const MatrixType &matrix) |
Scalar | determinant () const |
void | extractData () const |
void | factorize (const MatrixType &matrix) |
ComputationInfo | info () const |
Reports whether previous computation was successful. | |
const LUMatrixType & | matrixL () const |
const LUMatrixType & | matrixU () const |
const IntColVectorType & | permutationP () const |
const IntRowVectorType & | permutationQ () const |
Index | rows () const |
template<typename Rhs > | |
const internal::solve_retval < UmfPackLU, Rhs > | solve (const MatrixBase< Rhs > &b) const |
UmfPackLU () | |
UmfPackLU (const MatrixType &matrix) | |
~UmfPackLU () |
Protected Member Functions | |
void | grapInput (const MatrixType &mat) |
void | init () |
Protected Attributes | |
int | m_analysisIsOk |
UmfpackMatrixType | m_copyMatrix |
bool | m_extractedDataAreDirty |
int | m_factorizationIsOk |
ComputationInfo | m_info |
const int * | m_innerIndexPtr |
bool | m_isInitialized |
LUMatrixType | m_l |
void * | m_numeric |
const int * | m_outerIndexPtr |
IntColVectorType | m_p |
IntRowVectorType | m_q |
void * | m_symbolic |
LUMatrixType | m_u |
const Scalar * | m_valuePtr |
A sparse LU factorization and solver based on UmfPack.
This class allows to solve for A.X = B sparse linear problems via a LU factorization using the UmfPack library. The sparse matrix A must be squared and full rank. The vectors or matrices X and B can be either dense or sparse.
The input matrix A should be in a compressed and column-major form. Otherwise an expensive copy will be made. You can call the inexpensive makeCompressed() to get a compressed matrix.
_MatrixType | the type of the sparse matrix A, it must be a SparseMatrix<> |
typedef MatrixType::Index Index |
typedef Matrix<int, MatrixType::RowsAtCompileTime, 1> IntColVectorType |
typedef Matrix<int, 1, MatrixType::ColsAtCompileTime> IntRowVectorType |
typedef SparseMatrix<Scalar> LUMatrixType |
typedef _MatrixType MatrixType |
typedef MatrixType::RealScalar RealScalar |
typedef MatrixType::Scalar Scalar |
typedef SparseMatrix<Scalar,ColMajor,int> UmfpackMatrixType |
|
inline |
References UmfPackLU< _MatrixType >::init().
|
inline |
References UmfPackLU< _MatrixType >::compute(), and UmfPackLU< _MatrixType >::init().
|
inline |
|
inline |
This function is particularly useful when solving for several problems having the same structure.
References UmfPackLU< _MatrixType >::grapInput(), Eigen::InvalidInput, UmfPackLU< _MatrixType >::m_analysisIsOk, UmfPackLU< _MatrixType >::m_factorizationIsOk, UmfPackLU< _MatrixType >::m_info, UmfPackLU< _MatrixType >::m_innerIndexPtr, UmfPackLU< _MatrixType >::m_isInitialized, UmfPackLU< _MatrixType >::m_numeric, UmfPackLU< _MatrixType >::m_outerIndexPtr, UmfPackLU< _MatrixType >::m_symbolic, UmfPackLU< _MatrixType >::m_valuePtr, Eigen::Success, Eigen::umfpack_free_numeric(), Eigen::umfpack_free_symbolic(), and Eigen::umfpack_symbolic().
Referenced by UmfPackLU< _MatrixType >::compute().
|
inline |
|
inline |
Computes the sparse Cholesky decomposition of matrix Note that the matrix should be column-major, and in compressed format for best performance.
References UmfPackLU< _MatrixType >::analyzePattern(), and UmfPackLU< _MatrixType >::factorize().
Referenced by UmfPackLU< _MatrixType >::UmfPackLU().
UmfPackLU< MatrixType >::Scalar determinant | ( | ) | const |
References Eigen::umfpack_get_determinant().
void extractData | ( | ) | const |
|
inline |
Performs a numeric decomposition of matrix
The given matrix must has the same sparcity than the matrix on which the pattern anylysis has been performed.
References eigen_assert, UmfPackLU< _MatrixType >::grapInput(), UmfPackLU< _MatrixType >::m_analysisIsOk, UmfPackLU< _MatrixType >::m_factorizationIsOk, UmfPackLU< _MatrixType >::m_info, UmfPackLU< _MatrixType >::m_innerIndexPtr, UmfPackLU< _MatrixType >::m_numeric, UmfPackLU< _MatrixType >::m_outerIndexPtr, UmfPackLU< _MatrixType >::m_symbolic, UmfPackLU< _MatrixType >::m_valuePtr, Eigen::NumericalIssue, Eigen::Success, Eigen::umfpack_free_numeric(), and Eigen::umfpack_numeric().
Referenced by UmfPackLU< _MatrixType >::compute().
|
inlineprotected |
References SparseMatrix< _Scalar, _Options, _Index >::innerIndexPtr(), UmfPackLU< _MatrixType >::m_copyMatrix, UmfPackLU< _MatrixType >::m_innerIndexPtr, UmfPackLU< _MatrixType >::m_outerIndexPtr, UmfPackLU< _MatrixType >::m_valuePtr, SparseMatrix< _Scalar, _Options, _Index >::outerIndexPtr(), SparseMatrix< _Scalar, _Options, _Index >::resize(), Eigen::RowMajorBit, and SparseMatrix< _Scalar, _Options, _Index >::valuePtr().
Referenced by UmfPackLU< _MatrixType >::analyzePattern(), and UmfPackLU< _MatrixType >::factorize().
|
inline |
Reports whether previous computation was successful.
Success
if computation was succesful, NumericalIssue
if the matrix.appears to be negative. References eigen_assert, UmfPackLU< _MatrixType >::m_info, and UmfPackLU< _MatrixType >::m_isInitialized.
|
inlineprotected |
References Eigen::InvalidInput, UmfPackLU< _MatrixType >::m_info, UmfPackLU< _MatrixType >::m_innerIndexPtr, UmfPackLU< _MatrixType >::m_isInitialized, UmfPackLU< _MatrixType >::m_numeric, UmfPackLU< _MatrixType >::m_outerIndexPtr, UmfPackLU< _MatrixType >::m_symbolic, and UmfPackLU< _MatrixType >::m_valuePtr.
Referenced by UmfPackLU< _MatrixType >::UmfPackLU().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References UmfPackLU< _MatrixType >::m_copyMatrix, and SparseMatrix< _Scalar, _Options, _Index >::rows().
Referenced by UmfPackLU< _MatrixType >::solve().
|
inline |
References eigen_assert, UmfPackLU< _MatrixType >::m_isInitialized, and UmfPackLU< _MatrixType >::rows().
|
protected |
Referenced by UmfPackLU< _MatrixType >::analyzePattern(), and UmfPackLU< _MatrixType >::factorize().
|
protected |
|
mutableprotected |
|
protected |
Referenced by UmfPackLU< _MatrixType >::analyzePattern(), and UmfPackLU< _MatrixType >::factorize().
|
mutableprotected |
|
protected |
|
protected |
|
mutableprotected |
Referenced by UmfPackLU< _MatrixType >::matrixL().
|
protected |
|
protected |
|
mutableprotected |
Referenced by UmfPackLU< _MatrixType >::permutationP().
|
mutableprotected |
Referenced by UmfPackLU< _MatrixType >::permutationQ().
|
protected |
|
mutableprotected |
Referenced by UmfPackLU< _MatrixType >::matrixU().
|
protected |