techoe / ceres-solver

Automatically exported from code.google.com/p/ceres-solver
Other
0 stars 0 forks source link

Reduce memory usage and copies in SPARSE_SCHUR #89

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently SPARSE_SCHUR uses BlockRandomAccessSparseMatrix to store the schur 
complement. This matrix is essentially a set of (i,j,s) triplets with with the 
ability to do block random access. Once filled, this matrix is then converted 
into a cholmod_sparse object which involves the construction of a compressed 
column matrix from scratch which is then passed onto CHOLMOD for factorization.

Work: Implement a BlockRandomAccessCRSMatrix object that uses a compressed row 
matrix instead of triplets to store the Schur complement and pass it to 
CHOLMOD. 6-8 hours of work.

Original issue reported on code.google.com by sameerag...@google.com on 3 Mar 2013 at 9:41

GoogleCodeExporter commented 9 years ago
https://ceres-solver-review.googlesource.com/#/c/2760/

This is a tossup at this point. It saves memory, but takes up time. Also, it 
turns out, that cholmod makes a couple of copies of the matrices input to it 
inside cholmod_factorize, depending on the orientation of the matrix and the 
presence/absence of permutations.

So, reducing memory usage in this case is actually a more involved production, 
which should be looked at more holistically across all of Ceres. In particular, 
the biggest impact is perhaps in SPARSE_NORMAL_CHOLESKY, where a permuted 
Jacobian/Hessian with the right orientation is the way to go.

http://www.cise.ufl.edu/research/sparse/cholmod/CHOLMOD/Cholesky/cholmod_factori
ze.c

Original comment by sameerag...@google.com on 26 Mar 2013 at 7:25

GoogleCodeExporter commented 9 years ago
This has been done for a while now.

Original comment by sameerag...@google.com on 18 Jun 2013 at 5:16