GTSAM
4.0.2
C++ library for smoothing and mapping (SAM)
|
#include <GaussianFactor.h>
Public Types | |
typedef GaussianFactor | This |
This class. | |
typedef std::shared_ptr< This > | shared_ptr |
shared_ptr to this class | |
typedef Factor | Base |
Our base class. | |
typedef KeyVector::iterator | iterator |
Iterator over keys. | |
typedef KeyVector::const_iterator | const_iterator |
Const iterator over keys. | |
Public Member Functions | |
Standard Constructors | |
GaussianFactor () | |
template<typename CONTAINER > | |
GaussianFactor (const CONTAINER &keys) | |
Testable | |
void | print (const std::string &s="", const KeyFormatter &formatter=DefaultKeyFormatter) const override=0 |
print with optional string | |
virtual bool | equals (const GaussianFactor &lf, double tol=1e-9) const =0 |
assert equality up to a tolerance | |
Standard Interface | |
virtual double | error (const VectorValues &c) const |
double | error (const HybridValues &c) const override |
virtual DenseIndex | getDim (const_iterator variable) const =0 |
virtual Matrix | augmentedJacobian () const =0 |
virtual std::pair< Matrix, Vector > | jacobian () const =0 |
virtual Matrix | augmentedInformation () const =0 |
virtual Matrix | information () const =0 |
VectorValues | hessianDiagonal () const |
Return the diagonal of the Hessian for this factor. | |
virtual void | hessianDiagonalAdd (VectorValues &d) const =0 |
Add the current diagonal to a VectorValues instance. | |
virtual void | hessianDiagonal (double *d) const =0 |
Raw memory access version of hessianDiagonal. | |
virtual std::map< Key, Matrix > | hessianBlockDiagonal () const =0 |
Return the block diagonal of the Hessian for this factor. | |
virtual GaussianFactor::shared_ptr | clone () const =0 |
virtual GaussianFactor::shared_ptr | negate () const =0 |
virtual void | updateHessian (const KeyVector &keys, SymmetricBlockMatrix *info) const =0 |
Operator interface | |
virtual void | multiplyHessianAdd (double alpha, const VectorValues &x, VectorValues &y) const =0 |
y += alpha * A'*A*x | |
virtual VectorValues | gradientAtZero () const =0 |
A'*b for Jacobian, eta for Hessian. | |
virtual void | gradientAtZero (double *d) const =0 |
Raw memory access version of gradientAtZero. | |
virtual Vector | gradient (Key key, const VectorValues &x) const =0 |
Gradient wrt a key at any values. | |
Standard Interface | |
bool | empty () const |
Whether the factor is empty (involves zero variables). | |
Key | front () const |
First key. | |
Key | back () const |
Last key. | |
const_iterator | find (Key key) const |
find | |
const KeyVector & | keys () const |
Access the factor's involved variable keys. | |
const_iterator | begin () const |
const_iterator | end () const |
size_t | size () const |
Advanced Interface | |
KeyVector & | keys () |
iterator | begin () |
iterator | end () |
Testable | |
virtual void | printKeys (const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const |
print only keys | |
bool | equals (const This &other, double tol=1e-9) const |
check equality | |
Static Public Member Functions | |
Advanced Interface | |
template<typename CONTAINER > | |
static DenseIndex | Slot (const CONTAINER &keys, Key key) |
Static Protected Member Functions | |
Standard Constructors | |
template<typename CONTAINER > | |
static Factor | FromKeys (const CONTAINER &keys) |
template<typename ITERATOR > | |
static Factor | FromIterators (ITERATOR first, ITERATOR last) |
Protected Attributes | |
KeyVector | keys_ |
The keys involved in this factor. | |
An abstract virtual base class for JacobianFactor and HessianFactor. A GaussianFactor has a quadratic error function. GaussianFactor is non-mutable (all methods const!). The factor value is exp(-0.5*||Ax-b||^2)
|
inline |
Default constructor creates empty factor
|
inline |
Construct from container of keys. This constructor is used internally from derived factor constructors, either from a container of keys or from a boost::assign::list_of.
|
pure virtual |
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.
Implemented in gtsam::HessianFactor, gtsam::JacobianFactor, and gtsam::RegularImplicitSchurFactor< CAMERA >.
|
pure virtual |
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.
Implemented in gtsam::HessianFactor, gtsam::JacobianFactor, and gtsam::RegularImplicitSchurFactor< CAMERA >.
|
inlineinherited |
Iterator at beginning of involved variable keys
|
inlineinherited |
Iterator at beginning of involved variable keys
|
pure virtual |
Clone a factor (make a deep copy)
Implemented in gtsam::RegularImplicitSchurFactor< CAMERA >, gtsam::JacobianFactor, gtsam::HessianFactor, gtsam::LinearInequality, gtsam::LinearEquality, and gtsam::LinearCost.
|
inlineinherited |
Iterator at end of involved variable keys
|
inlineinherited |
Iterator at end of involved variable keys
|
overridevirtual |
All factor types need to implement an error function. In factor graphs, this is the negative log-likelihood.
Reimplemented from gtsam::Factor.
|
inlinestaticprotectedinherited |
Construct factor from iterator keys. This is called internally from derived factor static factor methods, as a workaround for not being able to call the protected constructors above.
|
inlinestaticprotectedinherited |
Construct factor from container of keys. This is called internally from derived factor static factor methods, as a workaround for not being able to call the protected constructors above.
|
pure virtual |
Return the dimension of the variable pointed to by the given key iterator
Implemented in gtsam::JacobianFactor, gtsam::HessianFactor, and gtsam::RegularImplicitSchurFactor< CAMERA >.
|
pure virtual |
Return the non-augmented information matrix represented by this GaussianFactor.
Implemented in gtsam::HessianFactor, gtsam::JacobianFactor, and gtsam::RegularImplicitSchurFactor< CAMERA >.
|
pure virtual |
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.
Implemented in gtsam::HessianFactor, gtsam::JacobianFactor, and gtsam::RegularImplicitSchurFactor< CAMERA >.
|
inlineinherited |
|
pure virtual |
Construct the corresponding anti-factor to negate information stored stored in this factor.
Implemented in gtsam::JacobianFactor, gtsam::RegularImplicitSchurFactor< CAMERA >, and gtsam::HessianFactor.
|
inlineinherited |
|
pure virtual |
Update an information matrix by adding the information corresponding to this factor (used internally during elimination).
scatter | A mapping from variable index to slot index in this HessianFactor |
info | The information matrix to be updated |
Implemented in gtsam::HessianFactor, gtsam::JacobianFactor, gtsam::RegularImplicitSchurFactor< CAMERA >, and gtsam::BinaryJacobianFactor< M, N1, N2 >.