26 using namespace gtsam;
28 int main(
int argc,
char **argv) {
45 vector<string> pretty = {
"Asia",
"Dyspnea",
"XRay",
"Tuberculosis",
46 "Smoking",
"Either",
"LungCancer",
"Bronchitis"};
67 fg.
add(Dyspnea,
"0 1");
75 cout <<
"\n10 samples:" << endl;
76 for (
size_t i = 0;
i < 10;
i++) {
77 auto sample = chordal->sample();
const gtsam::Symbol key('X', 0)
DiscreteValues optimize(OptionalOrderingType orderingType={}) const
Find the maximum probable explanation (MPE) by doing max-product.
static enum @1107 ordering
void add(Args &&... args)
const KeyFormatter & formatter
static const DiscreteKey XRay(2, 2)
static const DiscreteKey Tuberculosis(3, 2)
std::shared_ptr< BayesNetType > eliminateSequential(OptionalOrderingType orderingType={}, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const
A class for computing marginals in a DiscreteFactorGraph.
int main(int argc, char **argv)
std::shared_ptr< This > shared_ptr
static const DiscreteKey LungCancer(6, 2)
void add(const DiscreteKey &key, const std::string &spec)
std::pair< Key, size_t > DiscreteKey
std::shared_ptr< BayesTreeType > eliminateMultifrontal(OptionalOrderingType orderingType={}, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const
static const DiscreteKey Dyspnea(1, 2)
static const DiscreteKey Smoking(4, 2)
static const DiscreteKey Bronchitis(7, 2)
static const DiscreteKey Either(5, 2)
std::uint64_t Key
Integer nonlinear key type.
void print(const std::string &s="BayesNet", const KeyFormatter &formatter=DefaultKeyFormatter) const override