From 50763ef7646eced99b6a3574289806a499a8b7e5 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Tue, 27 Oct 2009 20:44:40 +0000 Subject: [PATCH] Prototype for Bayes nets for Manohar --- cpp/testBinaryBayesNet.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 cpp/testBinaryBayesNet.cpp diff --git a/cpp/testBinaryBayesNet.cpp b/cpp/testBinaryBayesNet.cpp new file mode 100644 index 000000000..4717cac72 --- /dev/null +++ b/cpp/testBinaryBayesNet.cpp @@ -0,0 +1,27 @@ +/** + * @file testBinaryBayesNet.cpp + * @brief Unit tests for Bayes Tree + * @author Frank Dellaert + */ + +#include + +using namespace gtsam; + +/* ************************************************************************* */ +TEST( BinaryBayesNet, constructor ) +{ + map tables; + BinaryCPT pA(0.01);tables.insert("A",pA); + BinaryCPT pB("S",0.6,0.3); + BinaryBayesNet binaryBayesNet(tables); + BinaryConfig allFalse(false,false,false,...); + DOUBLES_EQUAL(0.12,binaryBayesNet.probability(allFalse)); +} + +/* ************************************************************************* */ +int main() { + TestResult tr; + return TestRegistry::runAllTests(tr); +} +/* ************************************************************************* */