I have two sparse matrices A and B and I want to compute X as X = A\B also the same solution to the equation A*X = B
Is there a library in C++ that has this functionality?, I tried Eigen with SparseLU solver but it's taking too much time, when dealing with very large sparse matrices ((6*6)millions), much longer than Matlab.
any ideas?
Edit:
Here's the solving snippet in Eigen and OpenCV, the matrix is originally an image, the output is also an image, also it's better if B or EIN in the snippet to be dense but I can't do so in Eigen
Eigen::SparseLU<Eigen::SparseMatrix<float>> Solver;
EA.makeCompressed();
Solver.compute(EA);
if (Solver.info() != Eigen::Success) std::cout << Solver.lastErrorMessage() << std::endl;
else std::cout << "Success !" << std::endl;
cv::SparseMat IN(MatTraverse(Image));
Eigen::SparseMatrix<float> EIN = SparseCV2Eigen(IN);
Eigen::SparseMatrix<float> OUT = Solver.solve(EIN);
Eigen::MatrixXf OUTM(OUT);
OUTM.resize(Image.cols,Image.rows);
cv::Mat CVOUT(OUTM.rows(), OUTM.cols(), CV_32F, OUTM.data());
Another, the same equation can be solved in Matlab using X = A\B in a much faster time
X, e.g., ` X*y` you instead can calculate:luA.solve(B*y)(assumingluAis an LU-decomposition ofA. - chtz