Cholmod: add support for uncompressed SparseMatrix objects

This commit is contained in:
Gael Guennebaud 2011-12-10 22:53:31 +01:00
parent 9d7d634897
commit 594fd2d11d

View File

@ -73,7 +73,16 @@ cholmod_sparse viewAsCholmod(SparseMatrix<_Scalar,_Options,_Index>& mat)
res.i = mat.innerIndexPtr(); res.i = mat.innerIndexPtr();
res.x = mat.valuePtr(); res.x = mat.valuePtr();
res.sorted = 1; res.sorted = 1;
res.packed = 1; if(mat.compressed())
{
res.packed = 1;
}
else
{
res.packed = 0;
res.nz = mat.innerNonZeroPtr();
}
res.dtype = 0; res.dtype = 0;
res.stype = -1; res.stype = -1;
@ -161,6 +170,8 @@ enum CholmodMode {
* \tparam _UpLo the triangular part that will be used for the computations. It can be Lower * \tparam _UpLo the triangular part that will be used for the computations. It can be Lower
* or Upper. Default is Lower. * or Upper. Default is Lower.
* *
* This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or uncompressed.
*
* \sa \ref TutorialSparseDirectSolvers * \sa \ref TutorialSparseDirectSolvers
*/ */
template<typename _MatrixType, int _UpLo = Lower> template<typename _MatrixType, int _UpLo = Lower>