19 #include <boost/assign/std/map.hpp> 20 #include <boost/assign/std/vector.hpp> 21 #include <boost/make_shared.hpp> 29 using namespace gtsam;
37 boost::make_shared<DiscreteConditional>(
X |
Y =
"1/1 2/3 1/4");
41 EXPECT(expected1->endParents() == expected1->end());
42 EXPECT(expected1->endFrontals() == expected1->beginParents());
49 "0.2 0.5 0.3 0.6 0.4 0.7 0.25 0.55 0.35 0.65 0.45 0.75");
64 auto actual1 = boost::make_shared<DiscreteConditional>(
X |
Y =
table);
71 X & Y & Z,
"0.2 0.5 0.3 0.6 0.4 0.7 0.25 0.55 0.35 0.65 0.45 0.75");
92 Signature signature((
C |
B, A) =
"4/1 1/1 1/1 1/4");
101 vector<DiscreteConditional::shared_ptr>
c;
102 c.push_back(boost::make_shared<DiscreteConditional>(
A | B =
"1/2 2/1"));
103 c.push_back(boost::make_shared<DiscreteConditional>(B %
"1/2"));
106 auto expected = DiscreteConditional::Combine(c.begin(), c.end());
DecisionTreeFactor::shared_ptr toFactor() const
static int runAllTests(TestResult &result)
double f2(const Vector2 &x)
Matrix< SCALARB, Dynamic, Dynamic > B
std::pair< Key, size_t > DiscreteKey
#define EXPECT(condition)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
shared_ptr sum(size_t nrFrontals) const
Create new factor by summing all values with the same separator values.
boost::shared_ptr< This > shared_ptr
shared_ptr to this class
std::vector< double > Row
Matrix< Scalar, Dynamic, Dynamic > C
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
TEST(DiscreteConditional, constructors)
#define EXPECT_LONGS_EQUAL(expected, actual)
Point2 f1(const Point3 &p, OptionalJacobian< 2, 3 > H)
boost::shared_ptr< DecisionTreeFactor > shared_ptr