Rewrite all inequations in terms of IRT_LQ
| 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 |