39 public Conditional<DecisionTreeFactor, DiscreteConditional> {
64 const ADT& potentials);
90 const std::string& spec)
139 const std::string&
s =
"Discrete Conditional: ",
156 const std::string&
s =
"Discrete Conditional: ",
167 using DecisionTreeFactor::operator();
199 size_t sample(
size_t parent_value)
const;
202 size_t sample()
const;
208 size_t argmax()
const;
218 std::vector<DiscreteValues> frontalAssignments()
const;
221 std::vector<DiscreteValues> allAssignments()
const;
246 using BaseConditional::operator();
268 bool forceComplete)
const;
271 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 273 friend class boost::serialization::access;
274 template <
class Archive>
275 void serialize(Archive& ar,
const unsigned int ) {
276 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(BaseFactor);
void print(const Matrix &A, const string &s, ostream &stream)
const gtsam::Symbol key('X', 0)
Conditional< BaseFactor, This > BaseConditional
Typedef to our conditional base class.
DiscreteConditional This
Typedef to this class.
signatures for conditional densities
DiscreteConditional()
Default constructor needed for serialization.
std::string serialize(const T &input)
serializes to a string
double evaluate(const DiscreteValues &values) const
Evaluate, just look up in AlgebraicDecisonTree.
double logNormalizationConstant() const override
static const T & choose(int layout, const T &col, const T &row)
string markdown(const DiscreteValues &values, const KeyFormatter &keyFormatter, const DiscreteValues::Names &names)
Free version of markdown.
DiscreteConditional(const DiscreteKey &key, const std::string &spec)
No-parent specialization; can also use DiscreteDistribution.
Point2 operator*(double s, const Point2 &p)
multiply with scalar
static const KeyFormatter DefaultKeyFormatter
double error(const DiscreteValues &values) const
Calculate error for DiscreteValues x, is -log(probability).
DiscreteConditional(const DiscreteKey &key, const DiscreteKeys &parents, const std::string &spec)
const KeyFormatter & formatter
void printSignature(const std::string &s="Discrete Conditional: ", const KeyFormatter &formatter=DefaultKeyFormatter) const
print index signature only
double logProbability(const HybridValues &x) const override
< HybridValues version
string html(const DiscreteValues &values, const KeyFormatter &keyFormatter, const DiscreteValues::Names &names)
Free version of html.
double logProbability(const DiscreteValues &x) const
Log-probability is just -error(x).
DiscreteConditional(const DiscreteKey &key, const DiscreteKeys &parents, const Signature::Table &table)
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
DecisionTreeFactor BaseFactor
Typedef to our factor base class.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
DiscreteValues::Names Names
Translation table from values to strings.
std::shared_ptr< DecisionTreeFactor > shared_ptr
std::pair< Key, size_t > DiscreteKey
std::shared_ptr< This > shared_ptr
shared_ptr to this class
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 x
internal::enable_if< internal::valid_indexed_view_overload< RowIndices, ColIndices >::value &&internal::traits< typename EIGEN_INDEXED_VIEW_METHOD_TYPE< RowIndices, ColIndices >::type >::ReturnAsIndexedView, typename EIGEN_INDEXED_VIEW_METHOD_TYPE< RowIndices, ColIndices >::type >::type operator()(const RowIndices &rowIndices, const ColIndices &colIndices) EIGEN_INDEXED_VIEW_METHOD_CONST
std::uint64_t Key
Integer nonlinear key type.
DiscreteKeys is a set of keys that can be assembled using the & operator.