18 if (!linearizationPoint.
empty()) {
57 Base::print(s+
"LinearContainerFactor", keyFormatter);
59 factor_->print(
" Stored Factor", keyFormatter);
121 jacFactor->
getb() = -jacFactor->unweighted_error(delta);
125 const auto view = hesFactor->informationView();
127 Vector G_delta = view * deltaVector;
128 hesFactor->constantTerm() += deltaVector.dot(G_delta) - 2.0 * deltaVector.dot(hesFactor->linearTerm().col(0));
129 hesFactor->linearTerm() -= G_delta;
172 for (
const auto&
f : linear_graph)
Wrap Jacobian and Hessian linear factors to allow simple injection into a nonlinear graph...
void insert(Key j, const Value &val)
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
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
GTSAM_EXPORT boost::shared_ptr< HessianFactor > toHessian() const
const GaussianFactor::shared_ptr & factor() const
GaussianFactor::shared_ptr factor_
GTSAM_EXPORT GaussianFactor::shared_ptr negateToGaussian() const
const ValueType at(Key j) const
const constBVector getb() const
GTSAM_EXPORT bool isHessian() const
const boost::optional< Values > & linearizationPoint() const
boost::shared_ptr< This > shared_ptr
GTSAM_EXPORT boost::shared_ptr< JacobianFactor > toJacobian() const
boost::shared_ptr< This > shared_ptr
A shared_ptr to this class.
GTSAM_EXPORT size_t dim() const override
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 >)
Contains the HessianFactor class, a general quadratic factor.
Linear Factor Graph where all factors are Gaussians.
virtual bool equals(const NonlinearFactor &f, double tol=1e-9) const
boost::shared_ptr< This > shared_ptr
shared_ptr to this class
GTSAM_EXPORT void print(const std::string &s="", const KeyFormatter &keyFormatter=gtsam::DefaultKeyFormatter) const override
GTSAM_EXPORT NonlinearFactor::shared_ptr negateToNonlinear() const
GTSAM_EXPORT bool equals(const NonlinearFactor &f, double tol=1e-9) const override
std::vector< float > Values
const KeyVector & keys() const
Access the factor's involved variable keys.
NonlinearFactor::shared_ptr clone() const override
GTSAM_EXPORT bool isJacobian() const
GTSAM_EXPORT void initializeLinearizationPoint(const Values &linearizationPoint)
boost::optional< Values > linearizationPoint_
A Gaussian factor using the canonical parameters (information form)
void reserve(size_t size)
boost::shared_ptr< This > shared_ptr
shared_ptr to this class
static GTSAM_EXPORT NonlinearFactorGraph ConvertLinearGraph(const GaussianFactorGraph &linear_graph, const Values &linearizationPoint=Values())
GTSAM_EXPORT GaussianFactor::shared_ptr linearize(const Values &c) const override
GTSAM_EXPORT double error(const Values &c) const override
std::uint64_t Key
Integer nonlinear key type.
bool hasLinearizationPoint() const