Go to the documentation of this file.
67 const std::vector<double>& potentials);
73 const std::vector<double>& potentials)
93 const std::string&
s =
"Table Distribution: ",
106 using BaseConditional::evaluate;
120 double max()
const override {
return table_.
max(); }
148 virtual size_t sample(
const DiscreteValues& parentsValues)
const override;
155 virtual void prune(
size_t maxNrAssignments)
override;
168 #if GTSAM_ENABLE_BOOST_SERIALIZATION
170 friend class boost::serialization::access;
171 template <
class Archive>
172 void serialize(Archive& ar,
const unsigned int ) {
173 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(BaseConditional);
174 ar& BOOST_SERIALIZATION_NVP(table_);
TableDistribution This
Typedef to this class.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
virtual double evaluate(const Assignment< Key > &values) const override
Evaluate the conditional given the values.
Eigen::SparseVector< double >::InnerIterator SparseIt
const KeyFormatter & formatter
DiscreteKeys is a set of keys that can be assembled using the & operator.
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
Point2 operator*(double s, const Point2 &p)
multiply with scalar
void print(const Matrix &A, const string &s, ostream &stream)
TableFactor table() const
Return the underlying TableFactor.
TableDistribution()
Default constructor needed for serialization.
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
double max() const override
Find the maximum value in the factor.
Eigen::SparseVector< double > sparseTable() const
Getter for the underlying sparse vector.
TableDistribution(const DiscreteKey &key, const std::string &potentials)
DecisionTreeFactor toDecisionTreeFactor() const override
Get a DecisionTreeFactor representation.
const gtsam::Symbol key('X', 0)
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
TableDistribution(const DiscreteKey &key, const std::vector< double > &potentials)
std::shared_ptr< This > shared_ptr
shared_ptr to this class
std::shared_ptr< DiscreteFactor > shared_ptr
shared_ptr to this class
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE CwiseBinaryOp< internal::scalar_quotient_op< Scalar, typename OtherDerived::Scalar >, const Derived, const OtherDerived > operator/(const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
std::pair< Key, size_t > DiscreteKey
double max() const override
Find the maximum value in the factor.
DiscreteConditional BaseConditional
Typedef to our conditional base class.
double evaluate(const Assignment< Key > &values) const override
Evaluate probability distribution, is just look up in TableFactor.
unsigned __int64 uint64_t
uint64_t nrValues() const override
Get the number of non-zero values.
DecisionTreeFactor toDecisionTreeFactor() const override
Convert into a decisiontree.
gtsam
Author(s):
autogenerated on Wed Mar 19 2025 03:04:38