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

Function array_assigned

gecode/int/sorted/sortsup.hpp:383–484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

381
382 template<class View, bool Perm>
383 inline bool
384 array_assigned(Space& home,
385 ViewArray<View>& x,
386 ViewArray<View>& y,
387 ViewArray<View>& z,
388 bool& subsumed,
389 bool& match_fixed,
390 bool&,
391 bool& noperm_bc) {
392
393 bool x_complete = true;
394 bool y_complete = true;
395 bool z_complete = true;
396
397 for (int i=0; i<y.size(); i++) {
398 x_complete &= x[i].assigned();
399 y_complete &= y[i].assigned();
400 if (Perm) {
401 z_complete &= z[i].assigned();
402 }
403 }
404
405 if (x_complete) {
406 for (int i=0; i<x.size(); i++) {
407 ModEvent me = y[i].eq(home, x[i].val());
408 if (me_failed(me)) {
409 return false;
410 }
411 }
412 if (Perm) {
413 subsumed = false;
414 } else {
415 subsumed = true;
416 }
417 }
418
419 if (y_complete) {
420 bool y_equality = true;
421 for (int i=1; i<y.size(); i++) {
422 y_equality &= (y[i-1].val() == y[i].val());
423 }
424 if (y_equality) {
425 for (int i=0; i<x.size(); i++) {
426 ModEvent me = x[i].eq(home, y[i].val());
427 if (me_failed(me)) {
428 return false;
429 }
430 }
431 if (Perm) {
432 subsumed = false;
433 } else {
434 subsumed = true;
435 }
436 noperm_bc = true;
437 }
438 }
439
440 if (Perm) {

Callers

nothing calls this directly

Calls 7

me_failedFunction · 0.85
sizeMethod · 0.45
assignedMethod · 0.45
eqMethod · 0.45
valMethod · 0.45
maxMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected