code cleanup
parent
69b5e7d527
commit
07a68296d5
|
|
@ -49,12 +49,6 @@ TableDistribution::TableDistribution(const TableFactor& f)
|
|||
DecisionTreeFactor(f.discreteKeys(), ADT())),
|
||||
table_(f / (*f.sum(f.keys().size()))) {}
|
||||
|
||||
/* ************************************************************************** */
|
||||
TableDistribution::TableDistribution(
|
||||
const DiscreteKeys& keys, const Eigen::SparseVector<double>& potentials)
|
||||
: BaseConditional(keys.size(), keys, DecisionTreeFactor(keys, ADT())),
|
||||
table_(TableFactor(keys, normalizeSparseTable(potentials))) {}
|
||||
|
||||
/* ************************************************************************** */
|
||||
TableDistribution::TableDistribution(const DiscreteKeys& keys,
|
||||
const std::vector<double>& potentials)
|
||||
|
|
@ -71,23 +65,6 @@ TableDistribution::TableDistribution(const DiscreteKeys& keys,
|
|||
keys, normalizeSparseTable(TableFactor::Convert(keys, potentials)))) {
|
||||
}
|
||||
|
||||
/* **************************************************************************
|
||||
*/
|
||||
TableDistribution::TableDistribution(const TableFactor& joint,
|
||||
const TableFactor& marginal)
|
||||
: BaseConditional(joint.size() - marginal.size(),
|
||||
joint.discreteKeys() & marginal.discreteKeys(), ADT()),
|
||||
table_(joint / marginal) {}
|
||||
|
||||
/* ************************************************************************** */
|
||||
TableDistribution::TableDistribution(const TableFactor& joint,
|
||||
const TableFactor& marginal,
|
||||
const Ordering& orderedKeys)
|
||||
: TableDistribution(joint, marginal) {
|
||||
keys_.clear();
|
||||
keys_.insert(keys_.end(), orderedKeys.begin(), orderedKeys.end());
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
void TableDistribution::print(const string& s,
|
||||
const KeyFormatter& formatter) const {
|
||||
|
|
|
|||
|
|
@ -61,12 +61,6 @@ class GTSAM_EXPORT TableDistribution : public DiscreteConditional {
|
|||
/// Construct from TableFactor.
|
||||
TableDistribution(const TableFactor& f);
|
||||
|
||||
/**
|
||||
* Construct from DiscreteKeys and SparseVector.
|
||||
*/
|
||||
TableDistribution(const DiscreteKeys& keys,
|
||||
const Eigen::SparseVector<double>& potentials);
|
||||
|
||||
/**
|
||||
* Construct from DiscreteKeys and std::vector.
|
||||
*/
|
||||
|
|
@ -91,20 +85,6 @@ class GTSAM_EXPORT TableDistribution : public DiscreteConditional {
|
|||
TableDistribution(const DiscreteKey& key, const std::string& potentials)
|
||||
: TableDistribution(DiscreteKeys(key), potentials) {}
|
||||
|
||||
/**
|
||||
* @brief construct P(X|Y) = f(X,Y)/f(Y) from f(X,Y) and f(Y)
|
||||
* Assumes but *does not check* that f(Y)=sum_X f(X,Y).
|
||||
*/
|
||||
TableDistribution(const TableFactor& joint, const TableFactor& marginal);
|
||||
|
||||
/**
|
||||
* @brief construct P(X|Y) = f(X,Y)/f(Y) from f(X,Y) and f(Y)
|
||||
* Assumes but *does not check* that f(Y)=sum_X f(X,Y).
|
||||
* Makes sure the keys are ordered as given. Does not check orderedKeys.
|
||||
*/
|
||||
TableDistribution(const TableFactor& joint, const TableFactor& marginal,
|
||||
const Ordering& orderedKeys);
|
||||
|
||||
/// @}
|
||||
/// @name Testable
|
||||
/// @{
|
||||
|
|
|
|||
Loading…
Reference in New Issue