Skip to content

Commit d01bfba

Browse files
committed
implement DecisionTreeFactor::restrict
1 parent 5c2e8d6 commit d01bfba

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gtsam/discrete/DecisionTreeFactor.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,9 @@ namespace gtsam {
547547
/* ************************************************************************ */
548548
DiscreteFactor::shared_ptr DecisionTreeFactor::restrict(
549549
const DiscreteValues& assignment) const {
550-
throw std::runtime_error("DecisionTreeFactor::restrict not implemented");
550+
ADT restricted_tree = ADT::restrict(assignment);
551+
return std::make_shared<DecisionTreeFactor>(this->discreteKeys(),
552+
restricted_tree);
551553
}
552554

553555
/* ************************************************************************ */

0 commit comments

Comments
 (0)