Class NormalDelta

Inheritance Relationships

Base Type

  • public ceres::CostFunction

Class Documentation

class NormalDelta : public ceres::CostFunction

Implements a cost function that models a difference between variables.

The cost function is of the form:

cost(x) = ||A( (x1 - x0) - b)||^2

where, the matrix A and the vector b are fixed and x0 and x1 are the variables. In case the user is interested in implementing a cost function of the form

cost(x) = ((x1 - x0) - mu)^T S^{-1} ((x1 - x0) - mu)

where, mu is a vector and S is a covariance matrix, then, A = S^{-1/2}, i.e the matrix A is the square root information matrix (the inverse of the covariance). There are however no restrictions on the shape of A. It is free to be rectangular, which would be the case if the covariance matrix S is rank deficient. This could arise, for example, if you are only measuring a subset of the variable dimensions.

Public Functions

NormalDelta(const fuse_core::MatrixXd &A, const fuse_core::VectorXd &b)

Construct a cost function instance.

The number of rows in vector b must be the same as the number of columns of matrix A.

Parameters:
  • A[in] The residual weighting matrix, most likely the square root information matrix

  • b[in] The measured difference between variable x0 and variable x1. It is assumed that these are the same type of variable. At a minimum, they must have the same dimensions and the per-element subtraction operator must be valid.

virtual ~NormalDelta() = default

Destructor.

virtual bool Evaluate(double const *const *parameters, double *residuals, double **jacobians) const

Compute the cost values/residuals, and optionally the Jacobians, using the provided variable/parameter values.