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

Method isBoolArray

gecode/flatzinc/flatzinc.cpp:2479–2499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2477 return x0;
2478 }
2479 bool
2480 FlatZincSpace::isBoolArray(AST::Node* b, int& singleInt) {
2481 AST::Array* a = b->getArray();
2482 singleInt = -1;
2483 if (a->a.size() == 0)
2484 return true;
2485 for (int i=a->a.size(); i--;) {
2486 if (a->a[i]->isBoolVar() || a->a[i]->isBool()) {
2487 } else if (a->a[i]->isIntVar()) {
2488 if (aliasBool2Int(a->a[i]->getIntVar()) == -1) {
2489 if (singleInt != -1) {
2490 return false;
2491 }
2492 singleInt = i;
2493 }
2494 } else {
2495 return false;
2496 }
2497 }
2498 return singleInt==-1 || a->a.size() > 1;
2499 }
2500#ifdef GECODE_HAS_SET_VARS
2501 SetVar
2502 FlatZincSpace::arg2SetVar(AST::Node* n) {

Callers 2

p_int_lin_CMPFunction · 0.80
p_int_lin_CMP_reifFunction · 0.80

Calls 6

getArrayMethod · 0.80
isBoolVarMethod · 0.80
isBoolMethod · 0.80
isIntVarMethod · 0.80
getIntVarMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected