aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Sparse
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2008-10-20 10:43:11 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2008-10-20 10:43:11 +0000
commitfa27cd1ed0a387a52079e63444137feb2aeab66f (patch)
tree95af6901864c5bbaffb884fc85c8e028e7f9ded5 /Eigen/src/Sparse
parentf44316e5f8e949b6d66dd4bc3a6ae84eeb866652 (diff)
* add cmake files to find (optional) supported libraries
* add unit tests for sparse cholesky
Diffstat (limited to 'Eigen/src/Sparse')
-rw-r--r--Eigen/src/Sparse/CholmodSupport.h5
-rw-r--r--Eigen/src/Sparse/SparseLLT.h4
-rw-r--r--Eigen/src/Sparse/TaucsSupport.h19
3 files changed, 16 insertions, 12 deletions
diff --git a/Eigen/src/Sparse/CholmodSupport.h b/Eigen/src/Sparse/CholmodSupport.h
index d1d10158a..b6c13350c 100644
--- a/Eigen/src/Sparse/CholmodSupport.h
+++ b/Eigen/src/Sparse/CholmodSupport.h
@@ -195,11 +195,12 @@ template<typename MatrixType>
template<typename Derived>
void SparseLLT<MatrixType,Cholmod>::solveInPlace(MatrixBase<Derived> &b) const
{
+ if (m_status & MatrixLIsDirty)
+ matrixL();
+
const int size = m_matrix.rows();
ei_assert(size==b.rows());
- if (m_status & MatrixLIsDirty)
- matrixL();
Base::solveInPlace(b);
}
diff --git a/Eigen/src/Sparse/SparseLLT.h b/Eigen/src/Sparse/SparseLLT.h
index 7578a12c7..b7d4f5bbd 100644
--- a/Eigen/src/Sparse/SparseLLT.h
+++ b/Eigen/src/Sparse/SparseLLT.h
@@ -139,7 +139,6 @@ void SparseLLT<MatrixType,Backend>::compute(const MatrixType& a)
for (int j = 0; j < size; ++j)
{
Scalar x = ei_real(a.coeff(j,j));
- int endSize = size-j-1;
// TODO better estimate of the density !
tempVector.init(density>0.001? IsDense : IsSparse);
@@ -191,7 +190,8 @@ bool SparseLLT<MatrixType, Backend>::solveInPlace(MatrixBase<Derived> &b) const
ei_assert(size==b.rows());
m_matrix.solveTriangularInPlace(b);
- m_matrix.adjoint().solveTriangularInPlace(b);
+ // FIXME should be .adjoint() but it fails to compile...
+ m_matrix.transpose().solveTriangularInPlace(b);
return true;
}
diff --git a/Eigen/src/Sparse/TaucsSupport.h b/Eigen/src/Sparse/TaucsSupport.h
index 5edf0fc27..22fef1ceb 100644
--- a/Eigen/src/Sparse/TaucsSupport.h
+++ b/Eigen/src/Sparse/TaucsSupport.h
@@ -151,7 +151,7 @@ void SparseLLT<MatrixType,Taucs>::compute(const MatrixType& a)
else
{
// use the faster Multifrontal routine
- m_taucsSupernodalFactor = taucs_ccs_factor_llt_ll(&taucsMatA);
+ m_taucsSupernodalFactor = taucs_ccs_factor_llt_mf(&taucsMatA);
}
m_status = (m_status & ~IncompleteFactorization) | CompleteFactorization | MatrixLIsDirty;
}
@@ -177,16 +177,19 @@ template<typename MatrixType>
template<typename Derived>
void SparseLLT<MatrixType,Taucs>::solveInPlace(MatrixBase<Derived> &b) const
{
- const int size = m_matrix.rows();
- ei_assert(size==b.rows());
-
if (m_status & MatrixLIsDirty)
{
-// ei_assert(!(m_status & SupernodalFactorIsDirty));
-// taucs_supernodal_solve_llt(m_taucsSupernodalFactor,double* b);
- //matrixL();
+ // TODO use taucs's supernodal solver, in particular check types, storage order, etc.
+ // VectorXb x(b.rows());
+ // for (int j=0; j<b.cols(); ++j)
+ // {
+ // taucs_supernodal_solve_llt(m_taucsSupernodalFactor,x.data(),&b.col(j).coeffRef(0));
+ // b.col(j) = x;
+ // }
+ matrixL();
}
- else
+
+
{
Base::solveInPlace(b);
}