Common interface for compact batch Jacobian factors.
BatchJacobianFactorBase gives solvers a way to recognize compact batched Jacobian storage without treating it as a regular dense-block JacobianFactor. Generic GaussianFactor methods keep working through toJacobianFactor(), while the internal elimination adapter can access the compact storage without materializing structural zeros.
The intended fast path is a factor whose row blocks have already been whitened and therefore has either no model or a unit model. Non-unit diagonal models are still supported for compatibility paths.
|
| virtual size_t | rows () const =0 |
| | Number of scalar rows represented by this factor.
|
| virtual const SharedDiagonal & | get_model () const =0 |
| | Optional model on the compact factor. The intended fast path is whitened.
|
| virtual JacobianFactor | toJacobianFactor () const =0 |
| | Convert compact storage to a dense-block JacobianFactor.
|
| void | print (const std::string &s="", const KeyFormatter &formatter=DefaultKeyFormatter) const override |
| | Print this compact factor by converting to a JacobianFactor.
|
| bool | equals (const GaussianFactor &factor, double tol=1e-9) const override |
| | Test equality by comparing dense JacobianFactor representations.
|
| double | error (const VectorValues &values) const override |
| | Compute the factor error by delegating to the dense compatibility factor.
|
| double | deltaError (const VectorValues &values, double *oldError=nullptr, double *newError=nullptr) const override |
| | Compute the error change by delegating to the dense compatibility factor.
|
| Matrix | augmentedJacobian () const override |
| | Return the dense augmented Jacobian matrix for compatibility callers.
|
| std::pair< Matrix, Vector > | jacobian () const override |
| | Return the dense Jacobian matrix and right-hand side vector.
|
| Matrix | augmentedInformation () const override |
| | Return the dense augmented information matrix for compatibility callers.
|
| Matrix | information () const override |
| | Return the dense information matrix for compatibility callers.
|
| void | hessianDiagonalAdd (VectorValues &diagonal) const override |
| | Add this factor's Hessian diagonal into the given VectorValues.
|
| void | hessianDiagonal (double *diagonal) const override |
| | Add this factor's Hessian diagonal into a raw scalar buffer.
|
| std::map< Key, Matrix > | hessianBlockDiagonal () const override |
| | Return the Hessian diagonal blocks keyed by variable.
|
| GaussianFactor::shared_ptr | negate () const override |
| | Return a factor representing the negated linear system.
|
| void | updateHessian (const KeyVector &keys, SymmetricBlockMatrix *info) const override |
| | Update the augmented Hessian using key lookup through the dense fallback.
|
| virtual void | multiplyHessianAdd (double alpha, const std::vector< size_t > &scalarOffsets, const double *x, double *y) const override |
| | Add this factor's Hessian-vector product using scalar offsets for keys().
|
| virtual void | gradientAtZeroAdd (const std::vector< size_t > &scalarOffsets, double *gradient) const override |
| | Add this factor's gradient at zero to a flat vector.
|
| virtual void | hessianBlockDiagonalAdd (const std::vector< size_t > &blockSlots, std::vector< Matrix > *diagonalBlocks) const override |
| | Add this factor's Hessian diagonal to ordered blocks.
|
| void | updateHessian (const KeyVector &keys, SymmetricBlockMatrix *info, DenseIndex beginCol, DenseIndex endCol) const override |
| | Update a column range of the augmented Hessian using the dense fallback.
|
| void | multiplyHessianAdd (double alpha, const VectorValues &x, VectorValues &y) const override |
| | Add the Hessian-vector product into y using the dense fallback.
|
| VectorValues | gradientAtZero () const override |
| | Return the full gradient evaluated at zero.
|
| void | gradientAtZero (double *d) const override |
| | Add the gradient evaluated at zero into a raw scalar buffer.
|
| Vector | gradient (Key key, const VectorValues &x) const override |
| | Return the gradient block for one key at the given linearization point.
|
|
| GaussianFactor () |
| | Inherit GaussianFactor constructors.
|
|
template<typename CONTAINER> |
| | GaussianFactor (const CONTAINER &keys) |
| | Inherit GaussianFactor constructors.
|
|
| GaussianFactor () |
| | Default constructor creates empty factor.
|
| template<typename CONTAINER> |
| | GaussianFactor (const CONTAINER &keys) |
| | Construct from container of keys.
|
| double | error (const HybridValues &c) const override |
| | All factor types need to implement an error function.
|
| virtual DenseIndex | getDim (const_iterator variable) const =0 |
| | Return the dimension of the variable pointed to by the given key iterator.
|
|
VectorValues | hessianDiagonal () const |
| | Return the diagonal of the Hessian for this factor.
|
| virtual GaussianFactor::shared_ptr | clone () const =0 |
| | Clone a factor (make a deep copy).
|
| virtual bool | isJacobian () const |
| | Fast check for JacobianFactor-based types.
|
|
virtual | ~Factor ()=default |
| | Default destructor.
|
|
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 |
| | Iterator at beginning of involved variable keys.
|
|
const_iterator | end () const |
| | Iterator at end of involved variable keys.
|
| size_t | size () const |
| 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
|
| KeyVector & | keys () |
|
iterator | begin () |
| | Iterator at beginning of involved variable keys.
|
|
iterator | end () |
| | Iterator at end of involved variable keys.
|
|
|
template<typename CONTAINER> |
| static DenseIndex | Slot (const CONTAINER &keys, Key key) |
|
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.
|
|
| Factor () |
| | Default constructor for I/O.
|
| template<typename CONTAINER> |
| | Factor (const CONTAINER &keys) |
| | Construct factor from container of keys.
|
| template<typename ITERATOR> |
| | Factor (ITERATOR first, ITERATOR last) |
| | Construct factor from iterator keys.
|
| template<typename CONTAINER> |
| static Factor | FromKeys (const CONTAINER &keys) |
| | Construct factor from container of keys.
|
| template<typename ITERATOR> |
| static Factor | FromIterators (ITERATOR first, ITERATOR last) |
| | Construct factor from iterator keys.
|
|
KeyVector | keys_ |
| | The keys involved in this factor.
|