18 using namespace gtsam;
27 using IJ = std::pair<size_t, size_t>;
33 return dkeys_.at(
IJ(
i,
j));
37 Key key(
size_t i,
size_t j)
const {
return dkey(
i,
j).first; }
44 for (
size_t i = 0;
i <
n; ++
i) {
45 for (
size_t j = 0;
j <
n; ++
j) {
51 int value = va_arg(ap,
int);
52 if (
value != 0) addSingleValue(dkeys_[ij],
value - 1);
59 for (
size_t i = 0;
i <
n;
i++) {
61 for (
size_t j = 0;
j <
n;
j++) dkeys.push_back(dkey(
i,
j));
66 for (
size_t j = 0;
j <
n;
j++) {
68 for (
size_t i = 0;
i <
n;
i++) dkeys.push_back(dkey(
i,
j));
74 for (
size_t I = 0;
I <
N;
I++) {
76 for (
size_t J = 0;
J <
N;
J++) {
80 for (
size_t j =
j0;
j <
j0 +
N;
j++) dkeys.push_back(dkey(
i,
j));
90 for (
size_t i = 0;
i < n_;
i++) {
91 for (
size_t j = 0;
j < n_;
j++) {
93 cout << 1 + assignment.at(k) <<
" ";
102 printAssignment(MPE);
107 for (
size_t i = 0;
i < n_;
i++) {
108 for (
size_t j = 0;
j < n_;
j++) {
110 cout << domains.at(k).base1Str();
130 {csp.
key(0, 2), 2}, {csp.
key(0, 3), 3},
131 {csp.
key(1, 0), 2}, {csp.
key(1, 1), 3},
132 {csp.
key(1, 2), 0}, {csp.
key(1, 3), 1},
133 {csp.
key(2, 0), 3}, {csp.
key(2, 1), 2},
134 {csp.
key(2, 2), 1}, {csp.
key(2, 3), 0},
135 {csp.
key(3, 0), 1}, {csp.
key(3, 1), 0},
136 {csp.
key(3, 2), 3}, {csp.
key(3, 3), 2}};
152 auto new_solution = new_csp.
optimize();
160 0, 0, 5, 0, 9, 0, 0, 0, 1,
161 0, 0, 0, 0, 0, 2, 0, 7, 3,
162 7, 6, 0, 0, 0, 8, 2, 0, 0,
164 0, 1, 2, 0, 0, 9, 0, 0, 4,
165 0, 0, 0, 2, 0, 3, 0, 0, 0,
166 3, 0, 0, 1, 0, 0, 9, 6, 0,
168 0, 0, 1, 9, 0, 0, 0, 5, 8,
169 9, 7, 0, 5, 0, 0, 0, 0, 0,
170 5, 0, 0, 0, 3, 0, 7, 0, 0);
178 Domain domain99 = domains.at(key99);
192 0, 0, 9, 7, 4, 8, 0, 0, 0, 7,
193 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
194 0, 1, 0, 9, 0, 0, 0, 0, 0, 7,
195 0, 0, 0, 2, 4, 0, 0, 6, 4, 0,
196 1, 0, 5, 9, 0, 0, 9, 8, 0, 0,
197 0, 3, 0, 0, 0, 0, 0, 8, 0, 3,
198 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,
199 0, 6, 0, 0, 0, 2, 7, 5, 9, 0, 0);
205 VariableIndexOrdered index(csp);
206 index.print(
"index");
207 ofstream
os(
"/Users/dellaert/src/hmetis-1.5-osx-i686/extreme-dual.txt");
208 index.outputMetisFormat(
os);
215 Domain domain99 = domains.at(key99);
229 9, 5, 0, 0, 0, 6, 0, 0, 0,
230 0, 8, 4, 0, 7, 0, 0, 0, 0,
231 6, 2, 0, 5, 0, 0, 4, 0, 0,
233 0, 0, 0, 2, 9, 0, 6, 0, 0,
234 0, 9, 0, 0, 0, 0, 0, 2, 0,
235 0, 0, 2, 0, 6, 3, 0, 0, 0,
237 0, 0, 9, 0, 0, 7, 0, 6, 8,
238 0, 0, 0, 0, 3, 0, 2, 9, 0,
239 0, 0, 0, 1, 0, 0, 0, 3, 7);
245 Domain domain99 = domains.at(key99);