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

sparseQR problem

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

sparseQR problem

Wed Mar 02, 2016 5:57 pm
hello,
I am new to Eigen. I tried to use the sample code (a 2D possion problem) with MSVC 2013. The sample code as it is works fine. But when I changed the solver from Eigen::SimplicialCholesky to Eigen::SparseQR, the program will run a long time and then crush.
Here is how my code looks like
Code: Select all
int n = 300;  // size of the image
   int m = n*n;  // number of unknows (=number of pixels)
   std::vector<T> coefficients;            // list of non-zeros coefficients
   Eigen::VectorXd b(m);                   // the right hand side-vector resulting from the constraints
   buildProblem(coefficients, b, n);

   SpMat A(m, m);
   A.setFromTriplets(coefficients.begin(), coefficients.end());

   // Solving:
   //Eigen::SimplicialCholesky<SpMat> solver(A);  // performs a Cholesky factorization of A
   A.makeCompressed();
   Eigen::SparseQR<SpMat, Eigen::COLAMDOrdering<int>> solver(A);

   Eigen::VectorXd x = solver.solve(b);         // use the factorization to solve for the given right hand side

have I missed something here? thanks for the help in advance.

Ruigang
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: sparseQR problem

Wed Mar 02, 2016 8:57 pm
I don't see anything obvious. To reproduce, please share your data as explained there: http://eigen.tuxfamily.org/dox-devel/gr ... tml#title7


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft