Go to the documentation of this file.
31 throw std::invalid_argument(
32 "Single value operator can only be invoked on single-variable "
41 throw std::invalid_argument(
42 "DiscreteDistribution::pmf only defined for single-variable priors");
44 std::vector<double>
array;
45 array.reserve(nrValues);
46 for (
size_t v = 0;
v < nrValues;
v++) {
47 array.push_back(
operator()(
v));
double operator()(size_t value) const
Evaluate given a single value.
std::map< Key, size_t > cardinalities_
Map of Keys and their cardinalities.
const KeyFormatter & formatter
void print(const std::string &s="Discrete Conditional: ", const KeyFormatter &formatter=DefaultKeyFormatter) const override
GTSAM-style print.
std::vector< double > pmf() const
We also want to keep the Base version, taking DiscreteValues:
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
double operator()(const DiscreteValues &values) const override
Evaluate probability distribution, sugar.
size_t nrFrontals() const
KeyVector keys_
The keys involved in this factor.
Array< int, Dynamic, 1 > v
void print(const std::string &s="Discrete Prior: ", const KeyFormatter &formatter=DefaultKeyFormatter) const override
GTSAM-style print.
gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:32:26