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

newbie question with SparseLU

Tags: None
(comma "," separated)
a_li_ba_ba
Registered Member
Posts
2
Karma
0

newbie question with SparseLU

Wed Jan 22, 2014 1:46 am
Hi all,

First time Eigen user here. I am trying to setup a simple sparse solver like this:
Eigen::SparseMat<float> A;
// fill A by A.insert()
Eigen::VectorXd vB(A.rows());
// fill B vector
Eigen::SparseLU<Eigen::SparseMat<float>,Eigen::COLAMDOrdering<int> > solver;
solver.compute(A);
solver.solve(B);
The above compiles fine, but with below generates 2 compile errors:
Eigen::VectorXd X=solver.solve(B);
Something with the return type seems wrong but I can't decipher what's the correct way to do this. Please help. Thanks!

Using the latest dev branch code on windows 7 with eclipse/mingw.

-----------------------------------------------------
no matching function for call to '
Eigen::Map<Eigen::Matrix<float, -1, -1>, 0, Eigen::OuterStride<> >::Map(Eigen::DenseCoeffsBase<Eigen::Matrix<double, -1, 1>, 1>::Scalar*,
Eigen::internal::MappedSuperNodalMatrix<float, int>::Index&,
Eigen::internal::MappedSuperNodalMatrix<float, int>::Index&,
Eigen::OuterStride<>)'
line 271, external location: \Eigen\src\SparseLU\SparseLU_SupernodalMatrix.h C/C++ Problem

Description Resource Path Location Type
no matching function for call to '
Eigen::Map<Eigen::Matrix<float, -1, -1>, 0, Eigen::OuterStride<> >::Map(Eigen::DenseCoeffsBase<Eigen::Matrix<double, -1, 1>, 1>::Scalar*,
Eigen::SparseLUMatrixUReturnType<Eigen::internal::MappedSuperNodalMatrix<float, int>, Eigen::MappedSparseMatrix<float, 0, int> >::Index&,
Eigen::SparseLUMatrixUReturnType<Eigen::internal::MappedSuperNodalMatrix<float, int>, Eigen::MappedSparseMatrix<float, 0, int> >::Index&,
Eigen::OuterStride<>)'
line 709, external location: \Eigen\src\SparseLU\SparseLU.h C/C++ Problem
-----------------------------------------------------
a_li_ba_ba
Registered Member
Posts
2
Karma
0

Re: newbie question with SparseLU

Wed Jan 22, 2014 2:25 am
Ah ... fixed ... just change all the VectorXd to VectorXf to match the matrix type ... stupid me.


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]