Go to the documentation of this file.
29 template <
class FACTOR,
class DERIVEDCONDITIONAL>
32 std::cout <<
s <<
" P(";
34 if (nrParents() > 0) std::cout <<
" |";
35 for (
Key parent : parents()) std::cout <<
" " <<
formatter(parent);
36 std::cout <<
")" << std::endl;
40 template <
class FACTOR,
class DERIVEDCONDITIONAL>
43 return nrFrontals_ ==
c.nrFrontals_;
47 template <
class FACTOR,
class DERIVEDCONDITIONAL>
50 throw std::runtime_error(
"Conditional::logProbability is not implemented");
54 template <
class FACTOR,
class DERIVEDCONDITIONAL>
57 throw std::runtime_error(
"Conditional::evaluate is not implemented");
61 template <
class FACTOR,
class DERIVEDCONDITIONAL>
63 throw std::runtime_error(
"Conditional::negLogConstant is not implemented");
67 template <
class FACTOR,
class DERIVEDCONDITIONAL>
68 template <
class VALUES>
70 const DERIVEDCONDITIONAL& conditional,
const VALUES&
values) {
71 const double prob_or_density = conditional.evaluate(
values);
72 if (prob_or_density < 0.0)
return false;
75 const double logProb = conditional.logProbability(
values);
79 if (
error < 0.0)
return false;
80 const double expected = -(conditional.negLogConstant() +
error);
void print(const std::string &s="Conditional", const KeyFormatter &formatter=DefaultKeyFormatter) const
Array< double, 1, 3 > e(1./3., 0.5, 2.)
bool equals(const This &c, double tol=1e-9) const
const KeyFormatter & formatter
virtual double evaluate(const HybridValues &c) const
const EIGEN_DEVICE_FUNC ExpReturnType exp() const
virtual double logProbability(const HybridValues &c) const
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
static bool CheckInvariants(const DERIVEDCONDITIONAL &conditional, const VALUES &x)
const gtsam::Symbol key('X', 0)
Base class for conditional densities.
std::uint64_t Key
Integer nonlinear key type.
virtual double negLogConstant() const
All conditional types need to implement this as the negative log of the normalization constant to mak...
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:01