38 typedef boost::shared_ptr<LinearizedGaussianFactor>
shared_ptr;
59 const Values& linearizationPoint()
const {
return lin_points_; }
63 friend class boost::serialization::access;
64 template<
class ARCHIVE>
65 void serialize(ARCHIVE & ar,
const unsigned int ) {
66 ar & boost::serialization::make_nvp(
"LinearizedGaussianFactor",
67 boost::serialization::base_object<Base>(*
this));
68 ar & BOOST_SERIALIZATION_NVP(lin_points_);
85 typedef boost::shared_ptr<LinearizedJacobianFactor>
shared_ptr;
87 typedef VerticalBlockMatrix::Block ABlock;
88 typedef VerticalBlockMatrix::constBlock constABlock;
89 typedef VerticalBlockMatrix::Block::ColXpr BVector;
90 typedef VerticalBlockMatrix::constBlock::ConstColXpr constBVector;
115 virtual gtsam::NonlinearFactor::shared_ptr
clone()
const {
116 return boost::static_pointer_cast<gtsam::NonlinearFactor>(
117 gtsam::NonlinearFactor::shared_ptr(
new This(*
this))); }
122 virtual void print(
const std::string& s=
"",
const KeyFormatter& keyFormatter = DefaultKeyFormatter)
const;
128 const constBVector b()
const {
return Ab_(size()).col(0); }
129 const constABlock A()
const {
return Ab_.
range(0, size()); };
130 const constABlock A(
Key key)
const {
return Ab_(std::find(begin(), end(), key) - begin()); }
136 double error(
const Values& c)
const;
143 boost::shared_ptr<GaussianFactor> linearize(
const Values& c)
const;
146 Vector error_vector(
const Values& c)
const;
150 friend class boost::serialization::access;
151 template<
class ARCHIVE>
152 void serialize(ARCHIVE & ar,
const unsigned int ) {
153 ar & boost::serialization::make_nvp(
"LinearizedJacobianFactor",
154 boost::serialization::base_object<Base>(*
this));
155 ar & BOOST_SERIALIZATION_NVP(Ab_);
176 typedef boost::shared_ptr<LinearizedHessianFactor>
shared_ptr;
179 typedef SymmetricBlockMatrix::Block
Block;
182 typedef SymmetricBlockMatrix::Block::ColXpr
Column;
205 virtual gtsam::NonlinearFactor::shared_ptr
clone()
const {
206 return boost::static_pointer_cast<gtsam::NonlinearFactor>(
207 gtsam::NonlinearFactor::shared_ptr(
new This(*
this))); }
212 virtual void print(
const std::string& s=
"",
const KeyFormatter& keyFormatter = DefaultKeyFormatter)
const;
252 return info_.
block(J1, J2);
259 Eigen::SelfAdjointView<constBlock, Eigen::Upper>
squaredTerm()
const {
264 size_t dim()
const {
return info_.
rows() - 1; }
267 double error(
const Values& c)
const;
274 boost::shared_ptr<GaussianFactor> linearize(
const Values& c)
const;
278 friend class boost::serialization::access;
279 template<
class ARCHIVE>
280 void serialize(ARCHIVE & ar,
const unsigned int ) {
281 ar & boost::serialization::make_nvp(
"LinearizedHessianFactor",
282 boost::serialization::base_object<Base>(*
this));
283 ar & BOOST_SERIALIZATION_NVP(info_);
NonlinearFactor Base
base type
Definition: LinearizedFactor.h:34
constColumn linearTerm(const_iterator j) const
Return the part of linear term as described above corresponding to the requested variable.
Definition: LinearizedFactor.h:229
This is the base class for all factor types.
Definition: Factor.h:54
boost::shared_ptr< LinearizedHessianFactor > shared_ptr
shared pointer for convenience
Definition: LinearizedFactor.h:176
A non-templated config holding any types of Manifold-group elements.
Definition: Values.h:70
ptrdiff_t DenseIndex
The index type for Eigen objects.
Definition: types.h:63
A factor that takes a linear, Jacobian factor and inserts it into a nonlinear graph.
Definition: LinearizedFactor.h:77
Eigen::SelfAdjointView< constBlock, Eigen::Upper > squaredTerm() const
Return the <emph>upper-triangular part</emph> of the full squared term, as described above.
Definition: LinearizedFactor.h:259
constColumn linearTerm() const
Return the complete linear term as described above.
Definition: LinearizedFactor.h:235
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:141
boost::shared_ptr< This > shared_ptr
shared_ptr to this class
Definition: JacobianFactor.h:93
SymmetricBlockMatrix::Block Block
hessian block data types
Definition: LinearizedFactor.h:179
virtual gtsam::NonlinearFactor::shared_ptr clone() const
Definition: LinearizedFactor.h:205
Block range(DenseIndex startBlock, DenseIndex endBlock)
access ranges of blocks at a time
Definition: VerticalBlockMatrix.h:129
A factor that takes a linear, Hessian factor and inserts it into a nonlinear graph.
Definition: LinearizedFactor.h:168
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:57
DenseIndex rows() const
Row size.
Definition: SymmetricBlockMatrix.h:119
A base factor class for the Jacobian and Hessian linearized factors.
Definition: LinearizedFactor.h:31
Template to create a binary predicate.
Definition: Testable.h:110
size_t dim() const
get the dimension of the factor (number of rows on linearization)
Definition: LinearizedFactor.h:264
boost::shared_ptr< This > shared_ptr
A shared_ptr to this class.
Definition: HessianFactor.h:110
A helper that implements the traits interface for GTSAM types.
Definition: Testable.h:150
boost::shared_ptr< LinearizedJacobianFactor > shared_ptr
shared pointer for convenience
Definition: LinearizedFactor.h:85
Definition: VerticalBlockMatrix.h:41
boost::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:33
Eigen::SelfAdjointView< constBlock, Eigen::Upper > selfadjointView(DenseIndex I, DenseIndex J) const
Return the square sub-matrix that contains blocks(i:j, i:j).
Definition: SymmetricBlockMatrix.h:161
Nonlinear factor base class.
Definition: NonlinearFactor.h:50
SymmetricBlockMatrix info_
The block view of the full information matrix, s.t.
Definition: LinearizedFactor.h:187
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.
Definition: SymmetricBlockMatrix.h:175
Values lin_points_
linearization points for error calculation
Definition: LinearizedFactor.h:43
LinearizedGaussianFactor Base
base type
Definition: LinearizedFactor.h:172
SymmetricBlockMatrix::constBlock::ColXpr constColumn
A column containing the linear term h (const version)
Definition: LinearizedFactor.h:183
SymmetricBlockMatrix::Block::ColXpr Column
A column containing the linear term h.
Definition: LinearizedFactor.h:182
size_t dim() const
get the dimension of the factor (number of rows on linearization)
Definition: LinearizedFactor.h:133
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
Eigen::SelfAdjointView< Block, Eigen::Upper > diagonalBlock(DenseIndex J)
Return the J'th diagonal block as a self adjoint view.
Definition: SymmetricBlockMatrix.h:140
LinearizedGaussianFactor Base
base type
Definition: LinearizedFactor.h:81
Non-linear factor base classes.
Contains the HessianFactor class, a general quadratic factor.
Matrix squaredTerm(const_iterator j1, const_iterator j2) const
Return a copy of the block at (j1,j2) of the <emph>upper-triangular part</emph> of the squared term ,...
Definition: LinearizedFactor.h:249
Definition: SymmetricBlockMatrix.h:51
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
DenseIndex rows() const
Row size.
Definition: VerticalBlockMatrix.h:114
Matrix block(DenseIndex I, DenseIndex J) const
Get a copy of a block (anywhere in the matrix).
Definition: SymmetricBlockMatrix.cpp:54
virtual gtsam::NonlinearFactor::shared_ptr clone() const
Definition: LinearizedFactor.h:115
SymmetricBlockMatrix::constBlock constBlock
A block from the Hessian matrix (const version)
Definition: LinearizedFactor.h:180
KeyVector::const_iterator const_iterator
Const iterator over keys.
Definition: Factor.h:67
LinearizedGaussianFactor()
default constructor for serialization
Definition: LinearizedFactor.h:48
double constantTerm() const
Return the constant term as described above.
Definition: LinearizedFactor.h:220
boost::shared_ptr< LinearizedGaussianFactor > shared_ptr
shared pointer for convenience
Definition: LinearizedFactor.h:38
Symbols for exporting classes and methods from DLLs.
boost::shared_ptr< This > shared_ptr
shared_ptr to this class
Definition: GaussianFactor.h:42