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