Go to the documentation of this file.
29 class DecisionTreeFactor;
30 class DiscreteConditional;
43 typedef std::shared_ptr<DiscreteFactor>
49 using Unary = std::function<double(
const double&)>;
52 using Binary = std::function<double(
const double,
const double)>;
70 template <
typename CONTAINER>
72 const std::map<Key, size_t> cardinalities = {})
73 :
Base(
keys), cardinalities_(cardinalities) {}
84 const std::string&
s =
"DiscreteFactor\n",
159 virtual std::string
html(
161 const Names&
names = {})
const = 0;
166 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
168 friend class boost::serialization::access;
169 template <
class ARCHIVE>
170 void serialize(ARCHIVE& ar,
const unsigned int ) {
171 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Base);
172 ar& BOOST_SERIALIZATION_NVP(cardinalities_);
198 std::vector<double>
expNormalize(
const std::vector<double>& logProbs);
EIGEN_STRONG_INLINE Packet4f print(const Packet4f &a)
string markdown(const DiscreteValues &values, const KeyFormatter &keyFormatter, const DiscreteValues::Names &names)
Free version of markdown.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
std::map< Key, size_t > cardinalities() const
Concept check for values that can be used in unit tests.
std::map< Key, size_t > cardinalities_
Map of Keys and their cardinalities.
const KeyFormatter & formatter
DiscreteKeys is a set of keys that can be assembled using the & operator.
The base class for all factors.
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
Point2 operator*(double s, const Point2 &p)
multiply with scalar
Algebraic Decision Trees.
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
void print(const std::string &s="DiscreteFactor\n", const KeyFormatter &formatter=DefaultKeyFormatter) const override
print
DiscreteFactor This
This class.
DiscreteFactor(const CONTAINER &keys, const std::map< Key, size_t > cardinalities={})
std::function< double(const double, const double)> Binary
size_t cardinality(Key j) const
std::shared_ptr< DiscreteFactor > shared_ptr
shared_ptr to this class
DiscreteValues::Names Names
Translation table from values to strings.
std::vector< double > expNormalize(const std::vector< double > &logProbs)
Normalize a set of log probabilities.
Factor Base
Our base class.
string html(const DiscreteValues &values, const KeyFormatter &keyFormatter, const DiscreteValues::Names &names)
Free version of html.
std::map< Key, std::vector< std::string > > Names
Translation table from values to strings.
std::function< double(const Assignment< Key > &, const double &)> UnaryAssignment
std::uint64_t Key
Integer nonlinear key type.
std::function< double(const double &)> Unary
double operator()(const DiscreteValues &values) const
Find value for given assignment of values to variables.
gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:28