Commit Graph

20 Commits

Author SHA1 Message Date
Alex Stewart 2bbee09ed8 Document rationale for not reordering program when using Accelerate.
Change-Id: Id11b3920cfdc706133ee497773a537287adc0a27
2018-09-16 16:52:11 +01:00
Alex Stewart 8f41ca6abc Add Apple's Accelerate framework as a sparse linear algebra library.
- Currently DynamicSparseNormalCholeskySolver is unsupported for
  Accelerate.

Change-Id: I03b5a86bb22fef249c4aecd48947a613e8eff7a5
2018-06-29 09:43:03 +01:00
Sameer Agarwal e49507cbea More C++ification.
"> >" -> ">>"
"> > >" -> ">>>"

Change-Id: Id1ddd9dbf030fe21d57207741b4ca8403068e55b
2018-04-03 10:58:15 -07:00
Keir Mierle 7c4e8a454e Replace scoped_ptr with C++11's unique_ptr
Change-Id: Ib5a504c491e3a79af52a95accf009df473470c6b
2018-04-02 14:47:47 -07:00
Sameer Agarwal a1458f3348 More C++11ification.
1. Replace HashMap and HashSet with std::unordered_map and
   std::unordered_set respectively.
2. Extract the pair hasher into a struct pair_hash.
3. Delete collections_port.h
4. Convert explicit iterator based loops to auto based
   loops where sensible.

Change-Id: Ib88bcd13a7463d18435639d3b771abaa52080efb
2018-03-30 12:03:28 -07:00
Sameer Agarwal e1bcc6e0f5 Add additional logging for analyzing orderings
Change-Id: Ic68d2959db35254e2895f11294fb25de4d4b8a81
2016-08-02 10:12:04 -07:00
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 74fd412420 Lint changes from William and Jim.
Change-Id: Ida89b67c66b3bc7683d95e63646dfb2f9679d1b1
2015-01-08 11:45:15 -08: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
Alex Stewart 5dd76869cf Fix unused-function warning with Eigen < 3.2.2.
- CreateBlockJacobian() is only ever used when Eigen >= 3.2.2 is
  detected, but was previously defined whenever CERES_USE_EIGEN_SPARSE
  was defined with no check on the Eigen version.
- This resulted in an unused-function compile warning that became an
  error due to -Werror, preventing compilation when using Eigen < 3.2.2.

Change-Id: I24628ff329f14b087ece66bf2626bdc0de4ba224
2014-09-19 16:08:25 +01:00
Sameer Agarwal c5d8d06802 Fix a unused function error with Eigen version 3.2.1 or less.
Thanks to Johannes Schoenberger  for reporting this.

Change-Id: Ie17d28f2a68734a978a8c95007724bc4055de43a
2014-08-29 20:31:19 -07:00
Sameer Agarwal 5f96c62b56 Add Block AMD ordering for SPARSE_SCHUR + EIGEN_SPARSE.
Ordering routines for the Schur complement when using EIGEN_SPARSE.
Also integration into SchurComplementSolver.

Part of this CL is also a refactoring of the block jacobian matrix
construction.

Change-Id: I11d665cc7d4867c64190e6fed1118f4d2e13d59b
2014-08-28 23:57:58 -07:00
Sameer Agarwal 9f7032369e Block AMD for SparseNormalCholesky + EIGEN_SPARSE.
This is just the reordering routine. The integration with
SparseNormalCholesky shall happen in a subsequent CL.

Change-Id: I39ddc32aa66b11c368faf75404850fa0ae0d2b3a
2014-08-28 21:46:43 -07:00
Sameer Agarwal b9331cd407 Cleanup reorder_program.cc
Program::SetParameterOffsetsAndIndex() was being called willy nilly.
Now the invariant is that any function that actually reorders the
program, updates the offsets and indices.

Also the logic around handling EIGEN_SPARSE has been simplified in
anticipation of the block AMD code that is forthcoming.

Last but not the least, num_eliminate_blocks, which is a rather
cryptic name to begin with has been replaced by the more meaningful
size_of_first_elimination_group.

Change-Id: I77e684f699a93b53e76aa406d64f40f8704df813
2014-08-28 21:25:48 -07:00
Sameer Agarwal f7da411ef0 Preprocessor for the TrustRegionMinimizer.
1. Base class for preprocessors.
2. A preprocessor for problems that will be solved using
   the trust region minimizer.
3. Added sanity tests to the program reordering options
   for Schur type linear solvers.
4. Tests for the TrustRegionPreprocessor.

Change-Id: I88cd926f0053bbbf2bd6b11e03ec55b8bf473cf1
2014-08-12 21:58:25 -07:00
Sameer Agarwal 031598295c Enable Eigen as sparse linear algebra library.
SPARSE_NORMAL_CHOLESKY and SPARSE_SCHUR can now be used
with EIGEN_SPARSE as the backend.

The performance is not as good as CXSparse. This needs to be
investigated. Is it because the quality of AMD ordering that
we are computing is not as good as the one for CXSparse? This
could be because we are working with the scalar matrix instead
of the block matrix.

Also, the upper/lower triangular story is not completely clear.
Both of these issues will be benchmarked and tackled in the
near future.

Also included in this change is a bunch of cleanup to the
SparseNormalCholeskySolver and SparseSchurComplementSolver
classes around the use of the of defines used to conditionally
compile out parts of the code.

The system_test has been updated to test EIGEN_SPARSE also.

Change-Id: I46a57e9c4c97782696879e0b15cfc7a93fe5496a
2014-07-31 22:05:34 -07:00
Sameer Agarwal 0cc1bc5bbd Add missing files to the NDK build.
Add reorder_program.cc and also fix an include
error which was only triggered by the NDK build.

Change-Id: Ic800687d1857be1e3d60a44b87595d59e52c1117
2014-06-06 15:24:03 -07:00
Sameer Agarwal e497f4939a Refactor reordering routines.
Move all the program reordering programs into their own file.
Also split the reordering routines for SPARSE_NORMAL_CHOLESKY
into individual library dependent routines.

Also get rid of RemovedFixedBlocksFromProgram.

Change-Id: Ie969f529e6d20dded9da021b9df1a040e08287c1
2014-06-06 05:32:21 +00:00