compiles
parent
0b3477fc5a
commit
1d79188417
|
|
@ -170,8 +170,10 @@ namespace gtsam {
|
|||
// Make lookup with product
|
||||
gttic(lookup);
|
||||
size_t nrFrontals = frontalKeys.size();
|
||||
auto lookup = std::make_shared<DiscreteLookupTable>(nrFrontals,
|
||||
orderedKeys, product);
|
||||
//TODO(Varun): Should accept a DiscreteFactor::shared_ptr
|
||||
auto lookup = std::make_shared<DiscreteLookupTable>(
|
||||
nrFrontals, orderedKeys,
|
||||
*std::dynamic_pointer_cast<TableFactor>(product));
|
||||
gttoc(lookup);
|
||||
|
||||
return {std::dynamic_pointer_cast<DiscreteConditional>(lookup), max};
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <gtsam/discrete/DiscreteDistribution.h>
|
||||
#include <gtsam/discrete/TableFactor.h>
|
||||
#include <gtsam/inference/BayesNet.h>
|
||||
#include <gtsam/inference/FactorGraph.h>
|
||||
|
||||
|
|
@ -54,6 +55,12 @@ class GTSAM_EXPORT DiscreteLookupTable : public DiscreteConditional {
|
|||
const ADT& potentials)
|
||||
: DiscreteConditional(nFrontals, keys, potentials) {}
|
||||
|
||||
//TODO(Varun): Should accept a DiscreteFactor::shared_ptr
|
||||
DiscreteLookupTable(size_t nFrontals, const DiscreteKeys& keys,
|
||||
const TableFactor& potentials)
|
||||
: DiscreteConditional(nFrontals, keys,
|
||||
potentials.toDecisionTreeFactor()) {}
|
||||
|
||||
/// GTSAM-style print
|
||||
void print(
|
||||
const std::string& s = "Discrete Lookup Table: ",
|
||||
|
|
|
|||
Loading…
Reference in New Issue