Commit Graph

16 Commits

Author SHA1 Message Date
Sameer Agarwal 1635ce7260 Fix a bug in the reordering code.
When the user provides an ordering which starts at a non-zero group id,
or has gaps in the groups, then CAMD, the algorithm used to reorder
the program can crash or return garbage results.

The solution is to map the ordering into grouping constraints, and then
to re-number the groups to be contiguous using a call to
MapValuesToContiguousRange. This was already done for CAMD based
ordering for Schur type solvers, but was not done for SPARSE_NORMAL_CHOLESKY.

Thanks to Bernhard Zeisl for not only reporting the bug but also
providing a reproduction.

Change-Id: I5cfae222d701dfdb8e1bda7f0b4670a30417aa89
2015-08-19 22:36:51 +00:00
Keir Mierle 7492b0d8de Update copyright headers with new year and URL
Since Ceres is moving to using GitHub for issues, and the Google
Code URL in the current copyright header will soon become invalid,
update all the headers.

Change-Id: I1fce70375d1bcf098591f07b4d8f01a5c1e0789c
2015-03-18 05:43:23 +00:00
Sameer Agarwal 05a07ecc77 Remove using std::string from port.h
Change-Id: I7376f5e7eace22ec1fc05a61eaa858594f08682d
2015-01-07 15:10:46 -08:00
Sameer Agarwal bcc865f81c Remove using namespace std;
For historical reasons we had a "using namespace std;" in port.h. This
is generally a bad idea. So removing it and along the way doing a bunch
of cpplint cleanup.

Change-Id: Ia125601a55ae62695e247fb0250df4c6f86c46c6
2015-01-07 14:26:53 -08:00
Sameer Agarwal a536ae76df Lazily initialize the bounds arrays in ParameterBlock.
Problems that do not use bounds do not have to pay the
price of storing bounds constraints.

Also replace the raw pointer access to the upper and
lower bounds arrays with accessors which hides the
lazy initialization from the user.

Change-Id: I0325a35de9c29f853559f891e32e7c777686e537
2014-05-05 07:55:12 -07:00
Sameer Agarwal 6e3aad289f Lint cleanup from William Rucklidge.
Change-Id: Ifb36de18f95d521242d8853bb54024b09effb937
2014-02-24 13:35:26 -08:00
Sameer Agarwal 5cf867be49 Add support for bounds to ParameterBlock.
Add setters and getters for lower and upper bounds.
Generalize the Plus operation to include projection onto the
hypercube implied by the bounds.

Change-Id: I1e4028a9886c4064f31bbc5b7c22b0341a56c15d
2014-02-18 21:15:59 -08:00
Sameer Agarwal 6445bb1a46 Fix a logging bug in parameter_block.h
Not entirely sure how and why this was compiling up till now.

Thanks to Carlos Hernandez for reporting this.

Change-Id: Ieadbb8cb0a3769afe9dcef927ff0287342e44f1f
2013-06-14 10:21:48 -07:00
Sameer Agarwal beb4505311 Minor fixes
Based on William Rucklidge's review, including
a nasty bug in parameter block removal.

Change-Id: I3a692e589f600ff560ecae9fa85bb0b76063d403
2013-02-22 13:37:05 -08:00
Sameer Agarwal 9a88bd7c4b Minor bug fixes
Change-Id: I94e4521adf76a6c77db954c4a8955168e9d37b55
2013-02-19 13:09:12 -08:00
Keir Mierle 04938efe4b Add support for removing parameter and residual blocks.
This adds support for removing parameter and residual blocks.
There are two modes of operation: in the first, removals of
paremeter blocks are expensive, since each remove requires
scanning all residual blocks to find ones that depend on the
removed parameter. In the other, extra memory is sacrificed to
maintain a list of the residuals a parameter block depends on,
removing the need to scan. In both cases, removing residual blocks
is fast.

As a caveat, any removals destroys the ordering of the parameters,
so the residuals or jacobian returned from Solver::Solve() is
meaningless. There is some debate on the best way to handle this;
the details remain for a future change.

This also adds some overhead, even in the case that fast removals
are not requested:

- 1 int32 to each residual, to track its position in the program.
- 1 pointer to each parameter, to store the dependent residuals.

Change-Id: I71dcac8656679329a15ee7fc12c0df07030c12af
2013-02-18 15:00:30 -08:00
Sameer Agarwal 9123e2f624 An implementation of Ruhe & Wedin's Algorithm II.
A non-linear generalization of Ruhe & Wedin's algorithm
for separable non-linear least squares problem. It is implemented
as coordinate descent on an independent subset of the parameter
blocks at the end of every successful Newton step. The resulting
algorithm has much improved convergence at the cost of some
execution time.

Change-Id: I8fdc5edbd0ba1e702c9658b98041b2c2ae705402
2012-09-25 11:13:39 -07:00
Sameer Agarwal 1dc544adb0 Remove ParameterBlock::state_offset as it is not used.
Change-Id: I3d6fbe333dde73ceb4c6c5e01460aa997883889f
2012-09-19 12:11:55 -07:00
Keir Mierle 9705a736dd Add ParameterBlock::ToString() to aid debugging.
Change-Id: Id3f5cb27b855c536dd65a986f345bd8eb2799dfa
2012-08-20 11:25:26 -07:00
Sameer Agarwal 1fdc520f7b Refactor the array validation routines into their own file, as they are used by
more than just the residual block evaluation routines now.
Check the step computed by the linear solver for finiteness, and terminate early
if it is not. This will prevent bugs where the solver continues to run after
encountering an nan.
2012-05-12 07:29:10 -07:00
Keir Mierle 8ebb073038 Initial commit of Ceres Solver. 2012-04-30 23:09:08 -07:00