Commit Graph

17 Commits

Author SHA1 Message Date
Sameer Agarwal 14d8297cf9 Refactor Covariance::Options::algorithm_type.
THIS IS AN API BREAKING CHANGE.

Decouple the algorithm from the sparse linear algebra
library being used to perform the computation.

Before this change

Covariance::AlgorithmType had values

DENSE_SVD
EIGEN_SPARSE_QR
SUITE_SPARSE_QR

This has been replaced by two enums now.

Covariance::Options::sparse_linear_algebra_library_type
which can take values EIGEN_SPARSE, SUITE_SPARSE or CX_SPARSE.
The last one is currently not supported.

And Covariance::Options::algorithm_type takes values

DENSE_SVD
SPARSE_QR

This sets the stage for future extensions of the covariance
computation algorithm.

Also as part of this change, the covariance computation chapter
has been made a top level chapter on its own instead of being
buried deep inside the Solving Non-linear Least Squares problem.

Change-Id: Ibfbf60902d8d17694d9ff585047a5a57d329ab22
2017-04-17 09:43:22 -07:00
Sameer Agarwal 15587dd1a9 Lint changes from William Rucklidge
Change-Id: If05a774c5e7dd318e6b3ee698e313f0fc58ee922
2016-01-05 11:31:13 -08:00
Wannes Van Loock b0bf9fd2a9 Add covariance matrix for a vector of parameters
Computing the covariance matrix for a number of parameter blocks
previously required adding all parameter blocks to the computation and
subsequently assembling the matrix by concatenating all the blocks.

This patch adds the computation of the covariance matrix for a vector
of parameter blocks. All covariance block pairs are added automatically
and the resulting covariance matrix is assembled in the order the
parameter blocks appear.

Change-Id: I3b70c63f16862adc23a1d7fb7a21dde4e68abe9a
2016-01-04 20:26:40 +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
Steve Hsu a1579be80b Add method to return covariance in tangent space
This CL is required to build Tango.

Inspired by this commit in RedwoodInternal repository:
  commit 09dde53c248e04f432b5eccceea5daeedb706aea
  Author: Mike Vitus <mike@hidof.com>
  Date:   Wed Apr 23 11:05:17 2014 -0700

Change-Id: I328b6634969de4ccdd71947945aa67a49ee9073f
2015-03-12 11:40:18 -07: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 060a850602 Remove SPARSE_CHOLESKY based covariance estimation.
Sparse Cholesky factorization is not rank revealing. Therefore
this algorithm cannot reliably tell when the Jacobian matrix is
rank deficient or so poorly conditioned that the covariance matrix
cannot be estimated.

Making things worse, this algorithm works on the normal equations,
which makes the conditioning problem much worse.

This change, deletes the SPARSE_CHOLESKY algorithm in the covariance
estimation code. Also to make the naming consistent, it renames

SPARSE_QR -> SUITE_SPARSE_QR

so that it parallels EIGEN_SPARSE_QR.

Also, since we now have EIGEN_SPARSE_QR, we can default to using
it when SuiteSparse is not available instead of DENSE_SVD, which
generally speaking should only be used by folks who are dealing
with small rank deficient jacobians.

Change-Id: I8b134c7e8a2e86ca374371f185b19f1c3e74349c
2014-07-20 07:35:35 -07:00
Björn Piltz c0b883816f Disabled warning C4251 Added the files disable_warnings.h and reenable_warnings.h which need to be included by every file that uses the macro CERES_EXPORT.
Change-Id: I176326a600d094a4524bac873564fcbf8efd2456
2014-05-19 22:53:41 +02:00
Björn Piltz 5d7eed87b4 Suppport for MSVC DLLs.
Change-Id: Ibbcc4ba4e59f5bbf1cb91fe81c7d3b9042d03493
2014-04-28 19:56:24 +00:00
Sameer Agarwal 5a974716e1 Covariance estimation using SuiteSparseQR.
Change-Id: I70d1686e3288fdde5f9723e832e15ffb857d6d85
2013-07-17 22:56:01 -07:00
Sameer Agarwal 1f17f56c4e Add Covariance documentation to html docs.
Change-Id: I11ddc9f7069964596760c6ea4d85c44312c0a67a
2013-06-09 23:23:38 -07:00
Sameer Agarwal f3e1267aa1 Update the documentation for Covariance.
Remove some of the dire warnings about instability
as the implementation is reasonably stable.

Change-Id: I3b64cab04e4cda54c671fcf8a2ca5d95c15037bf
2013-06-04 21:52:12 -07:00
Sameer Agarwal 8f7e8963cb Multithread covariance estimation.
1. Multithread the inversion of J'J.
2. Simplify the dense rank truncation loop.
3. Minor correction to building documentation.

Change-Id: Ide932811c0f28dc6c253809339fb2caa083865b5
2013-06-04 16:19:45 -07:00
Sameer Agarwal 4437639e9b Documentation updates.
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
2013-06-03 09:41:27 -07:00
Sameer Agarwal 7129cd3157 Pay attention to condition number in covariance estimation.
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
2013-06-02 23:36:27 -07:00
Sameer Agarwal 45ac14fac7 Add destructor to Covariance.
This allows CovarianceImpl to be forward declared without
scoped_ptr freaking out.

Thanks to Nima Keivan for reporting this.

Change-Id: Icd5aa766b3aab70246055225231a4b971c6b7b90
2013-05-20 09:16:28 -07:00
Sameer Agarwal 02706c1906 Sparse covariance estimation.
Add a Covariance object to the API.

Given a Problem object and a set of parameter block pairs the
Covariance object computes a sparse covariance matrix corresponding
to those block pairs and provides random access to them.

Constant parameter blocks and parameter blocks with local parameterizations
are correctly handled.

Sparse and dense implementations are provided. With the dense implementation
rank deficient Jacobians can also be handled.

Parts of the code are threaded using OpenMP if available.

Change-Id: I5b49583b3d79579df3e0f334c22567acb23ed4ad
2013-05-18 23:33:02 -07:00