Previously there was an assignment dimension mismatch in the
history update; thus, over time, the history would contain
(only) replicated copies of the (max_num_corrections_ -1)-th
update and the most recent update.
Change-Id: I26203acf689686d41a5029c675ebbe001fe05d90
1. When protocol buffers support is enabled CompressedRowSparseMatrix
has a missing virtual method.
2. When SuiteSparse is missing, covariance_test tries to run the
large scale covariance computation test.
Thanks to Alex Stewart for reporting #1.
Change-Id: I4238c966036362175e31749595ea8bb6f12a696c
Drop support for protocol buffers.
Add CompressedRowSparseMatrix::CreateBlockDiagonalMatrix.
Add CompressedRowSparseMatrix::SolveLowerTriangularInPlace.
Add CompressedRowSparseMatrix::SolveLowerTriangularTranposeInPlace.
Add CompressedRowSparseMatrix::Transpose.
Change-Id: I2328afca9fac632685eac72ebb00998bd3510187
Issue was caused by the way how SUITESPARSE_FOUND was set and
used in IF conditions later. Basically, SUITESPARSE_FOUND was
setting to a value which needed to be expanded using ${} to get
it's actual value.
Made it so SUITESPARSE_FOUND is setting to either TRUE or FALSE
from an IF condition which does check for whether all the
dependencies are met.
Also removed expanding some of the variables in IF conditions,
they're not needed actually.
Change-Id: Iad01a3a49fb500375e344e5352a56a0c89be3b5a
fix compilation error on Ubuntu 12.0
In file included from /usr/include/fcntl.h:252:0,
from /home/ajg23/src/ceres-solver/examples/libmv_bundle_adjuster.cc:91:
/home/ajg23/src/ceres-solver/examples/libmv_bundle_adjuster.cc: In member function ‘T {anonymous}::EndianAwareFileReader::Read() const [with T = unsigned char]’:
/home/ajg23/src/ceres-solver/examples/libmv_bundle_adjuster.cc:300:5: error: ignoring return value of ‘ssize_t read(int, void*, size_t)’, declared with attribute warn_unused_result [-Werror=unused-result]
Change-Id: Ib23ca19778761bbfe0d77bcf32a2181ce6db1a12
Issue was caused by declaring class PerThreadContext with some
members of choldmod-specific types. This class in only used from
an #ifndef CERES_NO_SUITESPARSE block and solved compilation error
by simply wrapping PerThreadContext with the same #ifndef block.
Change-Id: Icdc329073fcbd4a328e41ea8c0af0962e9c34ba8
Changed DynamicAutoDiffCostFunction to handle multiple derivative
sections as opposed to just a single contiguous block.
In the previous implementation it was assumed that non-constant
parameters occur in a single contiguous block so that constant
parameters could NOT lie between non-constant parameters. Previously,
start_derivative_section was first set as soon as the first
non-constant parameter block (marked by jacobians[i] != NULL) was
encountered. After this, entries in input_jets[parameter_cursor].v were
accessed with `parameter_cursor - start_derivative_section`. For
contiguous non-constant parameter blocks this is fine, but if constant
parameter blocks fall between then this indexing is incorrect because
`parameter_cursor - start_derivative_section` can go out of bounds.
For a concrete example, take a cost function with three parameter
blocks, each of size 1 and with the center block fixed. Assume that
Stride=1 so that two passes are required. On the first pass
start_derivative_section=0, and the first variable block is handled
correctly. At the end of the first pass end_derivative_section=1, so
for the second pass start_derivative_section=1. Now comes the problem.
When parameter_cursor=1, parameter_cursor >= start_derivative_section
so jacobian[1] is checked to be NULL. Since it is NULL (second
parameter block is constant) then nothing is done and
active_parameter_count is NOT incremented. Next, when
parameter_cursor=2, parameter_cursor >= start_derivative_section and
jacobian[2] is checked. Since it is not NULL then
input_jets[parameter_cursor].v[parameter_cursor -
start_derivative_section] is set to 1.0, BUT parameter_cursor -
start_derivative_section = 2 - 1 = 1 which is out of bounds
(input_jets[parameter_cursor].v is only of size Stride=1).
The proposed solution records the start of each contiguous block of
non-constant parameters and indexing into
input_jets[parameter_cursor].v is independent of parameter_cursor.
Change-Id: I388ab6a0bafa35d317491135ec6fe980453ff888
Ordering of Problem::RemoveParameterBlock and Problem::RemoveResidualBlock
changed, as RemoveResidualBlock is being referred in RemoveParameterBlock
with "above".
Change-Id: I07f8e7b7e20ba239a72c15ed9e79576f5def090a
Not entirely sure how and why this was compiling up till now.
Thanks to Carlos Hernandez for reporting this.
Change-Id: Ieadbb8cb0a3769afe9dcef927ff0287342e44f1f
This sets the stage of preconditioners that can utilize
different kinds of matrix layouts, just like the LinearSolver
class hierarchy.
Change-Id: I3579cf344bcd2eeeecb1ae621cab02a3c9a0f920
This support was broken due to the TrustRegionMinimizer refactoring.
It is now enabled again, with the responsibilty for dumping the
problem shifted to the individual TrustRegionStrategy.
There is however one wrinkle, which is perhaps an indication of
poor design to start with. The LinearLeastSquaresProblemProto
carries in it num_eliminate_blocks, something which does not
exist anymore. More importantly, the TrustRegionStrategy does not
have access to this quantity anymore.
Dealing with this will be the subject of a future change.
Change-Id: I358adf6a2e386f4940b617bf950d6c7e87d2635d
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
1. Multithread the inversion of J'J.
2. Simplify the dense rank truncation loop.
3. Minor correction to building documentation.
Change-Id: Ide932811c0f28dc6c253809339fb2caa083865b5
1. Further tightening of the Covariance documentation.
2. Documented minimizer progress output.
3. Lint cleanup from William Rucklidge.
4. Updated version history.
Change-Id: I8bc28484675d4edf89a7c050b6379dbac6c39e91
1. Sparse covariance estimation now uses cholmod_rcond to
detect singular Jacobians.
2. Dense covariance estimation now uses relative magnitude
of singular/eigen values to compute the pseudoinverse.
3. Truncation logic is now unified with Solver::Options::null_space_rank.
Change-Id: I095bd737510c836b4251255926190a7f31d64bce
Add example application which is based on bundle
adjustment code from Libmv library, which is heavily
used in Blender.
Apart from bundle adjustment code this commit also
contains real-life optimization problems from VFX
pipeline. This files are created from production
files of Tears of Steel movie.
New code is placed to examples, and could be used
either as an example implementation of BA or for
timing investigation of problems appearing in VFX.
Problems for this application are placed to
data/libmv-ba-problems.
Usage:
./libmv_bundle_adjuster --input=/path/to/problem_file.bin
There's also optional flag --refine_intrinsics which
declares explicitly whether intrinscis shall be
refined or not. If this flag is not passed, refinement
will happen for problems stored in image space.
Structure of problem files is described in header
comment of libmv_bundle_adjuster.cc.
Change-Id: I51202848c75dcd7612b707609e5ff3708e01b625
Apparently, TR1 symbols are defined in different namespace
comparing to MSVC 2010, which lead to compilation error when
using MSVC 2008.
Change-Id: I4fa3ceae4b4e2c6e7a46b1fb5b498640e7b18b74
- In C you're not allowed to define variables in the middle
of the block. This was violated in curve_fitting.c by
calling ceres_init() in the beginning of main() and declaring
variables later.
- Also ifdef-ed suitesparse stuff in covariance estimation module.
This solves compilation error when you don't have suitesparse
compiled/installed.
Change-Id: I22b543c09ea01f55e127079daade99a0b781f789
Also
1. Remove an inadvertent LOG(INFO) from trust_region_minimizer.cc
2. Refactor some of the code in FullReport to reduce duplication
across line search and trust region minimizers.
3. Consistent capitalization.
Change-Id: I9078b1704efab23d2858530636f524e60c7d9016
Remove the Eigen temporary by revealing the columnwise nature
of the computation. This also allows us to get rid of the
special case for nrow = 1.
On problem-356-226730-pre.txt with -robustify evaluation times
change from:
Before:
Residual Evaluations 1.015
Jacobian Evaluations 18.313
After:
Residual Evaluations 1.005
Jacobian Evaluations 8.382
To give a sense of the overhead reduction, compare these numbers
when loss functions are disabled.
Residual Evaluations 0.955
Jacobian Evaluations 7.772
So, this is a 17.5x speedup!
The one dimensional specialization was motivated by denoising.cc.
The evaluation times there are essentially unchanged.
Before:
Residual Evaluations 2.774
Jacobian Evaluations 20.178
After:
Residual Evaluations 2.588
Jacobian Evaluations 19.781
Change-Id: Ic0efbaed75fe4489635039f17189ae24b97802c8
This allows CovarianceImpl to be forward declared without
scoped_ptr freaking out.
Thanks to Nima Keivan for reporting this.
Change-Id: Icd5aa766b3aab70246055225231a4b971c6b7b90