SparseQR and SparseCholesky will not compile when passed in a MappedSparseMatrix.
Created attachment 396 [details] Patch for SimplicialCholesky.h I believe the only thing stopping this are that isolated portions of the code use the MatrixType typedef instead of the QRMatrixType and CholMatrixType, respectively. I have attached three patches with very minor modifications that allow me to use MappedSparseMatrix for both these sparse modules. I hope it is useful.
Created attachment 397 [details] Patch for SimplicialCholesky_impl.h I believe the only thing stopping this are that isolated portions of the code use the MatrixType typedef instead of the QRMatrixType and CholMatrixType, respectively. I have attached three patches with very minor modifications that allow me to use MappedSparseMatrix for both these sparse modules. I hope it is useful.
Created attachment 398 [details] Patch for SparseQR.h I believe the only thing stopping this are that isolated portions of the code use the MatrixType typedef instead of the QRMatrixType and CholMatrixType, respectively. I have attached three patches with very minor modifications that allow me to use MappedSparseMatrix for both these sparse modules. I hope it is useful.
Comment on attachment 398 [details] Patch for SparseQR.h >--- SparseQR_old.h 2013-11-20 17:38:59.502945600 -0700 >+++ SparseQR.h 2013-11-20 17:38:16.990514000 -0700 >@@ -353,7 +353,7 @@ > // all the nodes (with indexes lower than rank) reachable through the column elimination tree (etree) rooted at node k. > // Note: if the diagonal entry does not exist, then its contribution must be explicitly added, > // thus the trick with found_diag that permits to do one more iteration on the diagonal element if this one has not been found. >- for (typename MatrixType::InnerIterator itp(m_pmat, col); itp || !found_diag; ++itp) >+ for (typename QRMatrixType::InnerIterator itp(m_pmat, col); itp || !found_diag; ++itp) > { > Index curIdx = nonzeroCol ; > if(itp) curIdx = itp.row(); >@@ -504,7 +504,7 @@ > if(nonzeroCol<n) > { > // Permute the triangular factor to put the 'dead' columns to the end >- MatrixType tempR(m_R); >+ QRMatrixType tempR(m_R); > m_R = tempR * m_pivotperm; > > // Update the column permutation
Sorry, as neophyte I've really messed up my attempt to add patches. I was trying to fix an omission in the patch to SparseQR.h, but didn't realize it would make a new reply/comment. I've just added a new patch for SparseQR.h. Please ignore the first patch, and this comment. (In reply to comment #4) > Comment on attachment 398 [details] [review] > Patch for SparseQR.h > > >--- SparseQR_old.h 2013-11-20 17:38:59.502945600 -0700 > >+++ SparseQR.h 2013-11-20 17:38:16.990514000 -0700 > >@@ -353,7 +353,7 @@ > > // all the nodes (with indexes lower than rank) reachable through the column elimination tree (etree) rooted at node k. > > // Note: if the diagonal entry does not exist, then its contribution must be explicitly added, > > // thus the trick with found_diag that permits to do one more iteration on the diagonal element if this one has not been found. > >- for (typename MatrixType::InnerIterator itp(m_pmat, col); itp || !found_diag; ++itp) > >+ for (typename QRMatrixType::InnerIterator itp(m_pmat, col); itp || !found_diag; ++itp) > > { > > Index curIdx = nonzeroCol ; > > if(itp) curIdx = itp.row(); > >@@ -504,7 +504,7 @@ > > if(nonzeroCol<n) > > { > > // Permute the triangular factor to put the 'dead' columns to the end > >- MatrixType tempR(m_R); > >+ QRMatrixType tempR(m_R); > > m_R = tempR * m_pivotperm; > > > > // Update the column permutation
Created attachment 399 [details] Updated patch for SparseQR.h I believe the only thing stopping this are that isolated portions of the code use the MatrixType typedef instead of the QRMatrixType and CholMatrixType, respectively. I have attached three patches with very minor modifications that allow me to use MappedSparseMatrix for both these sparse modules. I hope it is useful.
Any thoughts on this? I know I made a mess of this bug report, but I believe the patches I included should fix this, and having the decompositions work on MappedSparseMatrix is an important feature, as it's often prohibitively expensive to perform a copy to a SparseMatrix. This is so in my application of interest. Thanks!
-- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/706.