This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Problem with SimplicialCholesky

Tags: None
(comma "," separated)
mflamer
Registered Member
Posts
1
Karma
0

Problem with SimplicialCholesky

Tue May 07, 2013 1:29 am
I have a system that will solve with the sparse Eigen::ConjugateGradient solver class but will not compile when I switch the solver to Eigen::SimplicialCholesky<SpMat>. This is the error VS2012 throws.

Error 1 error C2664: 'Eigen::SparseTriangularView<MatrixType,Mode>::SparseTriangularView(const MatrixType &)' : cannot convert parameter 1 from 'const Eigen::Transpose<MatrixType>' to 'const Eigen::Transpose<MatrixType> &' c:\users\mflamer\dropbox\dev\eigen-eigen-2249f9c22fe8\eigen\src\sparsecholesky\simplicialcholesky.h 333[/color][/color]

This is how I'm using the library. As you can see, I am wrapping some existing vector types. I'm pretty sure this is not the problem because I tried with some standard Eigen vectors and it made no difference. Also, the CG solver never complained about the Mapped vectors.

Code: Select all
void SparseSysMat_EL::solve( Vector& rhs, Vector& x )
{
   fSpMat.setFromTriplets( fTris.begin(), fTris.end() );
   fTris.clear();

   Eigen::Map<Eigen::VectorXd> rhs_EL(rhs.Data(), rhs.size());   
   
   x.resize( rhs.size() );
   Eigen::Map<Eigen::VectorXd> x_EL(x.Data(), x.size());


   Eigen::SimplicialCholesky<SpMat> solver;
   //Eigen::ConjugateGradient<SpMat> solver;
   solver.compute(fSpMat);
   if(solver.info() != Eigen::ComputationInfo::Success)
   {
      //decomp failed
      return;
   }
   
   x_EL = solver.solve(rhs_EL);
}


Thanks for any help.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Problem with SimplicialCholesky

Tue May 07, 2013 9:47 am
What is SpMat? This error message does not make sense:

cannot convert 'const Eigen::Transpose<MatrixType>' to 'const Eigen::Transpose<MatrixType> &'

some MSVC weirdness again... Do you have an older MSVC version to test?

One thing you might try, in simplicialcholesky.h, line 333:

Code: Select all
static inline MatrixU getU(const MatrixType& m) { return m.adjoint(); }

->
Code: Select all
static inline MatrixU getU(const MatrixType& m) { return m.adjoint().template triangularView<Eigen::UnitUpper>(); }


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]