gtsam  3.2.1
gtsam
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gtsam::ImplicitSchurFactor< D > Class Template Reference

Detailed Description

template<size_t D>
class gtsam::ImplicitSchurFactor< D >

ImplicitSchurFactor.

+ Inheritance diagram for gtsam::ImplicitSchurFactor< D >:

Public Member Functions

 ImplicitSchurFactor ()
 Constructor.
 
 ImplicitSchurFactor (const std::vector< KeyMatrix2D > &Fblocks, const Matrix &E, const Matrix3 &P, const Vector &b)
 Construct from blcoks of F, E, inv(E'*E), and RHS vector b.
 
void initKeys ()
 initialize keys from Fblocks
 
virtual ~ImplicitSchurFactor ()
 Destructor.
 
std::vector< KeyMatrix2D > & Fblocks ()
 
Matrix3 & PointCovariance ()
 
Matrix & E ()
 
Vector & b ()
 
const Matrix3 & getPointCovariance () const
 Get matrix P.
 
void print (const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
 print
 
bool equals (const GaussianFactor &lf, double tol) const
 equals
 
virtual DenseIndex getDim (const_iterator variable) const
 Degrees of freedom of camera.
 
virtual Matrix augmentedJacobian () const
 Return a dense \( [ \;A\;b\; ] \in \mathbb{R}^{m \times n+1} \) Jacobian matrix, augmented with b with the noise models baked into A and b. More...
 
virtual std::pair< Matrix, Vector > jacobian () const
 Return the dense Jacobian \( A \) and right-hand-side \( b \), with the noise models baked into A and b. More...
 
virtual Matrix augmentedInformation () const
 Return the augmented information matrix represented by this GaussianFactor. More...
 
virtual Matrix information () const
 Return the non-augmented information matrix represented by this GaussianFactor.
 
virtual VectorValues hessianDiagonal () const
 Return the diagonal of the Hessian for this factor.
 
void hessianDiagonal (double *d) const
 add the contribution of this factor to the diagonal of the hessian d(output) = d(input) + deltaHessianFactor
 
virtual std::map< Key, Matrix > hessianBlockDiagonal () const
 Return the block diagonal of the Hessian for this factor.
 
virtual GaussianFactor::shared_ptr clone () const
 Clone a factor (make a deep copy)
 
virtual bool empty () const
 Test whether the factor is empty.
 
virtual GaussianFactor::shared_ptr negate () const
 Construct the corresponding anti-factor to negate information stored stored in this factor. More...
 
void projectError2 (const Error2s &e1, Error2s &e2) const
 Calculate corrected error Q*(e-2*b) = (I - E*P*E')*(e-2*b)
 
virtual double error (const VectorValues &x) const
 Print for testable.
 
double errorJF (const VectorValues &x) const
 
void projectError (const Error2s &e1, Error2s &e2) const
 Calculate corrected error Q*e = (I - E*P*E')*e.
 
void multiplyHessianAdd (double alpha, const double *x, double *y) const
 double* Hessian-vector multiply, i.e. More...
 
void multiplyHessianAdd (double alpha, const double *x, double *y, std::vector< size_t > keys) const
 y += alpha * A'*A*x
 
void multiplyHessianAdd (double alpha, const VectorValues &x, VectorValues &y) const
 Hessian-vector multiply, i.e. More...
 
void multiplyHessianDummy (double alpha, const VectorValues &x, VectorValues &y) const
 Dummy version to measure overhead of key access.
 
VectorValues gradientAtZero () const
 Calculate gradient, which is -F'Q*b, see paper.
 
void gradientAtZero (double *d) const
 Calculate gradient, which is -F'Q*b, see paper - RAW MEMORY ACCESS.
 
- Public Member Functions inherited from gtsam::GaussianFactor
 GaussianFactor ()
 Default constructor creates empty factor.
 
template<typename CONTAINER >
 GaussianFactor (const CONTAINER &keys)
 Construct from container of keys. More...
 
virtual ~GaussianFactor ()
 Destructor.
 
- Public Member Functions inherited from gtsam::Factor
Key front () const
 First key.
 
Key back () const
 Last key.
 
const_iterator find (Key key) const
 find
 
const FastVector< Key > & keys () const
 Access the factor's involved variable keys.
 
const_iterator begin () const
 Iterator at beginning of involved variable keys.
 
const_iterator end () const
 Iterator at end of involved variable keys.
 
size_t size () const
 
void print (const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const
 print
 
void printKeys (const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const
 print only keys
 
FastVector< Key > & keys ()
 
iterator begin ()
 Iterator at beginning of involved variable keys.
 
iterator end ()
 Iterator at end of involved variable keys.
 

Static Public Member Functions

static void multiplyHessianAdd (const Matrix &F, const Matrix &E, const Matrix &PointCovariance, double alpha, const Vector &x, Vector &y)
 

Public Attributes

Error2s e1
 Scratch space for multiplyHessianAdd.
 
Error2s e2
 

Public Types

typedef ImplicitSchurFactor This
 Typedef to this class.
 
typedef boost::shared_ptr< Thisshared_ptr
 shared_ptr to this class
 
typedef std::vector< Vector2 > Error2s
 
- Public Types inherited from gtsam::GaussianFactor
typedef GaussianFactor This
 This class.
 
typedef boost::shared_ptr< Thisshared_ptr
 shared_ptr to this class
 
typedef Factor Base
 Our base class.
 
- Public Types inherited from gtsam::Factor
typedef FastVector< Key >::iterator iterator
 Iterator over keys.
 
typedef FastVector< Key >
::const_iterator 
const_iterator
 Const iterator over keys.
 

Protected Types

typedef Eigen::Matrix< double,
2, D > 
Matrix2D
 type of an F block
 
typedef Eigen::Matrix< double, 2, 3 > Matrix23
 
typedef Eigen::Matrix< double,
D, D > 
MatrixDD
 camera hessian
 
typedef std::pair< Key, Matrix2DKeyMatrix2D
 named F block
 

Protected Attributes

std::vector< KeyMatrix2DFblocks_
 All 2*D F blocks (one for each camera)
 
Matrix3 PointCovariance_
 the 3*3 matrix P = inv(E'E) (2*2 if degenerate)
 
Matrix E_
 The 2m*3 E Jacobian with respect to the point.
 
Vector b_
 2m-dimensional RHS vector
 
- Protected Attributes inherited from gtsam::Factor
FastVector< Keykeys_
 The keys involved in this factor.
 

Member Function Documentation

template<size_t D>
virtual Matrix gtsam::ImplicitSchurFactor< D >::augmentedInformation ( ) const
inlinevirtual

Return the augmented information matrix represented by this GaussianFactor.

The augmented information matrix contains the information matrix with an additional column holding the information vector, and an additional row holding the transpose of the information vector. The lower-right entry contains the constant error term (when \( \delta x = 0 \)). The augmented information matrix is described in more detail in HessianFactor, which in fact stores an augmented information matrix.

Implements gtsam::GaussianFactor.

template<size_t D>
virtual Matrix gtsam::ImplicitSchurFactor< D >::augmentedJacobian ( ) const
inlinevirtual

Return a dense \( [ \;A\;b\; ] \in \mathbb{R}^{m \times n+1} \) Jacobian matrix, augmented with b with the noise models baked into A and b.

The negative log-likelihood is \( \frac{1}{2} \Vert Ax-b \Vert^2 \). See also GaussianFactorGraph::jacobian and GaussianFactorGraph::sparseJacobian.

Implements gtsam::GaussianFactor.

template<size_t D>
virtual std::pair<Matrix, Vector> gtsam::ImplicitSchurFactor< D >::jacobian ( ) const
inlinevirtual

Return the dense Jacobian \( A \) and right-hand-side \( b \), with the noise models baked into A and b.

The negative log-likelihood is \( \frac{1}{2} \Vert Ax-b \Vert^2 \). See also GaussianFactorGraph::augmentedJacobian and GaussianFactorGraph::sparseJacobian.

Implements gtsam::GaussianFactor.

template<size_t D>
void gtsam::ImplicitSchurFactor< D >::multiplyHessianAdd ( double  alpha,
const double *  x,
double *  y 
) const
inlinevirtual

double* Hessian-vector multiply, i.e.

y += F'alpha(I - E*P*E')*F*x RAW memory access! Assumes keys start at 0 and go to M-1, and x and and y are laid out that way

Implements gtsam::GaussianFactor.

template<size_t D>
void gtsam::ImplicitSchurFactor< D >::multiplyHessianAdd ( double  alpha,
const VectorValues x,
VectorValues y 
) const
inlinevirtual

Hessian-vector multiply, i.e.

y += F'alpha(I - E*P*E')*F*x

Implements gtsam::GaussianFactor.

template<size_t D>
virtual GaussianFactor::shared_ptr gtsam::ImplicitSchurFactor< D >::negate ( ) const
inlinevirtual

Construct the corresponding anti-factor to negate information stored stored in this factor.

Returns
a HessianFactor with negated Hessian matrices

Implements gtsam::GaussianFactor.


The documentation for this class was generated from the following file: