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

Method post

test/int/circuit.cpp:126–140  ·  view source on GitHub ↗

Post path constraint on \a x

Source from the content-addressed store, hash-verified

124 }
125 /// Post path constraint on \a x
126 virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
127 int n = x.size() - 2;
128 Gecode::IntVarArgs xx(n);
129 if (offset > 0) {
130 for (int i=n; i--;)
131 xx[i] = Gecode::expr(home, x[i]+offset);
132 Gecode::path(home, offset, xx,
133 Gecode::expr(home, x[n]+offset),
134 Gecode::expr(home, x[n+1]+offset),ipl);
135 } else {
136 for (int i=n; i--;)
137 xx[i] = x[i];
138 Gecode::path(home, xx, x[n], x[n+1], ipl);
139 }
140 }
141 };
142
143 /// Simple test for circuit constraint with total cost

Callers

nothing calls this directly

Calls 3

pathFunction · 0.85
exprFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected