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

Method arg2intvarargs

gecode/flatzinc/flatzinc.cpp:2411–2431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2409 return ia;
2410 }
2411 IntVarArgs
2412 FlatZincSpace::arg2intvarargs(AST::Node* arg, int offset) {
2413 AST::Array* a = arg->getArray();
2414 if (a->a.size() == 0) {
2415 IntVarArgs emptyIa(0);
2416 return emptyIa;
2417 }
2418 IntVarArgs ia(a->a.size()+offset);
2419 for (int i=offset; i--;)
2420 ia[i] = IntVar(*this, 0, 0);
2421 for (int i=a->a.size(); i--;) {
2422 if (a->a[i]->isIntVar()) {
2423 ia[i+offset] = iv[a->a[i]->getIntVar()];
2424 } else {
2425 int value = a->a[i]->getInt();
2426 IntVar iv(*this, value, value);
2427 ia[i+offset] = iv;
2428 }
2429 }
2430 return ia;
2431 }
2432 BoolVarArgs
2433 FlatZincSpace::arg2boolvarargs(AST::Node* arg, int offset, int siv) {
2434 AST::Array* a = arg->getArray();

Callers 15

p_distinctFunction · 0.80
p_distinctOffsetFunction · 0.80
p_all_equalFunction · 0.80
p_int_lin_CMPFunction · 0.80
p_int_lin_CMP_reifFunction · 0.80
p_array_int_elementFunction · 0.80
p_array_int_element2dFunction · 0.80
p_array_int_ltFunction · 0.80
p_array_int_lqFunction · 0.80
p_countFunction · 0.80
p_count_reifFunction · 0.80

Calls 6

getArrayMethod · 0.80
isIntVarMethod · 0.80
getIntVarMethod · 0.80
getIntMethod · 0.80
IntVarClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected