formatting
parent
a98ac0fdb2
commit
8145086e5b
|
@ -61,14 +61,14 @@ virtual class DecisionTreeFactor : gtsam::DiscreteFactor {
|
||||||
DecisionTreeFactor(const std::vector<gtsam::DiscreteKey>& keys, string table);
|
DecisionTreeFactor(const std::vector<gtsam::DiscreteKey>& keys, string table);
|
||||||
|
|
||||||
DecisionTreeFactor(const gtsam::DiscreteConditional& c);
|
DecisionTreeFactor(const gtsam::DiscreteConditional& c);
|
||||||
|
|
||||||
void print(string s = "DecisionTreeFactor\n",
|
void print(string s = "DecisionTreeFactor\n",
|
||||||
const gtsam::KeyFormatter& keyFormatter =
|
const gtsam::KeyFormatter& keyFormatter =
|
||||||
gtsam::DefaultKeyFormatter) const;
|
gtsam::DefaultKeyFormatter) const;
|
||||||
bool equals(const gtsam::DecisionTreeFactor& other, double tol = 1e-9) const;
|
bool equals(const gtsam::DecisionTreeFactor& other, double tol = 1e-9) const;
|
||||||
|
|
||||||
size_t cardinality(gtsam::Key j) const;
|
size_t cardinality(gtsam::Key j) const;
|
||||||
|
|
||||||
double operator()(const gtsam::DiscreteValues& values) const;
|
double operator()(const gtsam::DiscreteValues& values) const;
|
||||||
gtsam::DecisionTreeFactor operator*(const gtsam::DecisionTreeFactor& f) const;
|
gtsam::DecisionTreeFactor operator*(const gtsam::DecisionTreeFactor& f) const;
|
||||||
size_t cardinality(gtsam::Key j) const;
|
size_t cardinality(gtsam::Key j) const;
|
||||||
|
|
|
@ -13,9 +13,10 @@ Author: Frank Dellaert
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
from gtsam.utils.test_case import GtsamTestCase
|
||||||
|
|
||||||
from gtsam import (DecisionTreeFactor, DiscreteDistribution, DiscreteValues,
|
from gtsam import (DecisionTreeFactor, DiscreteDistribution, DiscreteValues,
|
||||||
Ordering)
|
Ordering)
|
||||||
from gtsam.utils.test_case import GtsamTestCase
|
|
||||||
|
|
||||||
|
|
||||||
class TestDecisionTreeFactor(GtsamTestCase):
|
class TestDecisionTreeFactor(GtsamTestCase):
|
||||||
|
|
|
@ -19,8 +19,8 @@ from gtsam.utils.test_case import GtsamTestCase
|
||||||
|
|
||||||
import gtsam
|
import gtsam
|
||||||
from gtsam import (DiscreteBayesNet, DiscreteBayesTreeClique,
|
from gtsam import (DiscreteBayesNet, DiscreteBayesTreeClique,
|
||||||
DiscreteConditional, DiscreteFactorGraph,
|
DiscreteConditional, DiscreteFactorGraph, DiscreteValues,
|
||||||
DiscreteValues, Ordering)
|
Ordering)
|
||||||
|
|
||||||
|
|
||||||
class TestDiscreteBayesNet(GtsamTestCase):
|
class TestDiscreteBayesNet(GtsamTestCase):
|
||||||
|
|
|
@ -13,9 +13,10 @@ Author: Varun Agrawal
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from gtsam import DecisionTreeFactor, DiscreteConditional, DiscreteKeys
|
|
||||||
from gtsam.utils.test_case import GtsamTestCase
|
from gtsam.utils.test_case import GtsamTestCase
|
||||||
|
|
||||||
|
from gtsam import DecisionTreeFactor, DiscreteConditional, DiscreteKeys
|
||||||
|
|
||||||
# Some DiscreteKeys for binary variables:
|
# Some DiscreteKeys for binary variables:
|
||||||
A = 0, 2
|
A = 0, 2
|
||||||
B = 1, 2
|
B = 1, 2
|
||||||
|
|
|
@ -14,9 +14,12 @@ Author: Frank Dellaert
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from gtsam import DecisionTreeFactor, DiscreteConditional, DiscreteFactorGraph, DiscreteKeys, DiscreteValues, Ordering, Symbol
|
|
||||||
from gtsam.utils.test_case import GtsamTestCase
|
from gtsam.utils.test_case import GtsamTestCase
|
||||||
|
|
||||||
|
from gtsam import (DecisionTreeFactor, DiscreteConditional,
|
||||||
|
DiscreteFactorGraph, DiscreteKeys, DiscreteValues, Ordering,
|
||||||
|
Symbol)
|
||||||
|
|
||||||
OrderingType = Ordering.OrderingType
|
OrderingType = Ordering.OrderingType
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue