Refactor SparseNormalCholeskySolver

Now that there is a single piece of code doing the outer product
computation for all three sparse linear algebra backends, move
this code one level up the call stack and there by make the actual
per-library solver code shorter and simpler.

Also fix a minor omission in the outer product computation code
where row/column blocks were not being copied over to the
outer product matrix.

Change-Id: I22a7967bdc659385b741901afefa7af312e676e5
This commit is contained in:
Sameer Agarwal
2017-04-25 09:32:08 -07:00
parent 0859fe8a57
commit 1d7185f130
4 changed files with 96 additions and 105 deletions
@@ -561,6 +561,9 @@ CompressedRowSparseMatrix* CreateOuterProductMatrix(
new CompressedRowSparseMatrix(num_cols, num_cols, num_nonzeros);
matrix->set_storage_type(storage_type);
*(matrix->mutable_row_blocks()) = blocks;
*(matrix->mutable_col_blocks()) = blocks;
// Compute block offsets for outer product matrix, which is used in
// ComputeOuterProduct.
vector<int>* block_offsets = matrix->mutable_block_offsets();