Sameer Agarwal 5f433c8a22 Fix a reallocation bug in CreateJacobianBlockSparsityTranspose.
CreateJacobianBlockSparsityTranspose starts with a conservative
estimate of the size of the block sparsity pattern of the Jacobian.
When the Jacobian has more non-zeros than that, the TripletSparseMatrix
being used to store the sparsity has a Reallocate method which
allows one to resize the matrix and IF num_nonzeros is set, then the
existing values in the array are also copied into the newly allocated
memory.

Unfortunately the pattern we follow in ceres code is to call
set_num_nonzeros after one is done populating the sparsity pattern
of a matrix. This does not mix well with Reallocate and results
in the matrix having uninitialized memory.

This patch fixes this problem and adds a test that verifies the fix.

Thanks to Yuliy Schwartzburg for reporting this bug and providing
code to reproduce it.

Change-Id: I58583714ffaebd880d85af16e3685b2d6ee053e8
2013-06-13 06:57:58 -07:00
2012-08-02 18:35:16 -07:00
2013-06-03 09:41:27 -07:00
2013-02-24 19:04:21 +00:00
2012-04-30 23:09:08 -07:00
2013-02-15 14:29:51 -08:00

Ceres Solver - A non-linear least squares minimizer
==================================================
Please see docs/html/index.html for a tutorial and reference.
S
Description
No description provided
Readme Multiple Licenses 42 MiB
Languages
C++ 94.4%
CMake 3.8%
Python 0.8%
C 0.5%
Starlark 0.4%