Public Types | Public Member Functions | Protected Attributes | List of all members
gtsam::LinearizedHessianFactor Class Reference

#include <LinearizedFactor.h>

Inheritance diagram for gtsam::LinearizedHessianFactor:
Inheritance graph
[legend]

Public Types

typedef LinearizedGaussianFactor Base
 
typedef SymmetricBlockMatrix::Block Block
 A block from the Hessian matrix. More...
 
typedef SymmetricBlockMatrix::Block::ColXpr Column
 A column containing the linear term h. More...
 
typedef SymmetricBlockMatrix::constBlock constBlock
 A block from the Hessian matrix (const version) More...
 
typedef SymmetricBlockMatrix::constBlock::ColXpr constColumn
 A column containing the linear term h (const version) More...
 
typedef std::shared_ptr< LinearizedHessianFactorshared_ptr
 
typedef LinearizedHessianFactor This
 
- Public Types inherited from gtsam::LinearizedGaussianFactor
typedef NonlinearFactor Base
 
typedef std::shared_ptr< LinearizedGaussianFactorshared_ptr
 
typedef LinearizedGaussianFactor This
 
- Public Types inherited from gtsam::NonlinearFactor
typedef std::shared_ptr< Thisshared_ptr
 
- Public Types inherited from gtsam::Factor
typedef KeyVector::const_iterator const_iterator
 Const iterator over keys. More...
 
typedef KeyVector::iterator iterator
 Iterator over keys. More...
 

Public Member Functions

gtsam::NonlinearFactor::shared_ptr clone () const override
 
double constantTerm () const
 
size_t dim () const override
 
bool equals (const NonlinearFactor &expected, double tol=1e-9) const override
 
double error (const Values &c) const override
 
std::shared_ptr< GaussianFactorlinearize (const Values &c) const override
 
 LinearizedHessianFactor ()
 
 LinearizedHessianFactor (const HessianFactor::shared_ptr &hessian, const Values &lin_points)
 
constColumn linearTerm (const_iterator j) const
 
constColumn linearTerm () const
 
