MCPcopy Create free account
hub / github.com/davisking/dlib / factor_value_disagreement

Method factor_value_disagreement

dlib/test/graph_cuts.cpp:271–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269 }
270
271 value_type factor_value_disagreement (unsigned long idx1, unsigned long idx2) const
272 {
273 ++count;
274 DLIB_TEST(idx1 != idx2);
275 DLIB_TEST(idx1 < (unsigned long)number_of_nodes());
276 DLIB_TEST(idx2 < (unsigned long)number_of_nodes());
277
278 // make this function symmetric
279 if (idx1 > idx2)
280 swap(idx1,idx2);
281
282
283 DLIB_TEST(get_neighbor(idx1, get_neighbor_idx(idx1, idx2)) == idx2);
284 DLIB_TEST(get_neighbor(idx2, get_neighbor_idx(idx2, idx1)) == idx1);
285
286 // the neighbor relationship better be symmetric
287 DLIB_TEST(get_neighbor_idx(idx1,idx2) < number_of_neighbors(idx1));
288 DLIB_TEST_MSG(get_neighbor_idx(idx2,idx1) < number_of_neighbors(idx2),
289 "\n idx1: "<< idx1 <<
290 "\n idx2: "<< idx2 <<
291 "\n get_neighbor_idx(idx2,idx1): "<< get_neighbor_idx(idx2,idx1) <<
292 "\n number_of_neighbors(idx2): " << number_of_neighbors(idx2) <<
293 "\n nr: "<< nr <<
294 "\n nc: "<< nc
295 );
296
297 return factors2(idx1, get_neighbor_idx(idx1,idx2));
298 }
299
300 private:
301 point get_loc (

Callers

nothing calls this directly

Calls 1

swapFunction · 0.70

Tested by

no test coverage detected