added missing include to satisfy stricter compiler; added isam test file
parent
4f7d31986c
commit
f56bf8c79f
|
@ -12,6 +12,7 @@
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <stdexcept>
|
||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
#include <boost/tuple/tuple.hpp>
|
#include <boost/tuple/tuple.hpp>
|
||||||
#include <colamd/colamd.h>
|
#include <colamd/colamd.h>
|
||||||
|
|
|
@ -64,13 +64,15 @@ example = smallExample.cpp
|
||||||
headers += inference.h inference-inl.h
|
headers += inference.h inference-inl.h
|
||||||
headers += FactorGraph.h FactorGraph-inl.h
|
headers += FactorGraph.h FactorGraph-inl.h
|
||||||
headers += BayesNet.h BayesNet-inl.h BayesTree.h BayesTree-inl.h
|
headers += BayesNet.h BayesNet-inl.h BayesTree.h BayesTree-inl.h
|
||||||
check_PROGRAMS += testFactorgraph testBayesTree testInference
|
check_PROGRAMS += testFactorgraph testBayesTree testInference testIncremental
|
||||||
testFactorgraph_SOURCES = testFactorgraph.cpp
|
testFactorgraph_SOURCES = testFactorgraph.cpp
|
||||||
testBayesTree_SOURCES = $(example) testBayesTree.cpp
|
testBayesTree_SOURCES = $(example) testBayesTree.cpp
|
||||||
testInference_SOURCES = $(example) testInference.cpp
|
testInference_SOURCES = $(example) testInference.cpp
|
||||||
|
testIncremental_SOURCES = $(example) testIncremental.cpp
|
||||||
testFactorgraph_LDADD = libgtsam.la
|
testFactorgraph_LDADD = libgtsam.la
|
||||||
testBayesTree_LDADD = libgtsam.la
|
testBayesTree_LDADD = libgtsam.la
|
||||||
testInference_LDADD = libgtsam.la
|
testInference_LDADD = libgtsam.la
|
||||||
|
testIncremental_LDADD = libgtsam.la
|
||||||
|
|
||||||
# Symbolic Inference
|
# Symbolic Inference
|
||||||
headers += SymbolicConditional.h
|
headers += SymbolicConditional.h
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
/**
|
||||||
|
* @file testIncremental.cpp
|
||||||
|
* @brief Unit tests for graph-based iSAM
|
||||||
|
* @author Michael Kaess
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <boost/assign/std/list.hpp> // for operator +=
|
||||||
|
using namespace boost::assign;
|
||||||
|
|
||||||
|
#include <CppUnitLite/TestHarness.h>
|
||||||
|
|
||||||
|
#include "SymbolicBayesNet.h"
|
||||||
|
#include "GaussianBayesNet.h"
|
||||||
|
#include "Ordering.h"
|
||||||
|
#include "BayesTree-inl.h"
|
||||||
|
#include "smallExample.h"
|
||||||
|
|
||||||
|
using namespace gtsam;
|
||||||
|
|
||||||
|
typedef BayesTree<SymbolicConditional> SymbolicBayesTree;
|
||||||
|
typedef BayesTree<GaussianConditional> GaussianBayesTree;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// todo: copied from testBayesTree
|
||||||
|
|
||||||
|
|
||||||
|
// Conditionals for ASIA example from the tutorial with A and D evidence
|
||||||
|
SymbolicConditional::shared_ptr B(new SymbolicConditional("B")), L(
|
||||||
|
new SymbolicConditional("L", "B")), E(
|
||||||
|
new SymbolicConditional("E", "L", "B")), S(new SymbolicConditional("S",
|
||||||
|
"L", "B")), T(new SymbolicConditional("T", "E", "L")), X(
|
||||||
|
new SymbolicConditional("X", "E"));
|
||||||
|
|
||||||
|
/* ************************************************************************* */
|
||||||
|
TEST( BayesTree, Front )
|
||||||
|
{
|
||||||
|
SymbolicBayesNet f1;
|
||||||
|
f1.push_back(B);
|
||||||
|
f1.push_back(L);
|
||||||
|
SymbolicBayesNet f2;
|
||||||
|
f2.push_back(L);
|
||||||
|
f2.push_back(B);
|
||||||
|
CHECK(f1.equals(f1));
|
||||||
|
CHECK(!f1.equals(f2));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ************************************************************************* */
|
||||||
|
int main() {
|
||||||
|
TestResult tr;
|
||||||
|
return TestRegistry::runAllTests(tr);
|
||||||
|
}
|
||||||
|
/* ************************************************************************* */
|
Loading…
Reference in New Issue