Reify \a m to be the maximum of \a s
| 118 | |
| 119 | /// Reify \a m to be the maximum of \a s |
| 120 | void remax(Home home, SetVar s, IntVar m, Reify r) { |
| 121 | IntVar c(home, 0, static_cast<int>(Set::Limits::card)); |
| 122 | cardinality(home, s, c); |
| 123 | // Whether set is not empty |
| 124 | BoolVar ne(home, 0, 1); |
| 125 | rel(home, c, IRT_GR, 0, ne); |
| 126 | if (r.mode() != RM_PMI) |
| 127 | rel(home, r.var(), BOT_IMP, ne, 1); |
| 128 | max(home, s, m, ne); |
| 129 | } |
| 130 | |
| 131 | }}} |
| 132 |