![]() Registered Member ![]()
|
Hi,
I am trying to factorize a mxn matrix (m>n) using SparseQR. The matrix size is 25700 x 12700. However, the factorization step runs for a few hours after which I had to termnate the process. Below is the code that I tried. //Create Eigen Matrix From Triplets SparseMatrix<double, ColMajor, long> N(nRows, mCols); N.setFromTriplets(cscVectors.begin(), cscVectors.end()); cout << "Building QR Solver..\n"; //Get Inv(N) SparseQR< SparseMatrix<double, ColMajor, long>, COLAMDOrdering<long> > qrSolver; //Compute Fill-Reducing Ordering For N qrSolver.analyzePattern(N); if(qrSolver.info() != Success) { cout << "Ordering Failed.. " << qrSolver.lastErrorMessage() << "\n"; return false; } //Numeircal Factorization Of N qrSolver.factorize(N); //Code just seems to stop here if(qrSolver.info() != Success) { cout << "Decomposition Failed.. " << qrSolver.lastErrorMessage() << "\n"; return false; } What can I do to speed up this time? Thanks, Naval |
![]() Moderator ![]()
|
Are you sure that the compiler optimizations are ON? What about the number of non-zeros? Do you have a full row or column? For such a matrix it should not take more than 1 or 2 seconds. Have you tried with 'int' instead of 'long' for the index types? I'm not 100% sure that SparseQR has been properly checked with long.
|
![]() Registered Member ![]()
|
Hi,
Thanks for your reply. I am trying with "int" now. However, I also had a few other concerns too. When I compile the code, I get these warnings.. ../../../Eigen/src/OrderingMethods/Eigen_Colamd.h:742: warning: converting to ‘int’ from ‘double’ ../../../Eigen/src/OrderingMethods/Eigen_Colamd.h:743: warning: converting to ‘int’ from ‘double’ Is it safe to ignore these warnings? What optimization level do you suggest? Thanks, Naval |
![]() Registered Member ![]()
|
Hi,
Below are the answers to your questions.. Are you sure that the compiler optimizations are ON? It was previously OFF. I tried using -O first, and then later tried with -O2. Same thing. Code just seems to get stuck at factorization step. I have to abort it after that. What about the number of non-zeros? Matrix size that I am currently working on is 25372 x 12703, with number of non-zeros 31274422. Acutally the matrix is supposed to be 25372 x 25372, but I remove the empty columns before I hand over the matrix to Eigen. Do you have a full row or column? For such a matrix it should not take more than 1 or 2 seconds. No. Have you tried with 'int' instead of 'long' for the index types? I'm not 100% sure that SparseQR has been properly checked with long. Tried using 'int' too. However, same thing. As pointed out in my previous post, I get those warning messages. I tried to run the code ignoring those warnings. Is that safe? Thanks, Naval |
![]() Moderator ![]()
|
Your matrix has about 2600 entries per columns, so regardless of the re-ordering, the factors are very likely to be dense and prohibitive to compute, especially for our simplicial sparse QR. You might consider using an iterative solver.
|
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], rblackwell