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

Function rewrite

gecode/int/linear/int-post.cpp:55–75  ·  view source on GitHub ↗

Rewrite all inequations in terms of IRT_LQ

Source from the content-addressed store, hash-verified

53
54 /// Rewrite all inequations in terms of IRT_LQ
55 forceinline void
56 rewrite(IntRelType &irt, long long int &d,
57 Term<IntView>* &t_p, int &n_p,
58 Term<IntView>* &t_n, int &n_n) {
59 switch (irt) {
60 case IRT_EQ: case IRT_NQ: case IRT_LQ:
61 break;
62 case IRT_LE:
63 d--; irt = IRT_LQ;
64 break;
65 case IRT_GR:
66 d++;
67 /* fall through */
68 case IRT_GQ:
69 irt = IRT_LQ;
70 std::swap(n_p,n_n); std::swap(t_p,t_n); d = -d;
71 break;
72 default:
73 throw UnknownRelation("Int::linear");
74 }
75 }
76
77 /// Decide the required precision and check for overflow
78 forceinline bool

Callers 1

postFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected