10 #include <boost/assign/std/map.hpp> 17 using namespace gtsam;
25 DiscreteKey ID(0, nrColors), UT(2, nrColors), AZ(1, nrColors);
47 DiscreteKey ID(0, nrColors), UT(2, nrColors), AZ(1, nrColors);
56 invalid[
ID.first] = 0;
57 invalid[UT.first] = 0;
58 invalid[AZ.first] = 0;
77 insert(expected)(
ID.first, 1)(UT.first, 0)(AZ.first, 1);
89 WA(0, nrColors),
OR(3, nrColors), CA(1, nrColors),NV(2, nrColors),
90 ID(8, nrColors), UT(9, nrColors), AZ(10, nrColors),
91 MT(4, nrColors), WY(5, nrColors), CO(7, nrColors),
NM(6, nrColors);
120 ordering +=
Key(0),
Key(1),
Key(2),
Key(3),
Key(4),
Key(5),
Key(6),
Key(7),
Key(8),
Key(9),
Key(10);
125 (WA.first,1)(CA.first,1)(NV.first,3)(
OR.first,0)
126 (MT.first,1)(WY.first,0)(NM.first,3)(CO.first,2)
127 (
ID.first,2)(UT.first,1)(AZ.first,0);
137 VariableIndexOrdered index(csp);
138 index.print(
"index");
139 ofstream
os(
"/Users/dellaert/src/hmetis-1.5-osx-i686/US-West-dual.txt");
140 index.outputMetisFormat(os);
149 DiscreteKey ID(0, nrColors), UT(2, nrColors), AZ(1, nrColors);
153 vector<DiscreteKey> dkeys;
170 "0 0 0 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0");
175 invalid[
ID.first] = 0;
176 invalid[UT.first] = 1;
177 invalid[AZ.first] = 0;
190 insert(expected)(
ID.first, 1)(UT.first, 0)(AZ.first, 2);
195 vector<Domain> domains;
static int runAllTests(TestResult &result)
static enum @843 ordering
DecisionTreeFactor toDecisionTreeFactor() const override
Convert into a decisiontree, can be very expensive !
double f2(const Vector2 &x)
#define EXPECT_DOUBLES_EQUAL(expected, actual, threshold)
Constraint::shared_ptr partiallyApply(const Values &values) const override
Partially apply known values.
TEST_UNSAFE(BinaryAllDif, allInOne)
bool ensureArcConsistency(size_t j, std::vector< Domain > &domains) const override
DecisionTreeFactor toDecisionTreeFactor() const override
Convert into a decisiontree.
std::pair< Key, size_t > DiscreteKey
#define EXPECT(condition)
void runArcConsistency(size_t cardinality, size_t nrIterations=10, bool print=false) const
Array< double, 1, 3 > e(1./3., 0.5, 2.)
boost::shared_ptr< DiscreteFactor > shared_ptr
shared_ptr to this class
DecisionTreeFactor toDecisionTreeFactor() const override
Convert into a decisiontree.
#define LONGS_EQUAL(expected, actual)
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
ofstream os("timeSchurFactors.csv")
void addAllDiff(const DiscreteKey &key1, const DiscreteKey &key2)
Add a binary AllDiff constraint.
Point2 f1(const Point3 &p, OptionalJacobian< 2, 3 > H)
double f4(double x, double y, double z)
Constraint::shared_ptr partiallyApply(const Values &) const override
Partially apply known values.
DecisionTreeFactor toDecisionTreeFactor() const override
Convert into a decisiontree.
double f3(double x1, double x2)
boost::shared_ptr< Values > sharedValues
void addSingleValue(const DiscreteKey &dkey, size_t value)
Add a unary constraint, allowing only a single value.
std::uint64_t Key
Integer nonlinear key type.
DecisionTreeFactor product() const
bool ensureArcConsistency(size_t j, std::vector< Domain > &domains) const override
sharedValues optimalAssignment() const
Find the best total assignment - can be expensive.
void product(const MatrixType &m)
All noise models live in the noiseModel namespace.