void print (const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
 
Matrix squaredTerm (const_iterator j1, const_iterator j2) const
 
Eigen::SelfAdjointView< constBlock, Eigen::UppersquaredTerm () const
 
 ~LinearizedHessianFactor () override
 
- Public Member Functions inherited from gtsam::LinearizedGaussianFactor
const ValueslinearizationPoint () const
 
 LinearizedGaussianFactor ()=default
 
 LinearizedGaussianFactor (const GaussianFactor::shared_ptr &gaussian, const Values &lin_points)
 
 ~LinearizedGaussianFactor () override=default
 
- Public Member Functions inherited from gtsam::NonlinearFactor
 NonlinearFactor ()
 
template<typename CONTAINER >
 NonlinearFactor (const CONTAINER &keys)
 
double error (const HybridValues &c) const override
 
virtual bool active (const Values &) const
 
virtual shared_ptr rekey (const std::map< Key, Key > &rekey_mapping) const
 
virtual shared_ptr rekey (const KeyVector &new_keys) const
 
virtual bool sendable () const
 
- Public Member Functions inherited from gtsam::Factor
virtual ~Factor ()=default
 Default destructor. More...
 
bool empty () const
 Whether the factor is empty (involves zero variables). More...
 
Key front () const
 First key. More...
 
Key back () const
 Last key. More...
 
const_iterator find (Key key) const
 find More...
 
const KeyVectorkeys () const
 Access the factor's involved variable keys. More...
 
const_iterator begin () const
 
const_iterator end () const
 
size_t size () const
 
virtual void printKeys (const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const
 print only keys More...
 
bool equals (const This &other, double tol=1e-9) const
 check equality More...
 
KeyVectorkeys ()
 
iterator begin ()
 
iterator end ()
 

Protected Attributes

SymmetricBlockMatrix info_
 
- Protected Attributes inherited from gtsam::LinearizedGaussianFactor
Values lin_points_
 
- Protected Attributes inherited from gtsam::Factor
KeyVector keys_
 The keys involved in this factor. More...
 

Additional Inherited Members

- Protected Types inherited from gtsam::NonlinearFactor
typedef Factor Base
 
typedef NonlinearFactor This
 
- Protected Member Functions inherited from gtsam::Factor
 Factor ()
 
template<typename CONTAINER >
 Factor (const CONTAINER &keys)
 
template<typename ITERATOR >
 Factor (ITERATOR first, ITERATOR last)
 
- Static Protected Member Functions inherited from gtsam::Factor
template<typename CONTAINER >
static Factor FromKeys (const CONTAINER &keys)
 
template<typename ITERATOR >
static Factor FromIterators (ITERATOR first, ITERATOR last)
 

Detailed Description

A factor that takes a linear, Hessian factor and inserts it into a nonlinear graph.

Definition at line 172 of file LinearizedFactor.h.

Member Typedef Documentation

◆ Base

base type

Definition at line 176 of file LinearizedFactor.h.

◆ Block

A block from the Hessian matrix.

hessian block data types

Definition at line 183 of file LinearizedFactor.h.

◆ Column

A column containing the linear term h.

Definition at line 186 of file LinearizedFactor.h.

◆ constBlock

A block from the Hessian matrix (const version)

Definition at line 184 of file LinearizedFactor.h.

◆ constColumn

A column containing the linear term h (const version)

Definition at line 187 of file LinearizedFactor.h.

◆ shared_ptr

shared pointer for convenience

Definition at line 180 of file LinearizedFactor.h.

◆ This

Definition at line 177 of file LinearizedFactor.h.

Constructor & Destructor Documentation

◆ LinearizedHessianFactor() [1/2]

gtsam::LinearizedHessianFactor::LinearizedHessianFactor ( )

default constructor for serialization

Definition at line 137 of file LinearizedFactor.cpp.

◆ LinearizedHessianFactor() [2/2]

gtsam::LinearizedHessianFactor::LinearizedHessianFactor ( const HessianFactor::shared_ptr hessian,
const Values lin_points 
)

Use this constructor with the ordering used to linearize the graph

Parameters
hessianA hessian factor
lin_pointsThe linearization points for, at least, the variables used by this factor

Definition at line 141 of file LinearizedFactor.cpp.

◆ ~LinearizedHessianFactor()

gtsam::LinearizedHessianFactor::~LinearizedHessianFactor ( )
inlineoverride

Definition at line 206 of file LinearizedFactor.h.

Member Function Documentation

◆ clone()

gtsam::NonlinearFactor::shared_ptr gtsam::LinearizedHessianFactor::clone ( ) const
inlineoverridevirtual
Returns
a deep copy of this factor

Reimplemented from gtsam::NonlinearFactor.

Definition at line 209 of file LinearizedFactor.h.

◆ constantTerm()

double gtsam::LinearizedHessianFactor::constantTerm ( ) const
inline

Return the constant term $ f $ as described above

Returns
The constant term $ f $

Definition at line 224 of file LinearizedFactor.h.

◆ dim()

size_t gtsam::LinearizedHessianFactor::dim ( ) const
inlineoverridevirtual

get the dimension of the factor (number of rows on linearization)

Implements gtsam::NonlinearFactor.

Definition at line 268 of file LinearizedFactor.h.

◆ equals()

bool gtsam::LinearizedHessianFactor::equals ( const NonlinearFactor expected,
double  tol = 1e-9 
) const
overridevirtual

equals function with optional tolerance

Reimplemented from gtsam::NonlinearFactor.

Definition at line 161 of file LinearizedFactor.cpp.

◆ error()

double gtsam::LinearizedHessianFactor::error ( const Values c) const
overridevirtual

Calculate the error of the factor

Reimplemented from gtsam::NonlinearFactor.

Definition at line 180 of file LinearizedFactor.cpp.

◆ linearize()

std::shared_ptr< GaussianFactor > gtsam::LinearizedHessianFactor::linearize ( const Values c) const
overridevirtual

linearize to a GaussianFactor Reimplemented from NoiseModelFactor to directly copy out the matrices and only update the RHS b with an updated residual

Implements gtsam::NonlinearFactor.

Definition at line 203 of file LinearizedFactor.cpp.

◆ linearTerm() [1/2]

constColumn gtsam::LinearizedHessianFactor::linearTerm ( const_iterator  j) const
inline

Return the part of linear term $ g $ as described above corresponding to the requested variable.

Parameters
jWhich block row to get, as an iterator pointing to the slot in this factor. You can use, for example, begin() + 2 to get the 3rd variable in this factor.
Returns
The linear term $ g $

Definition at line 233 of file LinearizedFactor.h.

◆ linearTerm() [2/2]

constColumn gtsam::LinearizedHessianFactor::linearTerm ( ) const
inline

Return the complete linear term $ g $ as described above.

Returns
The linear term $ g $

Definition at line 239 of file LinearizedFactor.h.

◆ print()

void gtsam::LinearizedHessianFactor::print ( const std::string &  s = "",
const KeyFormatter keyFormatter = DefaultKeyFormatter 
) const
overridevirtual

print function

Reimplemented from gtsam::NonlinearFactor.

Definition at line 146 of file LinearizedFactor.cpp.

◆ squaredTerm() [1/2]

Matrix gtsam::LinearizedHessianFactor::squaredTerm ( const_iterator  j1,
const_iterator  j2 
) const
inline

Return a copy of the block at (j1,j2) of the upper-triangular part of the squared term $ H $, no data is copied. See HessianFactor class documentation above to explain that only the upper-triangular part of the information matrix is stored and returned by this function.

Parameters
j1Which block row to get, as an iterator pointing to the slot in this factor. You can use, for example, begin() + 2 to get the 3rd variable in this factor.
j2Which block column to get, as an iterator pointing to the slot in this factor. You can use, for example, begin() + 2 to get the 3rd variable in this factor.
Returns
A copy of the requested block.

Definition at line 253 of file LinearizedFactor.h.

◆ squaredTerm() [2/2]

Eigen::SelfAdjointView<constBlock, Eigen::Upper> gtsam::LinearizedHessianFactor::squaredTerm ( ) const
inline

Return the upper-triangular part of the full squared term, as described above. See HessianFactor class documentation above to explain that only the upper-triangular part of the information matrix is stored and returned by this function.

Definition at line 263 of file LinearizedFactor.h.

Member Data Documentation

◆ info_

SymmetricBlockMatrix gtsam::LinearizedHessianFactor::info_
protected

The block view of the full information matrix, s.t. the quadratic error is 0.5*[x -1]'H[x -1]

Definition at line 191 of file LinearizedFactor.h.


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


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:46:22