24 #include <boost/shared_ptr.hpp> 25 #include <boost/make_shared.hpp> 36 public Conditional<DecisionTreeFactor, DiscreteConditional> {
78 template<
typename ITERATOR>
79 static shared_ptr
Combine(ITERATOR firstConditional,
80 ITERATOR lastConditional);
87 void print(
const std::string&
s =
"Discrete Conditional: ",
99 const std::string&
s =
"Discrete Conditional: ",
122 size_t solve(
const Values& parentsValues)
const;
129 size_t sample(
const Values& parentsValues)
const;
136 void solveInPlace(Values& parentsValues)
const;
139 void sampleInPlace(Values& parentsValues)
const;
150 template<
typename ITERATOR>
152 ITERATOR firstConditional, ITERATOR lastConditional) {
156 size_t nrFrontals = 0;
158 for (ITERATOR it = firstConditional; it != lastConditional;
159 ++it, ++nrFrontals) {
165 return boost::make_shared<DiscreteConditional>(nrFrontals,
product);
void print(const Matrix &A, const string &s, ostream &stream)
Base class for conditional densities.
static shared_ptr Combine(ITERATOR firstConditional, ITERATOR lastConditional)
DecisionTreeFactor::shared_ptr toFactor() const
Conditional< BaseFactor, This > BaseConditional
Typedef to our conditional base class.
DiscreteConditional This
Typedef to this class.
signatures for conditional densities
boost::shared_ptr< Values > sharedValues
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE const T1 & choose(Cond< true >, const T1 &first, const T2 &)
static const KeyFormatter DefaultKeyFormatter
double operator()(const Values &values) const override
Evaluate, just look up in AlgebraicDecisonTree.
const KeyFormatter & formatter
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
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.)
void printSignature(const std::string &s="Discrete Conditional: ", const KeyFormatter &formatter=DefaultKeyFormatter) const
print index signature only
boost::shared_ptr< This > shared_ptr
shared_ptr to this class
const double & operator()(const Assignment< Key > &x) const
boost::shared_ptr< DecisionTreeFactor > shared_ptr
void product(const MatrixType &m)