Go to the documentation of this file.
42 const std::vector<GaussianFactor::shared_ptr>&
factors)
56 f ? 0.0 : std::numeric_limits<double>::infinity()};
63 const std::vector<GaussianFactorValuePair>& factorPairs)
86 continuousKeys = pair.first->keys();
97 :
Base(helper.continuousKeys, helper.discreteKeys),
98 factors_(helper.pairs) {}
102 const std::vector<GaussianFactor::shared_ptr>&
factors)
107 const std::vector<GaussianFactorValuePair>& factorPairs)
116 const This*
e =
dynamic_cast<const This*
>(&lf);
117 if (
e ==
nullptr)
return false;
126 auto f1 = pair1.first,
f2 = pair2.first;
136 std::cout << (
s.empty() ?
"" :
s +
"\n");
140 std::cout <<
" empty" << std::endl;
149 std::cout <<
"scalar: " << pair.second <<
"\n";
156 std::cout <<
"}" << std::endl;
173 -> std::pair<GaussianFactorGraph, double> {
181 return pair.first ? pair.first->error(continuousValues) + pair.second
182 : std::numeric_limits<double>::infinity();
Linear Factor Graph where all factors are Gaussians.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
AlgebraicDecisionTree< Key > errorTree(const VectorValues &continuousValues) const override
Compute error of the HybridGaussianFactor as a tree.
GaussianFactorValuePair operator()(const DiscreteValues &assignment) const
Get factor at a given discrete assignment.
Typedefs for easier changing of types.
virtual bool equals(const HybridFactor &lf, double tol=1e-9) const
equals
HybridGaussianFactor()=default
Default constructor, mainly for serialization.
ConstructorHelper(const DiscreteKey &discreteKey, const std::vector< GaussianFactorValuePair > &factorPairs)
bool empty() const
Check if tree is empty.
bool equals(const DecisionTree &other, const CompareFunc &compare=&DefaultCompare) const
const GaussianFactorGraph factors
const KeyFormatter & formatter
double f2(const Vector2 &x)
Alias for DecisionTree of GaussianFactorGraphs and their scalar sums.
DiscreteKeys is a set of keys that can be assembled using the & operator.
void print(const std::string &s, const LabelFormatter &labelFormatter, const ValueFormatter &valueFormatter) const
GTSAM-style print.
void print(const std::string &s="", const KeyFormatter &formatter=DefaultKeyFormatter) const override
print
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
A set of GaussianFactors, indexed by a set of discrete keys.
DecisionTreeFactor factor(D &C &B &A, "0.0 0.0 0.0 0.60658897 0.61241912 0.61241969 0.61247685 0.61247742 0.0 " "0.0 0.0 0.99995287 1.0 1.0 1.0 1.0")
std::pair< GaussianFactor::shared_ptr, double > GaussianFactorValuePair
Alias for pair of GaussianFactor::shared_pointer and a double value.
bool match(const T &xpr, std::string ref, std::string str_xpr="")
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Decision Tree for use in DiscreteFactors.
void visit(Func f) const
Visit all leaves in depth-first fashion.
const FactorValuePairs & factors() const
Getter for GaussianFactor decision tree.
bool equals(const HybridFactor &lf, double tol=1e-9) const override
equals
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
ConstructorHelper(const DiscreteKeys &discreteKeys, const FactorValuePairs &factorPairs)
void print(const std::string &s="HybridFactor\n", const KeyFormatter &formatter=DefaultKeyFormatter) const override
print
virtual HybridGaussianProductFactor asProductFactor() const
Helper function to return factors and functional to create a DecisionTree of Gaussian Factor Graphs.
FactorValuePairs factors_
Decision tree of Gaussian factors indexed by discrete keys.
DecisionTree< Key, GaussianFactorValuePair > FactorValuePairs
typedef for Decision Tree of Gaussian factors and arbitrary value.
std::shared_ptr< GaussianFactor > sharedFactor
std::pair< Key, size_t > DiscreteKey
Implementation of a discrete-conditioned hybrid factor. Implements a joint discrete-continuous factor...
static double PotentiallyPrunedComponentError(const GaussianFactorValuePair &pair, const VectorValues &continuousValues)
double error(const HybridValues &values) const override
Compute the log-likelihood, including the log-normalizing constant.
A factor with a quadratic error function - a Gaussian.
DiscreteKeys discreteKeys
std::uint64_t Key
Integer nonlinear key type.
bool equal(const T &obj1, const T &obj2, double tol)
std::string str() const
return the string
ConstructorHelper(const DiscreteKey &discreteKey, const std::vector< GaussianFactor::shared_ptr > &factors)
Constructor for a single discrete key and a vector of Gaussian factors.
gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:40