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

Method arg2boolvarargs

gecode/flatzinc/flatzinc.cpp:2432–2457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2430 return ia;
2431 }
2432 BoolVarArgs
2433 FlatZincSpace::arg2boolvarargs(AST::Node* arg, int offset, int siv) {
2434 AST::Array* a = arg->getArray();
2435 if (a->a.size() == 0) {
2436 BoolVarArgs emptyIa(0);
2437 return emptyIa;
2438 }
2439 BoolVarArgs ia(a->a.size()+offset-(siv==-1?0:1));
2440 for (int i=offset; i--;)
2441 ia[i] = BoolVar(*this, 0, 0);
2442 for (int i=0; i<static_cast<int>(a->a.size()); i++) {
2443 if (i==siv)
2444 continue;
2445 if (a->a[i]->isBool()) {
2446 bool value = a->a[i]->getBool();
2447 BoolVar iv(*this, value, value);
2448 ia[offset++] = iv;
2449 } else if (a->a[i]->isIntVar() &&
2450 aliasBool2Int(a->a[i]->getIntVar()) != -1) {
2451 ia[offset++] = bv[aliasBool2Int(a->a[i]->getIntVar())];
2452 } else {
2453 ia[offset++] = bv[a->a[i]->getBoolVar()];
2454 }
2455 }
2456 return ia;
2457 }
2458 BoolVar
2459 FlatZincSpace::arg2BoolVar(AST::Node* n) {
2460 BoolVar x0;

Callers 15

p_int_lin_CMPFunction · 0.80
p_int_lin_CMP_reifFunction · 0.80
p_bool_lin_CMPFunction · 0.80
p_bool_lin_CMP_reifFunction · 0.80
p_array_bool_and_impFunction · 0.80
p_array_bool_or_impFunction · 0.80
p_array_bool_xor_impFunction · 0.80
p_array_bool_clauseFunction · 0.80
p_array_bool_clause_reifFunction · 0.80
p_array_bool_clause_impFunction · 0.80
p_array_bool_elementFunction · 0.80

Calls 8

getArrayMethod · 0.80
isBoolMethod · 0.80
getBoolMethod · 0.80
isIntVarMethod · 0.80
getIntVarMethod · 0.80
getBoolVarMethod · 0.80
BoolVarClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected