more helper methods in DiscreteTableConditional

release/4.3a0
Varun Agrawal 2025-01-01 22:26:31 -05:00
parent f80a3a1a1d
commit b343a80965
1 changed files with 8 additions and 0 deletions

View File

@ -189,6 +189,14 @@ class GTSAM_EXPORT DiscreteTableConditional : public DiscreteConditional {
virtual DiscreteConditional::shared_ptr prune( virtual DiscreteConditional::shared_ptr prune(
size_t maxNrAssignments) const override; size_t maxNrAssignments) const override;
/// Get a DecisionTreeFactor representation.
DecisionTreeFactor toDecisionTreeFactor() const override {
return table_.toDecisionTreeFactor();
}
/// Get the number of non-zero values.
size_t nrValues() const { return table_.sparseTable().nonZeros(); }
/// @} /// @}
private: private: