revert DiscreteFactorGraph::product
parent
1c14a56f5d
commit
b325150b37
|
|
@ -64,15 +64,10 @@ namespace gtsam {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
DiscreteFactor::shared_ptr DiscreteFactorGraph::product() const {
|
DecisionTreeFactor DiscreteFactorGraph::product() const {
|
||||||
sharedFactor result = this->at(0);
|
DecisionTreeFactor result;
|
||||||
for (size_t i = 1; i < this->size(); ++i) {
|
for (const sharedFactor& factor : *this) {
|
||||||
const sharedFactor factor = this->at(i);
|
if (factor) result = result * (*factor);
|
||||||
if (factor) {
|
|
||||||
// Predicated on the fact that all discrete factors are of a single type
|
|
||||||
// so there is no type-conversion happening which can be expensive.
|
|
||||||
result = result->operator*(factor);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ class GTSAM_EXPORT DiscreteFactorGraph
|
||||||
DiscreteKeys discreteKeys() const;
|
DiscreteKeys discreteKeys() const;
|
||||||
|
|
||||||
/** return product of all factors as a single factor */
|
/** return product of all factors as a single factor */
|
||||||
DiscreteFactor::shared_ptr product() const;
|
DecisionTreeFactor product() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Evaluates the factor graph given values, returns the joint probability of
|
* Evaluates the factor graph given values, returns the joint probability of
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue