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

Function p_int_plus

gecode/flatzinc/registry.cpp:425–439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

423 /* arithmetic constraints */
424
425 void p_int_plus(FlatZincSpace& s, const ConExpr& ce, AST::Node* ann) {
426 if (!ce[0]->isIntVar()) {
427 rel(s, ce[0]->getInt() + s.arg2IntVar(ce[1])
428 == s.arg2IntVar(ce[2]), s.ann2ipl(ann));
429 } else if (!ce[1]->isIntVar()) {
430 rel(s, s.arg2IntVar(ce[0]) + ce[1]->getInt()
431 == s.arg2IntVar(ce[2]), s.ann2ipl(ann));
432 } else if (!ce[2]->isIntVar()) {
433 rel(s, s.arg2IntVar(ce[0]) + s.arg2IntVar(ce[1])
434 == ce[2]->getInt(), s.ann2ipl(ann));
435 } else {
436 rel(s, s.arg2IntVar(ce[0]) + s.arg2IntVar(ce[1])
437 == s.arg2IntVar(ce[2]), s.ann2ipl(ann));
438 }
439 }
440
441 void p_int_minus(FlatZincSpace& s, const ConExpr& ce, AST::Node* ann) {
442 if (!ce[0]->isIntVar()) {

Callers

nothing calls this directly

Calls 5

isIntVarMethod · 0.80
getIntMethod · 0.80
arg2IntVarMethod · 0.80
ann2iplMethod · 0.80
relFunction · 0.50

Tested by

no test coverage detected