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

Function remax

gecode/set/int.cpp:120–129  ·  view source on GitHub ↗

Reify \a m to be the maximum of \a s

Source from the content-addressed store, hash-verified

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

Callers 1

relFunction · 0.85

Calls 5

cardinalityFunction · 0.70
relFunction · 0.70
maxFunction · 0.70
modeMethod · 0.45
varMethod · 0.45

Tested by

no test coverage detected