Go to the documentation of this file.
27 #if GTSAM_ENABLE_BOOST_SERIALIZATION
28 #include <boost/serialization/version.hpp>
29 #include <boost/serialization/split_member.hpp>
37 class GaussianFactorGraph;
49 GTSAM_EXPORT std::pair<std::shared_ptr<GaussianConditional>, std::shared_ptr<JacobianFactor> >
145 template<
typename TERMS>
151 template <
typename KEYS>
156 template <
typename KEYS>
197 return std::static_pointer_cast<GaussianFactor>(
198 std::make_shared<JacobianFactor>(*
this));
202 void print(
const std::string&
s =
"",
223 Matrix augmentedInformation()
const override;
228 Matrix information()
const override;
231 using Base::hessianDiagonal;
237 void hessianDiagonal(
double*
d)
const override;
240 std::map<Key,Matrix> hessianBlockDiagonal()
const override;
245 std::pair<Matrix, Vector> jacobian()
const override;
250 std::pair<Matrix, Vector> jacobianUnweighted()
const;
255 Matrix augmentedJacobian()
const override;
260 Matrix augmentedJacobianUnweighted()
const;
277 return model_ && model_->isConstrained();
284 return Ab_(variable - begin()).
cols();
339 void transposeMultiplyAdd(
double alpha,
const Vector&
e,
354 void multiplyHessianAdd(
double alpha,
const double*
x,
double*
y,
355 const std::vector<size_t>& accumulatedDims)
const;
361 void gradientAtZero(
double*
d)
const override;
370 std::pair<std::shared_ptr<GaussianConditional>, shared_ptr>
374 void setModel(
bool anyConstrained,
const Vector&
sigmas);
387 friend GTSAM_EXPORT std::pair<std::shared_ptr<GaussianConditional>, shared_ptr>
397 std::shared_ptr<GaussianConditional> splitConditional(
size_t nrFrontals);
402 template<
typename TERMS>
415 void JacobianFactorHelper(
425 template<
class KEYS,
class DIMENSIONS>
434 #if GTSAM_ENABLE_BOOST_SERIALIZATION
436 friend class boost::serialization::access;
437 template<
class ARCHIVE>
438 void save(ARCHIVE & ar,
const unsigned int version)
const {
443 ar << BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Base);
444 ar << BOOST_SERIALIZATION_NVP(Ab_);
445 bool model_null =
false;
446 if(model_.get() ==
nullptr) {
448 ar << boost::serialization::make_nvp(
"model_null", model_null);
450 ar << boost::serialization::make_nvp(
"model_null", model_null);
451 ar << BOOST_SERIALIZATION_NVP(model_);
455 template<
class ARCHIVE>
456 void load(ARCHIVE & ar,
const unsigned int version) {
458 ar >> BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Base);
459 ar >> BOOST_SERIALIZATION_NVP(Ab_);
461 ar >> BOOST_SERIALIZATION_NVP(model_);
464 ar >> BOOST_SERIALIZATION_NVP(model_null);
466 ar >> BOOST_SERIALIZATION_NVP(model_);
471 BOOST_SERIALIZATION_SPLIT_MEMBER()
481 #if GTSAM_ENABLE_BOOST_SERIALIZATION
virtual double error(const VectorValues &c) const
Expression of a fixed-size or dynamic-size block.
A Gaussian factor using the canonical parameters (information form)
Included from all GTSAM files.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static const double d[K][N]
const SharedDiagonal & get_model() const
bool isConstrained() const
std::vector< T, typename internal::FastDefaultVectorAllocator< T >::type > FastVector
const GaussianFactorGraph factors
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
~JacobianFactor() override
GaussianFactor::shared_ptr clone() const override
const KeyFormatter & formatter
Block range(DenseIndex startBlock, DenseIndex endBlock)
VerticalBlockMatrix::constBlock constABlock
ABlock getA(const Key &key)
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
const constBVector getb() const
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
Point2 operator*(double s, const Point2 &p)
multiply with scalar
noiseModel::Diagonal::shared_ptr model_
ABlock getA(iterator variable)
void print(const Matrix &A, const string &s, ostream &stream)
JacobianFactor(const KEYS &keys, const DIMENSIONS &dims, DenseIndex m, const SharedDiagonal &model=SharedDiagonal())
DenseIndex getDim(const_iterator variable) const override
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
A matrix with column blocks of pre-defined sizes. Used in JacobianFactor and GaussianConditional.
std::shared_ptr< This > shared_ptr
shared_ptr to this class
noiseModel::Diagonal::shared_ptr SharedDiagonal
SharedDiagonal & get_model()
JacobianFactor(const JacobianFactor &jf)
JacobianFactor This
Typedef to this class.
noiseModel::Diagonal::shared_ptr model
static enum @1096 ordering
const gtsam::Symbol key('X', 0)
Block< Derived, internal::traits< Derived >::RowsAtCompileTime, 1, !IsRowMajor > ColXpr
const typedef Block< const Derived, internal::traits< Derived >::RowsAtCompileTime, 1, !IsRowMajor > ConstColXpr
void save(const Matrix &A, const string &s, const string &filename)
VariableSlots describes the structure of a combined factor in terms of where each block comes from in...
KeyVector::const_iterator const_iterator
Const iterator over keys.
constABlock::ConstColXpr constBVector
DenseIndex cols() const
Column size.
constABlock getA(const_iterator variable) const
ptrdiff_t DenseIndex
The index type for Eigen objects.
GaussianFactor Base
Typedef to base class.
std::shared_ptr< Diagonal > shared_ptr
DenseIndex rows() const
Row size.
VerticalBlockMatrix::Block ABlock
std::shared_ptr< This > shared_ptr
shared_ptr to this class
const VerticalBlockMatrix & matrixObject() const
A factor with a quadratic error function - a Gaussian.
static const EIGEN_DEPRECATED end_t end
NonlinearFactorGraph graph
std::uint64_t Key
Integer nonlinear key type.
VerticalBlockMatrix & matrixObject()
std::pair< GaussianConditional::shared_ptr, JacobianFactor::shared_ptr > EliminateQR(const GaussianFactorGraph &factors, const Ordering &keys)
gtsam
Author(s):
autogenerated on Fri Mar 7 2025 04:02:08