MCPcopy Create free account
hub / github.com/Gecode/gecode / disabled

Method disabled

test/int.cpp:366–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

364 }
365
366 bool
367 TestSpace::disabled(const Assignment& a, TestSpace& c, bool testfix, Gecode::Support::RandomGenerator& rand) {
368 using namespace Gecode;
369 // Disable propagators
370 c.disable();
371 // Select variable to be pruned
372 int i = rndvar(rand);
373 // Select mode for pruning
374 IntRelType irt;
375 int v;
376 rndrel(a, i, irt, v, rand);
377 if (irt != IRT_EQ) {
378 rel(i, irt, v);
379 c.rel(i, irt, v);
380 }
381 // Enable propagators
382 c.enable();
383 if (!testfix)
384 return true;
385 if (failed()) {
386 if (!c.failed()) {
387 if (opt.log)
388 olog << ind(3) << "No failure on disabled copy" << std::endl;
389 return false;
390 }
391 return true;
392 }
393 if (c.failed()) {
394 if (opt.log)
395 olog << ind(3) << "Failure on disabled copy" << std::endl;
396 return false;
397 }
398 for (int j=x.size(); j--; ) {
399 if (x[j].size() != c.x[j].size()) {
400 if (opt.log)
401 olog << ind(4) << "Different domain size" << std::endl;
402 return false;
403 }
404 if (reified && (r.var().size() != c.r.var().size())) {
405 if (opt.log)
406 olog << ind(4) << "Different control variable" << std::endl;
407 return false;
408 }
409 }
410 return true;
411 }
412
413 unsigned int
414 TestSpace::propagators(void) {

Callers 1

runMethod · 0.45

Calls 8

indClass · 0.85
relFunction · 0.50
disableMethod · 0.45
relMethod · 0.45
enableMethod · 0.45
failedMethod · 0.45
sizeMethod · 0.45
varMethod · 0.45

Tested by

no test coverage detected