Uncommented failing code, re-enabled testScheduler - both fail to compile
parent
c50b972dd1
commit
b571a2a7ee
|
@ -16,7 +16,8 @@ set (discrete_full_libs
|
|||
gtsam_unstable-static)
|
||||
|
||||
# Exclude tests that don't work
|
||||
set (discrete_excluded_tests "${CMAKE_CURRENT_SOURCE_DIR}/tests/testScheduler.cpp")
|
||||
set (discrete_excluded_tests "")
|
||||
#"${CMAKE_CURRENT_SOURCE_DIR}/tests/testScheduler.cpp")
|
||||
|
||||
# Add all tests
|
||||
gtsam_add_subdir_tests(discrete_unstable "${discrete_local_libs}" "${discrete_full_libs}" "${discrete_excluded_tests}")
|
||||
|
|
|
@ -54,27 +54,27 @@ TEST_UNSAFE( CSP, allInOne)
|
|||
invalid[ID.first] = 0;
|
||||
invalid[UT.first] = 0;
|
||||
invalid[AZ.first] = 0;
|
||||
// EXPECT_DOUBLES_EQUAL(0, csp(invalid), 1e-9); // FIXME: fails due to lack of operator() interface
|
||||
EXPECT_DOUBLES_EQUAL(0, csp(invalid), 1e-9); // FIXME: fails due to lack of operator() interface
|
||||
|
||||
// Check a valid combination
|
||||
DiscreteFactor::Values valid;
|
||||
valid[ID.first] = 0;
|
||||
valid[UT.first] = 1;
|
||||
valid[AZ.first] = 0;
|
||||
// EXPECT_DOUBLES_EQUAL(1, csp(valid), 1e-9); // FIXME: fails due to lack of operator() interface
|
||||
EXPECT_DOUBLES_EQUAL(1, csp(valid), 1e-9); // FIXME: fails due to lack of operator() interface
|
||||
|
||||
// Just for fun, create the product and check it
|
||||
// DecisionTreeFactor product = csp.product(); // FIXME: fails due to lack of product()
|
||||
DecisionTreeFactor product = csp.product(); // FIXME: fails due to lack of product()
|
||||
// product.dot("product");
|
||||
// DecisionTreeFactor expectedProduct(ID & AZ & UT, "0 1 0 0 0 0 1 0");
|
||||
// EXPECT(assert_equal(expectedProduct,product));
|
||||
DecisionTreeFactor expectedProduct(ID & AZ & UT, "0 1 0 0 0 0 1 0");
|
||||
EXPECT(assert_equal(expectedProduct,product));
|
||||
|
||||
// Solve
|
||||
CSP::sharedValues mpe = csp.optimalAssignment();
|
||||
CSP::Values expected;
|
||||
insert(expected)(ID.first, 1)(UT.first, 0)(AZ.first, 1);
|
||||
EXPECT(assert_equal(expected,*mpe));
|
||||
// EXPECT_DOUBLES_EQUAL(1, csp(*mpe), 1e-9); // FIXME: fails due to lack of operator() interface
|
||||
EXPECT_DOUBLES_EQUAL(1, csp(*mpe), 1e-9); // FIXME: fails due to lack of operator() interface
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
@ -122,7 +122,7 @@ TEST_UNSAFE( CSP, WesternUS)
|
|||
(MT.first,1)(WY.first,0)(NM.first,3)(CO.first,2)
|
||||
(ID.first,2)(UT.first,1)(AZ.first,0);
|
||||
EXPECT(assert_equal(expected,*mpe));
|
||||
// EXPECT_DOUBLES_EQUAL(1, csp(*mpe), 1e-9); // FIXME: fails due to lack of operator() interface
|
||||
EXPECT_DOUBLES_EQUAL(1, csp(*mpe), 1e-9); // FIXME: fails due to lack of operator() interface
|
||||
|
||||
// Write out the dual graph for hmetis
|
||||
#ifdef DUAL
|
||||
|
@ -167,21 +167,21 @@ TEST_UNSAFE( CSP, AllDiff)
|
|||
invalid[ID.first] = 0;
|
||||
invalid[UT.first] = 1;
|
||||
invalid[AZ.first] = 0;
|
||||
// EXPECT_DOUBLES_EQUAL(0, csp(invalid), 1e-9); // FIXME: fails due to lack of operator() interface
|
||||
EXPECT_DOUBLES_EQUAL(0, csp(invalid), 1e-9); // FIXME: fails due to lack of operator() interface
|
||||
|
||||
// Check a valid combination
|
||||
DiscreteFactor::Values valid;
|
||||
valid[ID.first] = 0;
|
||||
valid[UT.first] = 1;
|
||||
valid[AZ.first] = 2;
|
||||
// EXPECT_DOUBLES_EQUAL(1, csp(valid), 1e-9); // FIXME: fails due to lack of operator() interface
|
||||
EXPECT_DOUBLES_EQUAL(1, csp(valid), 1e-9); // FIXME: fails due to lack of operator() interface
|
||||
|
||||
// Solve
|
||||
CSP::sharedValues mpe = csp.optimalAssignment();
|
||||
CSP::Values expected;
|
||||
insert(expected)(ID.first, 1)(UT.first, 0)(AZ.first, 2);
|
||||
EXPECT(assert_equal(expected,*mpe));
|
||||
// EXPECT_DOUBLES_EQUAL(1, csp(*mpe), 1e-9); // FIXME: fails due to lack of operator() interface
|
||||
EXPECT_DOUBLES_EQUAL(1, csp(*mpe), 1e-9); // FIXME: fails due to lack of operator() interface
|
||||
|
||||
// Arc-consistency
|
||||
vector<Domain> domains;
|
||||
|
|
Loading…
Reference in New Issue