Registered Member
|
Hello everyone,
I am working on a project of image processing on the iphone, i am using a mac and xcode, and I need to solve the equation Ax=b using sparse matrix. On the tutorial there is only a way to do this with dense matrix, is it possible to do it with sparse one with eigen? if yes, what is the code to use? If no, what do you suggest to me to use? (Something not too much complicated). Ideally I need that but for a sparse matrix A : A.llt().solve(b,&x); Or maybe if it is easier to do : x = (A.transpose() * A)^-1 * A.transpose() * b The matlab code of what I search is : x = lsqr(A,b,1e-03,500); I tried something like that, but it doesn't work. DynamicSparseMatrix<double> matrixA(num_constraints,ws*hs); //SparseVector<double> vectorB(num_constraints); VectorXf vectorB(num_constraints); //Fill the sparse matrix and vector SparseMatrix<double> matA(matrixA); VectorXf x(num_constraints); x.setZero(num_constraints); SparseLU<SparseMatrix<double>, SuperLU> slu(matA); slu.solve(vectorB, &x); Error at running time: Assertion failed: (false && "not implemented yet"), function compute, file /Users/.../Eigen/src/Sparse/SparseLU.h, line 136. Does that mean it is not yet implemented? or do I something wrong? Regards, Bodrak |
Registered Member
|
You're trying to use the SuperLU library backend to do your decomposition.
Did you include SuperLUSupport.h? I thought this was necessary for whichever backend you were trying to use. |
Moderator
|
using one of our solver backends on the iphone might be pretty tough! If your matrix is selfadjoint, I recommend you to use our built-in SparseLDLT decomposition/solver.
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]