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

Method arg2floatvarargs

gecode/flatzinc/flatzinc.cpp:2538–2558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2536 return fa;
2537 }
2538 FloatVarArgs
2539 FlatZincSpace::arg2floatvarargs(AST::Node* arg, int offset) {
2540 AST::Array* a = arg->getArray();
2541 if (a->a.size() == 0) {
2542 FloatVarArgs emptyFa(0);
2543 return emptyFa;
2544 }
2545 FloatVarArgs fa(a->a.size()+offset);
2546 for (int i=offset; i--;)
2547 fa[i] = FloatVar(*this, 0.0, 0.0);
2548 for (int i=a->a.size(); i--;) {
2549 if (a->a[i]->isFloatVar()) {
2550 fa[i+offset] = fv[a->a[i]->getFloatVar()];
2551 } else {
2552 double value = a->a[i]->getFloat();
2553 FloatVar fv(*this, value, value);
2554 fa[i+offset] = fv;
2555 }
2556 }
2557 return fa;
2558 }
2559 FloatVar
2560 FlatZincSpace::arg2FloatVar(AST::Node* n) {
2561 FloatVar x0;

Callers 2

p_float_lin_cmpFunction · 0.80
p_float_lin_cmp_reifFunction · 0.80

Calls 6

getArrayMethod · 0.80
isFloatVarMethod · 0.80
getFloatVarMethod · 0.80
getFloatMethod · 0.80
FloatVarClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected