A discrete probabilistic factor.
|
|
| DecisionTreeFactor () |
| Default constructor for I/O.
|
|
| DecisionTreeFactor (const DiscreteKeys &keys, const ADT &potentials) |
| Constructor from Indices, Ordering, and AlgebraicDecisionDiagram.
|
|
template<class SOURCE > |
| DecisionTreeFactor (const DiscreteKeys &keys, SOURCE table) |
| Constructor from Indices and (string or doubles)
|
|
| DecisionTreeFactor (const DiscreteConditional &c) |
| Construct from a DiscreteConditional type.
|
|
|
bool | equals (const DiscreteFactor &other, double tol=1e-9) const override |
| equality More...
|
|
void | print (const std::string &s="DecisionTreeFactor:\n", const KeyFormatter &formatter=DefaultKeyFormatter) const override |
| print More...
|
|
|
double | operator() (const Values &values) const override |
| Value is just look up in AlgebraicDecisonTree. More...
|
|
DecisionTreeFactor | operator* (const DecisionTreeFactor &f) const override |
| multiply two factors More...
|
|
DecisionTreeFactor | operator/ (const DecisionTreeFactor &f) const |
| divide by factor f (safely)
|
|
DecisionTreeFactor | toDecisionTreeFactor () const override |
| Convert into a decisiontree. More...
|
|
shared_ptr | sum (size_t nrFrontals) const |
| Create new factor by summing all values with the same separator values.
|
|
shared_ptr | sum (const Ordering &keys) const |
| Create new factor by summing all values with the same separator values.
|
|
shared_ptr | max (size_t nrFrontals) const |
| Create new factor by maximizing over all values with the same separator values.
|
|
|
DecisionTreeFactor | apply (const DecisionTreeFactor &f, ADT::Binary op) const |
| Apply binary operator (*this) "op" f. More...
|
|
shared_ptr | combine (size_t nrFrontals, ADT::Binary op) const |
| Combine frontal variables using binary operator "op". More...
|
|
shared_ptr | combine (const Ordering &keys, ADT::Binary op) const |
| Combine frontal variables in an Ordering using binary operator "op". More...
|
|
| DiscreteFactor () |
| Default constructor creates empty factor.
|
|
template<typename CONTAINER > |
| DiscreteFactor (const CONTAINER &keys) |
| Construct from container of keys. More...
|
|
virtual | ~DiscreteFactor () |
| Virtual destructor.
|
|
void | print (const std::string &s="DiscreteFactor\n", const KeyFormatter &formatter=DefaultKeyFormatter) const override |
| print More...
|
|
virtual bool | empty () const |
| Test whether the factor is empty.
|
|
virtual | ~Factor ()=default |
| Default destructor.
|
|
KeyVector & | keys () |
|
iterator | begin () |
| Iterator at beginning of involved variable keys.
|
|
iterator | end () |
| Iterator at end of involved variable keys.
|
|
virtual void | printKeys (const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const |
| print only keys More...
|
|
Key | front () const |
| First key.
|
|
Key | back () const |
| Last key.
|
|
const_iterator | find (Key key) const |
| find
|
|
const KeyVector & | keys () const |
| Access the factor's involved variable keys.
|
|
const_iterator | begin () const |
| Iterator at beginning of involved variable keys.
|
|
const_iterator | end () const |
| Iterator at end of involved variable keys.
|
|
size_t | size () const |
|
GTSAM_EXPORT | Potentials () |
| Default constructor for I/O.
|
|
GTSAM_EXPORT | Potentials (const DiscreteKeys &keys, const ADT &decisionTree) |
| Constructor from Indices and ADT.
|
|
template<class SOURCE > |
| Potentials (const DiscreteKeys &keys, SOURCE table) |
| Constructor from Indices and (string or doubles)
|
|
GTSAM_EXPORT bool | equals (const Potentials &other, double tol=1e-9) const |
|
GTSAM_EXPORT void | print (const std::string &s="Potentials: ", const KeyFormatter &formatter=DefaultKeyFormatter) const |
|
size_t | cardinality (Key j) const |
|
| AlgebraicDecisionTree (const Super &add) |
|
| AlgebraicDecisionTree (const Key &label, double y1, double y2) |
| Create a new leaf function splitting on a variable.
|
|
| AlgebraicDecisionTree (const typename Super::LabelC &labelC, double y1, double y2) |
| Create a new leaf function splitting on a variable.
|
|
| AlgebraicDecisionTree (const std::vector< typename Super::LabelC > &labelCs, const std::vector< double > &ys) |
| Create from keys and vector table.
|
|
| AlgebraicDecisionTree (const std::vector< typename Super::LabelC > &labelCs, const std::string &table) |
| Create from keys and string table.
|
|
| AlgebraicDecisionTree (Iterator begin, Iterator end, const Key &label) |
| Create a new function splitting on a variable.
|
|
| AlgebraicDecisionTree (const AlgebraicDecisionTree< M > &other, const std::map< M, Key > &map) |
| Convert.
|
|
AlgebraicDecisionTree | operator+ (const AlgebraicDecisionTree &g) const |
| sum
|
|
AlgebraicDecisionTree | operator* (const AlgebraicDecisionTree &g) const |
| product
|
|
AlgebraicDecisionTree | operator/ (const AlgebraicDecisionTree &g) const |
| division
|
|
AlgebraicDecisionTree | sum (const Key &label, size_t cardinality) const |
| sum out variable
|
|
AlgebraicDecisionTree | sum (const typename Super::LabelC &labelC) const |
| sum out variable
|
|
| DecisionTree (const double &y) |
| Create a constant.
|
|
| DecisionTree (const Key &label, const double &y1, const double &y2) |
| Create a new leaf function splitting on a variable.
|
|
| DecisionTree (const LabelC &label, const double &y1, const double &y2) |
| Allow Label+Cardinality for convenience.
|
|
| DecisionTree (const std::vector< LabelC > &labelCs, const std::vector< double > &ys) |
| Create from keys and a corresponding vector of values.
|
|
| DecisionTree (const std::vector< LabelC > &labelCs, const std::string &table) |
| Create from keys and string table.
|
|
| DecisionTree (Iterator begin, Iterator end, const Key &label) |
| Create DecisionTree from others.
|
|
| DecisionTree (const Key &label, const DecisionTree &f0, const DecisionTree &f1) |
| Create DecisionTree from two others.
|
|
| DecisionTree (const DecisionTree< M, X > &other, const std::map< M, Key > &map, std::function< double(const X &)> op) |
| Convert from a different type.
|
|
| DecisionTree (const NodePtr &root) |
|
NodePtr | compose (Iterator begin, Iterator end, const Key &label) const |
|
void | print (const std::string &s="DecisionTree") const |
| GTSAM-style print.
|
|
bool | equals (const DecisionTree &other, double tol=1e-9) const |
|
virtual | ~DecisionTree () |
| Make virtual.
|
|
bool | operator== (const DecisionTree &q) const |
| equality
|
|
const double & | operator() (const Assignment< Key > &x) const |
| evaluate
|
|
DecisionTree | apply (const Unary &op) const |
| apply Unary operation "op" to f
|
|
DecisionTree | apply (const DecisionTree &g, const Binary &op) const |
| apply binary operation "op" to f and g
|
|
DecisionTree | choose (const Key &label, size_t index) const |
| create a new function where value(label)==index It's like "restrict" in Darwiche09book pg329, 330?
|
|
DecisionTree | combine (const Key &label, size_t cardinality, const Binary &op) const |
| combine subtrees on key with binary operation "op"
|
|
DecisionTree | combine (const LabelC &labelC, const Binary &op) const |
| combine with LabelC for convenience
|
|
void | dot (std::ostream &os, bool showZero=true) const |
| output to graphviz format, stream version
|
|
void | dot (const std::string &name, bool showZero=true) const |
| output to graphviz format, open a file
|
|
|
NodePtr | root_ |
|
| Factor () |
| Default constructor for I/O.
|
|
template<typename CONTAINER > |
| Factor (const CONTAINER &keys) |
| Construct factor from container of keys. More...
|
|
template<typename ITERATOR > |
| Factor (ITERATOR first, ITERATOR last) |
| Construct factor from iterator keys. More...
|
|
bool | equals (const This &other, double tol=1e-9) const |
| check equality
|
|
| Potentials (const ADT &potentials) |
| Constructor from ColumnIndex, and ADT.
|
|
NodePtr | create (It begin, It end, ValueIt beginY, ValueIt endY) const |
| Internal recursive function to create from keys, cardinalities, and Y values.
|
|
NodePtr | convert (const typename DecisionTree< M, X >::NodePtr &f, const std::map< M, Key > &map, std::function< double(const X &)> op) |
| Convert to a different type.
|
|
| DecisionTree () |
| Default constructor.
|
|
template<typename CONTAINER > |
static Factor | FromKeys (const CONTAINER &keys) |
| Construct factor from container of keys. More...
|
|
template<typename ITERATOR > |
static Factor | FromIterators (ITERATOR first, ITERATOR last) |
| Construct factor from iterator keys. More...
|
|
static GTSAM_EXPORT double | safe_div (const double &a, const double &b) |
|
KeyVector | keys_ |
| The keys involved in this factor.
|
|
std::map< Key, size_t > | cardinalities_ |
| Cardinality for each key, used in combine.
|
|