26 #include <boost/make_shared.hpp> 34 class GaussianConditional;
35 class GaussianBayesNet;
36 class GaussianFactorGraph;
163 const std::vector<Vector>& gs,
double f);
167 template<
typename KEYS>
190 return boost::make_shared<HessianFactor>(*this); }
193 void print(
const std::string&
s =
"",
211 return info_.
getDim(std::distance(begin(), variable));
286 Matrix augmentedInformation()
const override;
294 Matrix information()
const override;
300 using Base::hessianDiagonal;
303 void hessianDiagonal(
double* d)
const override;
306 std::map<Key,Matrix> hessianBlockDiagonal()
const override;
309 std::pair<Matrix, Vector> jacobian()
const override;
316 Matrix augmentedJacobian()
const override;
340 void gradientAtZero(
double* d)
const override;
352 boost::shared_ptr<GaussianConditional> eliminateCholesky(
const Ordering& keys);
359 void Allocate(
const Scatter& scatter);
368 friend class boost::serialization::access;
369 template<
class ARCHIVE>
372 ar & BOOST_SERIALIZATION_NVP(info_);
392 GTSAM_EXPORT std::pair<boost::shared_ptr<GaussianConditional>, boost::shared_ptr<HessianFactor> >
410 GTSAM_EXPORT std::pair<boost::shared_ptr<GaussianConditional>, boost::shared_ptr<GaussianFactor> >
void print(const Matrix &A, const string &s, ostream &stream)
SymmetricBlockMatrix::constBlock linearTerm() const
Access to matrices via blocks of pre-defined sizes. Used in GaussianFactor and GaussianConditional.
SymmetricBlockMatrix & info()
JacobiRotation< float > G
SymmetricBlockMatrix::constBlock linearTerm(const_iterator j) const
A factor with a quadratic error function - a Gaussian.
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set view
GaussianFactor::shared_ptr clone() const override
GaussianFactor Base
Typedef to base class.
KeyVector keys_
The keys involved in this factor.
GaussianFactorGraph factors(list_of(factor1)(factor2)(factor3))
SymmetricBlockMatrix::constBlock constBlock
A block from the Hessian matrix (const version)
static const KeyFormatter DefaultKeyFormatter
std::pair< boost::shared_ptr< GaussianConditional >, boost::shared_ptr< GaussianFactor > > EliminatePreferCholesky(const GaussianFactorGraph &factors, const Ordering &keys)
ptrdiff_t DenseIndex
The index type for Eigen objects.
void g(const string &key, int i)
const KeyFormatter & formatter
HessianFactor This
Typedef to this class.
const SymmetricBlockMatrix & info() const
Return underlying information matrix.
void serialize(ARCHIVE &ar, const unsigned int)
double constantTerm() const
std::pair< boost::shared_ptr< GaussianConditional >, boost::shared_ptr< HessianFactor > > EliminateCholesky(const GaussianFactorGraph &factors, const Ordering &keys)
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
~HessianFactor() override
bool empty() const override
boost::shared_ptr< This > shared_ptr
A shared_ptr to this class.
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Expression of a selfadjoint matrix from a triangular part of a dense matrix.
constBlock aboveDiagonalBlock(DenseIndex I, DenseIndex J) const
Get block above the diagonal (I, J).
SymmetricBlockMatrix::Block Block
A block from the Hessian matrix.
SymmetricBlockMatrix info_
The full augmented information matrix, s.t. the quadratic error is 0.5*[x -1]'H[x -1]...
boost::shared_ptr< This > shared_ptr
shared_ptr to this class
Maps global variable indices to slot indices.
A thin wrapper around std::vector that uses a custom allocator.
constBlock aboveDiagonalRange(DenseIndex i_startBlock, DenseIndex i_endBlock, DenseIndex j_startBlock, DenseIndex j_endBlock) const
Get a range [i,j) from the matrix. Indices are in block units.
Expression of a fixed-size or dynamic-size block.
SymmetricBlockMatrix::Block linearTerm()
void updateHessian(HessianFactor *other) const
Pose3 g1(Rot3(), Point3(100.0, 0.0, 300.0))
A Gaussian factor using the canonical parameters (information form)
DenseIndex getDim(const_iterator variable) const override
Contains the HessianFactor class, a general quadratic factor.
DenseIndex getDim(DenseIndex block) const
Number of dimensions for variable on this diagonal block.
Eigen::SelfAdjointView< Block, Eigen::Upper > diagonalBlock(DenseIndex J)
Return the J'th diagonal block as a self adjoint view.
KeyVector::const_iterator const_iterator
Const iterator over keys.
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Pose3 g2(g1.expmap(h *V1_g1))
HessianFactor(const GaussianFactorGraph &factors)
DenseIndex rows() const
Row size.
std::uint64_t Key
Integer nonlinear key type.