revert DiscreteFactorGraph::product
parent
1c14a56f5d
commit
b325150b37
|
|
@ -64,15 +64,10 @@ namespace gtsam {
|
|||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
DiscreteFactor::shared_ptr DiscreteFactorGraph::product() const {
|
||||
sharedFactor result = this->at(0);
|
||||
for (size_t i = 1; i < this->size(); ++i) {
|
||||
const sharedFactor factor = this->at(i);
|
||||
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);
|
||||
}
|
||||
DecisionTreeFactor DiscreteFactorGraph::product() const {
|
||||
DecisionTreeFactor result;
|
||||
for (const sharedFactor& factor : *this) {
|
||||
if (factor) result = result * (*factor);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ class GTSAM_EXPORT DiscreteFactorGraph
|
|||
DiscreteKeys discreteKeys() const;
|
||||
|
||||
/** 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
|
||||
|
|
|
|||
Loading…
Reference in New Issue