TableFactor constructor from DecisionTreeFactor and AlgebraicDecisionTree
parent
9c88e3ed96
commit
f238ba55d2
|
|
@ -56,6 +56,16 @@ TableFactor::TableFactor(const DiscreteKeys& dkeys,
|
||||||
sort(sorted_dkeys_.begin(), sorted_dkeys_.end());
|
sort(sorted_dkeys_.begin(), sorted_dkeys_.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ************************************************************************ */
|
||||||
|
TableFactor::TableFactor(const DiscreteKeys& dkeys,
|
||||||
|
const DecisionTreeFactor& dtf)
|
||||||
|
: TableFactor(dkeys, dtf.probabilities()) {}
|
||||||
|
|
||||||
|
/* ************************************************************************ */
|
||||||
|
TableFactor::TableFactor(const DiscreteKeys& dkeys,
|
||||||
|
const DecisionTree<Key, double>& dtree)
|
||||||
|
: TableFactor(dkeys, DecisionTreeFactor(dkeys, dtree)) {}
|
||||||
|
|
||||||
/* ************************************************************************ */
|
/* ************************************************************************ */
|
||||||
TableFactor::TableFactor(const DiscreteConditional& c)
|
TableFactor::TableFactor(const DiscreteConditional& c)
|
||||||
: TableFactor(c.discreteKeys(), c.probabilities()) {}
|
: TableFactor(c.discreteKeys(), c.probabilities()) {}
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,12 @@ class GTSAM_EXPORT TableFactor : public DiscreteFactor {
|
||||||
TableFactor(const DiscreteKey& key, const std::vector<double>& row)
|
TableFactor(const DiscreteKey& key, const std::vector<double>& row)
|
||||||
: TableFactor(DiscreteKeys{key}, row) {}
|
: TableFactor(DiscreteKeys{key}, row) {}
|
||||||
|
|
||||||
|
/// Constructor from DecisionTreeFactor
|
||||||
|
TableFactor(const DiscreteKeys& keys, const DecisionTreeFactor& dtf);
|
||||||
|
|
||||||
|
/// Constructor from DecisionTree<Key, double>/AlgebraicDecisionTree
|
||||||
|
TableFactor(const DiscreteKeys& keys, const DecisionTree<Key, double>& dtree);
|
||||||
|
|
||||||
/** Construct from a DiscreteConditional type */
|
/** Construct from a DiscreteConditional type */
|
||||||
explicit TableFactor(const DiscreteConditional& c);
|
explicit TableFactor(const DiscreteConditional& c);
|
||||||
|
|
||||||
|
|
@ -177,7 +183,7 @@ class GTSAM_EXPORT TableFactor : public DiscreteFactor {
|
||||||
return apply(f, Ring::mul);
|
return apply(f, Ring::mul);
|
||||||
};
|
};
|
||||||
|
|
||||||
/// multiple with DecisionTreeFactor
|
/// multiply with DecisionTreeFactor
|
||||||
DecisionTreeFactor operator*(const DecisionTreeFactor& f) const override;
|
DecisionTreeFactor operator*(const DecisionTreeFactor& f) const override;
|
||||||
|
|
||||||
static double safe_div(const double& a, const double& b);
|
static double safe_div(const double& a, const double& b);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue