From ac0f1081063b7af048561323204e21f309cb3d0f Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Mon, 5 Aug 2013 22:31:15 +0000 Subject: [PATCH] Removed redundant test --- tests/testInferenceB.cpp | 89 ---------------------------------------- 1 file changed, 89 deletions(-) delete mode 100644 tests/testInferenceB.cpp diff --git a/tests/testInferenceB.cpp b/tests/testInferenceB.cpp deleted file mode 100644 index 64bdd480c..000000000 --- a/tests/testInferenceB.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* ---------------------------------------------------------------------------- - - * GTSAM Copyright 2010, Georgia Tech Research Corporation, - * Atlanta, Georgia 30332-0415 - * All Rights Reserved - * Authors: Frank Dellaert, et al. (see THANKS for the full author list) - - * See LICENSE for the license information - - * -------------------------------------------------------------------------- */ - -/** - * @file testInferenceB.cpp - * @brief Unit tests for functionality declared in inference.h - * @author Frank Dellaert - */ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -using namespace std; -using namespace gtsam; - -// Convenience for named keys -using symbol_shorthand::X; -using symbol_shorthand::L; - -/* ************************************************************************* */ -// The tests below test the *generic* inference algorithms. Some of these have -// specialized versions in the derived classes GaussianFactorGraph etc... -/* ************************************************************************* */ - -/* ************************************************************************* */ -TEST( inference, marginals ) -{ - using namespace example; - // create and marginalize a small Bayes net on "x" - GaussianBayesNetOrdered cbn = createSmallGaussianBayesNet(); - vector xvar; xvar.push_back(0); - GaussianBayesNetOrdered actual = *GaussianSequentialSolver( - *GaussianSequentialSolver(GaussianFactorGraphOrdered(cbn)).jointFactorGraph(xvar)).eliminate(); - - // expected is just scalar Gaussian on x - GaussianBayesNetOrdered expected = scalarGaussian(0, 4, sqrt(2.0)); - CHECK(assert_equal(expected,actual)); -} - -/* ************************************************************************* */ -TEST( inference, marginals2) -{ - NonlinearFactorGraph fg; - SharedDiagonal poseModel(noiseModel::Isotropic::Sigma(3, 0.1)); - SharedDiagonal pointModel(noiseModel::Isotropic::Sigma(2, 0.1)); - - fg.add(PriorFactor(X(0), Pose2(), poseModel)); - fg.add(BetweenFactor(X(0), X(1), Pose2(1.0,0.0,0.0), poseModel)); - fg.add(BetweenFactor(X(1), X(2), Pose2(1.0,0.0,0.0), poseModel)); - fg.add(BearingRangeFactor(X(0), L(0), Rot2(), 1.0, pointModel)); - fg.add(BearingRangeFactor(X(1), L(0), Rot2(), 1.0, pointModel)); - fg.add(BearingRangeFactor(X(2), L(0), Rot2(), 1.0, pointModel)); - - Values init; - init.insert(X(0), Pose2(0.0,0.0,0.0)); - init.insert(X(1), Pose2(1.0,0.0,0.0)); - init.insert(X(2), Pose2(2.0,0.0,0.0)); - init.insert(L(0), Point2(1.0,1.0)); - - OrderingOrdered ordering(*fg.orderingCOLAMD(init)); - FactorGraphOrdered::shared_ptr gfg(fg.linearize(init, ordering)); - GaussianMultifrontalSolver solver(*gfg); - solver.marginalFactor(ordering[L(0)]); -} - -/* ************************************************************************* */ -int main() { TestResult tr; return TestRegistry::runAllTests(tr);} -/* ************************************************************************* */