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

Function eval

test/int/mm-lin.cpp:67–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65 /// Evaluate linear instructions
66 template<class Expr>
67 Expr
68 eval(const LinInstr* pc, Expr reg[]) {
69 while (true) {
70 switch (pc->o) {
71 case LO_ACE: reg[pc->y] = pc->c + reg[pc->x]; break;
72 case LO_AEC: reg[pc->y] = reg[pc->x] + pc->c; break;
73 case LO_AEE: reg[pc->z] = reg[pc->x] + reg[pc->y]; break;
74 case LO_SCE: reg[pc->y] = pc->c - reg[pc->x]; break;
75 case LO_SEC: reg[pc->y] = reg[pc->x] - pc->c; break;
76 case LO_SEE: reg[pc->z] = reg[pc->x] - reg[pc->y]; break;
77 case LO_SE: reg[pc->y] = -reg[pc->x]; break;
78 case LO_MCE: reg[pc->y] = pc->c * reg[pc->x]; break;
79 case LO_MEC: reg[pc->y] = reg[pc->x] * pc->c; break;
80 case LO_HLT: return reg[pc->x];
81 default: GECODE_NEVER;
82 }
83 pc++;
84 }
85 GECODE_NEVER;
86 }
87
88 /**
89 * \defgroup TaskTestIntMiniModelLin Minimal modeling constraints (linear constraints)

Callers 12

solutionMethod · 0.70
postMethod · 0.70
solutionMethod · 0.70
postMethod · 0.70
solutionMethod · 0.70
postMethod · 0.70
solutionMethod · 0.70
postMethod · 0.70
solutionMethod · 0.70
postMethod · 0.70
solutionMethod · 0.70
postMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected