38 class GaussianFactorGraph;
39 class SymbolicFactorGraph;
43 class ExpressionFactor;
70 template<
typename ITERATOR>
74 template<
class CONTAINER>
78 template<
class DERIVEDFACTOR>
87 const std::string&
str =
"NonlinearFactorGraph: ",
91 void printErrors(
const Values&
values,
const std::string&
str =
"NonlinearFactorGraph: ",
93 const std::function<
bool(
const Factor* ,
double ,
size_t )>&
94 printCondition = [](
const Factor *,
double,
size_t) {
return true;})
const;
107 double probPrime(
const Values& values)
const;
112 std::shared_ptr<SymbolicFactorGraph> symbolic()
const;
130 std::shared_ptr<GaussianFactorGraph> linearize(
const Values& linearizationPoint)
const;
133 typedef std::function<void(const std::shared_ptr<HessianFactor>& hessianFactor)>
Dampen;
142 std::shared_ptr<HessianFactor> linearizeToHessianFactor(
143 const Values& values,
const Dampen& dampen =
nullptr)
const;
153 std::shared_ptr<HessianFactor> linearizeToHessianFactor(
159 const Dampen& dampen =
nullptr)
const;
164 const Dampen& dampen =
nullptr)
const;
189 this->emplace_shared<ExpressionFactor<T>>(
R,
z,
h);
216 emplace_shared<PriorFactor<T>>(
key,
prior, covariance);
250 std::shared_ptr<HessianFactor> linearizeToHessianFactor(
253 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 255 friend class boost::serialization::access;
256 template<
class ARCHIVE>
257 void serialize(ARCHIVE & ar,
const unsigned int ) {
258 ar & boost::serialization::make_nvp(
"NonlinearFactorGraph",
259 boost::serialization::base_object<Base>(*
this));
void print(const Matrix &A, const string &s, ostream &stream)
const gtsam::Symbol key('X', 0)
double dot(const V1 &a, const V2 &b)
void addPrior(Key key, const T &prior, const Matrix &covariance)
std::string serialize(const T &input)
serializes to a string
Point2 prior(const Point2 &x)
Prior on a single pose.
noiseModel::Diagonal::shared_ptr model
Rot2 R(Rot2::fromAngle(0.1))
const GaussianFactorGraph factors
NonlinearFactorGraph graph
static const KeyFormatter DefaultKeyFormatter
static enum @1107 ordering
void addPrior(Key key, const T &prior, const SharedNoiseModel &model=nullptr)
void saveGraph(const std::string &filename, const KeyFormatter &keyFormatter=DefaultKeyFormatter, const DotWriter &writer=DotWriter()) const
output to file with graphviz format.
void addExpressionFactor(const SharedNoiseModel &R, const T &z, const Expression< T > &h)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
NonlinearFactorGraph(const FactorGraph< DERIVEDFACTOR > &graph)
void dot(std::ostream &os, const KeyFormatter &keyFormatter=DefaultKeyFormatter, const DotWriter &writer=DotWriter()) const
Output to graphviz format, stream version.
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
NonlinearFactorGraph This
Non-linear factor base classes.
ofstream os("timeSchurFactors.csv")
FactorGraph< NonlinearFactor > Base
std::shared_ptr< This > shared_ptr
NonlinearFactorGraph(const CONTAINER &factors)
NonlinearFactorGraph(ITERATOR firstFactor, ITERATOR lastFactor)
std::function< void(const std::shared_ptr< HessianFactor > &hessianFactor)> Dampen
typdef for dampen functions used below
std::uint64_t Key
Integer nonlinear key type.
noiseModel::Base::shared_ptr SharedNoiseModel