diff --git a/.cproject b/.cproject index 575aece52..f2cb2c0fa 100644 --- a/.cproject +++ b/.cproject @@ -302,6 +302,7 @@ make + all true true @@ -309,6 +310,7 @@ make + clean true true @@ -316,6 +318,7 @@ make + check true true @@ -323,6 +326,7 @@ make + testGaussianConditional.run true true @@ -330,6 +334,7 @@ make + testGaussianFactor.run true true @@ -337,6 +342,7 @@ make + timeGaussianFactor.run true true @@ -344,6 +350,7 @@ make + timeVectorConfig.run true true @@ -351,6 +358,7 @@ make + testVectorBTree.run true true @@ -358,6 +366,7 @@ make + testVectorMap.run true true @@ -365,6 +374,7 @@ make + testNoiseModel.run true true @@ -372,6 +382,7 @@ make + testBayesNetPreconditioner.run true true @@ -379,6 +390,7 @@ make + testErrors.run true false @@ -386,7 +398,6 @@ make - check true true @@ -394,7 +405,6 @@ make - tests/testSPQRUtil.run true true @@ -402,6 +412,7 @@ make + check true true @@ -409,6 +420,7 @@ make + tests/testGaussianJunctionTree.run true true @@ -416,7 +428,6 @@ make - check true true @@ -424,7 +435,6 @@ make - clean true true @@ -432,7 +442,6 @@ make - testBTree.run true true @@ -440,7 +449,6 @@ make - testDSF.run true true @@ -448,7 +456,6 @@ make - testDSFVector.run true true @@ -456,7 +463,6 @@ make - testMatrix.run true true @@ -464,7 +470,6 @@ make - testSPQRUtil.run true true @@ -472,7 +477,6 @@ make - testVector.run true true @@ -480,7 +484,6 @@ make - timeMatrix.run true true @@ -488,7 +491,6 @@ make - all true true @@ -496,6 +498,7 @@ make + all true true @@ -503,6 +506,7 @@ make + clean true true @@ -518,6 +522,7 @@ make + testBayesTree.run true false @@ -525,6 +530,7 @@ make + testBinaryBayesNet.run true false @@ -532,6 +538,7 @@ make + testFactorGraph.run true true @@ -539,6 +546,7 @@ make + testISAM.run true true @@ -546,6 +554,7 @@ make + testJunctionTree.run true true @@ -553,6 +562,7 @@ make + testKey.run true true @@ -560,6 +570,7 @@ make + testOrdering.run true true @@ -567,6 +578,7 @@ make + testSymbolicBayesNet.run true false @@ -574,6 +586,7 @@ make + testSymbolicFactor.run true false @@ -581,6 +594,7 @@ make + testSymbolicFactorGraph.run true false @@ -588,6 +602,7 @@ make + timeSymbolMaps.run true true @@ -595,6 +610,7 @@ make + check true true @@ -602,6 +618,7 @@ make + testClusterTree.run true true @@ -609,6 +626,7 @@ make + testJunctionTree.run true true @@ -616,6 +634,7 @@ make + testEliminationTree.run true true @@ -623,7 +642,6 @@ make - check true true @@ -631,7 +649,6 @@ make - testGaussianFactorGraph.run true true @@ -639,7 +656,6 @@ make - testGaussianISAM.run true true @@ -647,7 +663,6 @@ make - testGaussianISAM2.run true true @@ -655,7 +670,6 @@ make - testGraph.run true false @@ -663,7 +677,6 @@ make - testIterative.run true true @@ -671,7 +684,6 @@ make - testNonlinearEquality.run true true @@ -679,7 +691,6 @@ make - testNonlinearFactor.run true true @@ -687,7 +698,6 @@ make - testNonlinearFactorGraph.run true true @@ -695,7 +705,6 @@ make - testNonlinearOptimizer.run true true @@ -703,7 +712,6 @@ make - testSQP.run true true @@ -711,7 +719,6 @@ make - testSubgraphPreconditioner.run true true @@ -719,7 +726,6 @@ make - testTupleConfig.run true true @@ -727,7 +733,6 @@ make - timeGaussianFactorGraph.run true true @@ -735,7 +740,6 @@ make - testBayesNetPreconditioner.run true true @@ -743,7 +747,6 @@ make - testConstraintOptimizer.run true true @@ -751,7 +754,6 @@ make - testInference.run true false @@ -759,7 +761,6 @@ make - testGaussianBayesNet.run true false @@ -767,7 +768,6 @@ make - testGaussianFactor.run true false @@ -775,7 +775,6 @@ make - testJunctionTree.run true false @@ -783,7 +782,6 @@ make - testSymbolicBayesNet.run true false @@ -791,7 +789,6 @@ make - testSymbolicFactorGraph.run true false @@ -799,6 +796,7 @@ make + clean true true @@ -806,6 +804,7 @@ make + all true true @@ -813,6 +812,7 @@ make + testNonlinearConstraint.run true true @@ -820,6 +820,7 @@ make + testLieConfig.run true true @@ -827,6 +828,7 @@ make + testConstraintOptimizer.run true true @@ -834,6 +836,7 @@ make + install true true @@ -841,6 +844,7 @@ make + clean true true @@ -848,7 +852,6 @@ make - all true true @@ -856,7 +859,6 @@ make - clean true true @@ -864,7 +866,6 @@ make - all true true @@ -872,7 +873,6 @@ make - clean true true @@ -880,7 +880,6 @@ make - all true true @@ -888,7 +887,6 @@ make - clean true true @@ -896,6 +894,7 @@ make + all true true @@ -903,6 +902,7 @@ make + clean true true @@ -910,7 +910,6 @@ make - clean all true true @@ -918,7 +917,6 @@ make - all true true @@ -926,7 +924,6 @@ make - check true true @@ -934,7 +931,6 @@ make - clean true true @@ -942,7 +938,6 @@ make - testPlanarSLAM.run true true @@ -950,7 +945,6 @@ make - testPose2Config.run true true @@ -958,7 +952,6 @@ make - testPose2Factor.run true true @@ -966,7 +959,6 @@ make - testPose2Prior.run true true @@ -974,7 +966,6 @@ make - testPose2SLAM.run true true @@ -982,7 +973,6 @@ make - testPose3Config.run true true @@ -990,7 +980,6 @@ make - testPose3SLAM.run true true @@ -998,7 +987,6 @@ make - testSimulated2DOriented.run true false @@ -1006,7 +994,6 @@ make - testVSLAMConfig.run true true @@ -1014,7 +1001,6 @@ make - testVSLAMFactor.run true true @@ -1022,7 +1008,6 @@ make - testVSLAMGraph.run true true @@ -1030,7 +1015,6 @@ make - testPose3Factor.run true true @@ -1038,7 +1022,6 @@ make - testSimulated2D.run true false @@ -1046,7 +1029,6 @@ make - testSimulated3D.run true false @@ -1054,7 +1036,6 @@ make - check true true @@ -1062,15 +1043,6 @@ make - - check - true - true - true - - - make - check true true @@ -1094,11 +1066,103 @@ make + clean true true true + + make + check + true + true + true + + + make + testRot3.run + true + true + true + + + make + testRot2.run + true + true + true + + + make + testPose3.run + true + true + true + + + make + timeRot3.run + true + true + true + + + make + testPose2.run + true + true + true + + + make + testCal3_S2.run + true + true + true + + + make + testSimpleCamera.run + true + true + true + + + make + testHomography2.run + true + true + true + + + make + testCalibratedCamera.run + true + true + true + + + make + check + true + true + true + + + make + clean + true + true + true + + + make + testPoint2.run + true + true + true + make -j2 @@ -1125,7 +1189,6 @@ make - all true true @@ -1133,110 +1196,14 @@ make - dist true true true - - make - - testRot3.run - true - true - true - - - make - - testRot2.run - true - true - true - - - make - - testPose3.run - true - true - true - - - make - - timeRot3.run - true - true - true - - - make - - testPose2.run - true - true - true - - - make - - testCal3_S2.run - true - true - true - - - make - - testSimpleCamera.run - true - true - true - - - make - - testHomography2.run - true - true - true - - - make - - testCalibratedCamera.run - true - true - true - - - make - - check - true - true - true - - - make - - clean - true - true - true - - - make - - testPoint2.run - true - true - true - make + check true true @@ -1244,6 +1211,7 @@ make + testGaussianJunctionTree.run true true @@ -1251,13 +1219,23 @@ make + testGaussianFactorGraph.run true true true + + make + + timeGaussianFactorGraph.run + true + true + true + make + check true true @@ -1265,6 +1243,7 @@ make + clean true true @@ -1272,6 +1251,7 @@ make + install true true @@ -1279,6 +1259,7 @@ make + all true true diff --git a/inference/Key.h b/inference/Key.h index c2fac37a1..927211831 100644 --- a/inference/Key.h +++ b/inference/Key.h @@ -198,10 +198,12 @@ namespace gtsam { public: + typedef TypedSymbol Base; + // Constructors: TypedLabeledSymbol() {} - TypedLabeledSymbol(size_t j, L label):TypedSymbol(j), label_(label) {} + TypedLabeledSymbol(size_t j, L label) : Base(j), label_(label) {} /** Constructor that decodes encoded labels */ TypedLabeledSymbol(const Symbol& sym) : TypedSymbol(0) { @@ -210,6 +212,9 @@ namespace gtsam { label_ = (L) (sym.index() >> shift); // remove lower bits } + /** Constructor to upgrade an existing typed label with a label */ + TypedLabeledSymbol(const Base& key, L label) : Base(key.index()), label_(label) {} + // Get stuff: L label() const { return label_;} diff --git a/inference/tests/testKey.cpp b/inference/tests/testKey.cpp index c29711b44..87ddad611 100644 --- a/inference/tests/testKey.cpp +++ b/inference/tests/testKey.cpp @@ -33,14 +33,19 @@ TEST ( TypedSymbol, basic_operations ) { /* ************************************************************************* */ TEST ( TypedLabledSymbol, basic_operations ) { + typedef TypedSymbol SimpleKey; typedef TypedLabeledSymbol RobotKey; + SimpleKey key7(1); RobotKey key1(0, 1), key2(0, 1), key3(1, 1), key4(2, 1), key5(0, 2), - key6(1, 2); + key6(1, 2), + key8(1, 3), + key9(key7, 3); + CHECK(key1.label()==1); CHECK(key1.index()==0); @@ -52,6 +57,7 @@ TEST ( TypedLabledSymbol, basic_operations ) { CHECK(!(key1 == key5)); CHECK(key1 < key5); CHECK(key5 < key6); + CHECK(assert_equal(key9, key8)); } /* ************************************************************************* */ @@ -82,48 +88,6 @@ TEST ( TypedLabledSymbol, encoding ) { CHECK(assert_equal(key1, RobotKey(act1))); } -/* ************************************************************************* * -TEST ( TypedLabledSymbol, symbol_translation ) { - typedef TypedLabeledSymbol Key; - - Key key1(0, 'A'), - key2(1, 'A'), - key3(0, 'B'), - key4(1, 'B'); - - LabeledSymbol act1(key1), act2(key2), act3(key3), act4(key4); - LabeledSymbol exp1('x', 0, 'A'), - exp2('x', 1, 'A'), - exp3('x', 0, 'B'), - exp4('x', 1, 'B'); - CHECK(assert_equal(exp1, act1)); - CHECK(assert_equal(exp2, act2)); - CHECK(assert_equal(exp3, act3)); - CHECK(assert_equal(exp4, act4)); - -} - -/* ************************************************************************* * -TEST ( TypedLabledSymbol, symbol_comparison ) { - typedef TypedLabeledSymbol Key1; - typedef TypedSymbol Key2; - - Key1 key1(0, 'A'), - key2(1, 'A'), - key3(0, 'B'), - key4(1, 'B'); - Key2 key5(0), key6(1); - - LabeledSymbol act1(key1), act2(key2), act3(key3), act4(key4); - - CHECK(act1 != act2); - CHECK(act1 != act3); - CHECK(act1 != act4); - CHECK(act1 == act1); - CHECK(act1 < act2); - CHECK(act1 < act3); -} - /* ************************************************************************* */ TEST ( Key, keys2symbols ) {