mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-14 20:56:00 +08:00
bug #897: fix UmfPack usage with mapped sparse matrices
(grafted from 1a8dc8514257cb931b1b5bca67004fa2b628133d )
This commit is contained in:
parent
b25b517817
commit
e9c5418249
@ -192,7 +192,8 @@ class UmfPackLU : internal::noncopyable
|
|||||||
* Note that the matrix should be column-major, and in compressed format for best performance.
|
* Note that the matrix should be column-major, and in compressed format for best performance.
|
||||||
* \sa SparseMatrix::makeCompressed().
|
* \sa SparseMatrix::makeCompressed().
|
||||||
*/
|
*/
|
||||||
void compute(const MatrixType& matrix)
|
template<typename InputMatrixType>
|
||||||
|
void compute(const InputMatrixType& matrix)
|
||||||
{
|
{
|
||||||
analyzePattern(matrix);
|
analyzePattern(matrix);
|
||||||
factorize(matrix);
|
factorize(matrix);
|
||||||
@ -230,7 +231,8 @@ class UmfPackLU : internal::noncopyable
|
|||||||
*
|
*
|
||||||
* \sa factorize(), compute()
|
* \sa factorize(), compute()
|
||||||
*/
|
*/
|
||||||
void analyzePattern(const MatrixType& matrix)
|
template<typename InputMatrixType>
|
||||||
|
void analyzePattern(const InputMatrixType& matrix)
|
||||||
{
|
{
|
||||||
if(m_symbolic)
|
if(m_symbolic)
|
||||||
umfpack_free_symbolic(&m_symbolic,Scalar());
|
umfpack_free_symbolic(&m_symbolic,Scalar());
|
||||||
@ -256,7 +258,8 @@ class UmfPackLU : internal::noncopyable
|
|||||||
*
|
*
|
||||||
* \sa analyzePattern(), compute()
|
* \sa analyzePattern(), compute()
|
||||||
*/
|
*/
|
||||||
void factorize(const MatrixType& matrix)
|
template<typename InputMatrixType>
|
||||||
|
void factorize(const InputMatrixType& matrix)
|
||||||
{
|
{
|
||||||
eigen_assert(m_analysisIsOk && "UmfPackLU: you must first call analyzePattern()");
|
eigen_assert(m_analysisIsOk && "UmfPackLU: you must first call analyzePattern()");
|
||||||
if(m_numeric)
|
if(m_numeric)
|
||||||
@ -298,7 +301,8 @@ class UmfPackLU : internal::noncopyable
|
|||||||
m_extractedDataAreDirty = true;
|
m_extractedDataAreDirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void grapInput(const MatrixType& mat)
|
template<typename InputMatrixType>
|
||||||
|
void grapInput(const InputMatrixType& mat)
|
||||||
{
|
{
|
||||||
m_copyMatrix.resize(mat.rows(), mat.cols());
|
m_copyMatrix.resize(mat.rows(), mat.cols());
|
||||||
if( ((MatrixType::Flags&RowMajorBit)==RowMajorBit) || sizeof(typename MatrixType::Index)!=sizeof(int) || !mat.isCompressed() )
|
if( ((MatrixType::Flags&RowMajorBit)==RowMajorBit) || sizeof(typename MatrixType::Index)!=sizeof(int) || !mat.isCompressed() )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user