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

Function remin

gecode/set/int.cpp:108–117  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

106
107 /// Reify \a m to be the minimum of \a s
108 void remin(Home home, SetVar s, IntVar m, Reify r) {
109 IntVar c(home, 0, static_cast<int>(Set::Limits::card));
110 cardinality(home, s, c);
111 // Whether set is not empty
112 BoolVar ne(home, 0, 1);
113 rel(home, c, IRT_GR, 0, ne);
114 if (r.mode() != RM_PMI)
115 rel(home, r.var(), BOT_IMP, ne, 1);
116 min(home, s, m, ne);
117 }
118
119 /// Reify \a m to be the maximum of \a s
120 void remax(Home home, SetVar s, IntVar m, Reify r) {

Callers 1

relFunction · 0.85

Calls 5

cardinalityFunction · 0.70
relFunction · 0.70
minFunction · 0.70
modeMethod · 0.45
varMethod · 0.45

Tested by

no test coverage detected