30 boost::optional<Values> linearizationPoint_;
41 typedef boost::shared_ptr<This> shared_ptr;
62 GTSAM_EXPORT
void print(
const std::string& s =
"",
const KeyFormatter& keyFormatter = gtsam::DefaultKeyFormatter)
const override;
77 GTSAM_EXPORT
double error(
const Values& c)
const override;
80 GTSAM_EXPORT
size_t dim()
const override;
119 NonlinearFactor::shared_ptr
clone()
const override {
128 NonlinearFactor::shared_ptr
rekey(
129 const std::map<Key, Key>& rekey_mapping)
const override;
135 NonlinearFactor::shared_ptr
rekey(
const KeyVector& new_keys)
const override;
144 GTSAM_EXPORT
bool isHessian()
const;
147 GTSAM_EXPORT boost::shared_ptr<JacobianFactor>
toJacobian()
const;
150 GTSAM_EXPORT boost::shared_ptr<HessianFactor>
toHessian()
const;
166 template<
class ARCHIVE>
167 void serialize(ARCHIVE & ar,
const unsigned int ) {
168 ar & boost::serialization::make_nvp(
"NonlinearFactor",
169 boost::serialization::base_object<Base>(*
this));
170 ar & BOOST_SERIALIZATION_NVP(factor_);
171 ar & BOOST_SERIALIZATION_NVP(linearizationPoint_);
Factor Graph consisting of non-linear factors.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition: Key.h:86
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:35
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
A helper that implements the traits interface for GTSAM types.
Definition: Testable.h:151
This is the base class for all factor types.
Definition: Factor.h:56
boost::shared_ptr< This > shared_ptr
shared_ptr to this class
Definition: GaussianFactor.h:42
A Linear Factor Graph is a factor graph where all factors are Gaussian, i.e.
Definition: GaussianFactorGraph.h:69
A Gaussian factor using the canonical parameters (information form)
Definition: HessianFactor.h:101
A Gaussian factor in the squared-error form.
Definition: JacobianFactor.h:91
Dummy version of a generic linear factor to be injected into a nonlinear factor graph.
Definition: LinearContainerFactor.h:26
GTSAM_EXPORT boost::shared_ptr< HessianFactor > toHessian() const
Casts to HessianFactor.
Definition: LinearContainerFactor.cpp:151
NonlinearFactor::shared_ptr clone() const override
Creates a shared_ptr clone of the factor - needs to be specialized to allow for subclasses.
Definition: LinearContainerFactor.h:119
LinearContainerFactor()
Default constructor - necessary for serialization.
Definition: LinearContainerFactor.h:44
GTSAM_EXPORT size_t dim() const override
get the dimension of the factor: rows of linear factor
Definition: LinearContainerFactor.cpp:96
const boost::optional< Values > & linearizationPoint() const
Extract the linearization point used in recalculating error.
Definition: LinearContainerFactor.h:83
NonlinearFactor::shared_ptr rekey(const std::map< Key, Key > &rekey_mapping) const override
Creates a shared_ptr clone of the factor with different keys using a map from old->new keys.
Definition: LinearContainerFactor.cpp:168
GTSAM_EXPORT void print(const std::string &s="", const KeyFormatter &keyFormatter=gtsam::DefaultKeyFormatter) const override
print
Definition: LinearContainerFactor.cpp:56
GTSAM_EXPORT GaussianFactor::shared_ptr negateToGaussian() const
Creates an anti-factor directly.
Definition: LinearContainerFactor.cpp:156
GTSAM_EXPORT boost::shared_ptr< JacobianFactor > toJacobian() const
Casts to JacobianFactor.
Definition: LinearContainerFactor.cpp:146
GTSAM_EXPORT bool equals(const NonlinearFactor &f, double tol=1e-9) const override
Check if two factors are equal.
Definition: LinearContainerFactor.cpp:65
bool hasLinearizationPoint() const
Casting syntactic sugar.
Definition: LinearContainerFactor.h:138
GTSAM_EXPORT bool isJacobian() const
Simple checks whether this is a Jacobian or Hessian factor.
Definition: LinearContainerFactor.cpp:136
GTSAM_EXPORT NonlinearFactor::shared_ptr negateToNonlinear() const
Creates the equivalent anti-factor as another LinearContainerFactor.
Definition: LinearContainerFactor.cpp:162
GTSAM_EXPORT GaussianFactor::shared_ptr linearize(const Values &c) const override
Linearize to a GaussianFactor, with method depending on the presence of a linearizationPoint.
Definition: LinearContainerFactor.cpp:104
friend class boost::serialization::access
Serialization function.
Definition: LinearContainerFactor.h:165
GTSAM_EXPORT double error(const Values &c) const override
Calculate the nonlinear error for the factor, where the error is computed by passing the delta betwee...
Definition: LinearContainerFactor.cpp:77
static GTSAM_EXPORT NonlinearFactorGraph ConvertLinearGraph(const GaussianFactorGraph &linear_graph, const Values &linearizationPoint=Values())
Utility function for converting linear graphs to nonlinear graphs consisting of LinearContainerFactor...
Definition: LinearContainerFactor.cpp:210
Nonlinear factor base class.
Definition: NonlinearFactor.h:43
NonlinearFactor()
Default constructor for I/O only.
Definition: NonlinearFactor.h:59
A non-linear factor graph is a graph of non-Gaussian, i.e.
Definition: NonlinearFactorGraph.h:78
A non-templated config holding any types of Manifold-group elements.
Definition: Values.h:63