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

Method SetVarArgs

gecode/set/array.cpp:131–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129 }
130
131 SetVarArgs::SetVarArgs(Space& home,int n,
132 int lbMin,int lbMax,int ubMin,int ubMax,
133 unsigned int minCard,
134 unsigned int maxCard)
135 : VarArgArray<SetVar>(n) {
136 Set::Limits::check(lbMin,"SetVarArgs::SetVarArgs");
137 Set::Limits::check(lbMax,"SetVarArgs::SetVarArgs");
138 Set::Limits::check(ubMin,"SetVarArgs::SetVarArgs");
139 Set::Limits::check(ubMax,"SetVarArgs::SetVarArgs");
140 Set::Limits::check(maxCard,"SetVarArgs::SetVarArgs");
141 unsigned int glbSize =
142 (lbMin <= lbMax ? static_cast<unsigned int>(lbMax-lbMin+1) : 0U);
143 unsigned int lubSize =
144 (ubMin <= ubMax ? static_cast<unsigned int>(ubMax-ubMin+1) : 0U);
145 if (minCard > maxCard || minCard > lubSize || maxCard < glbSize ||
146 lbMin < ubMin || lbMax > ubMax)
147 throw Set::VariableEmptyDomain("SetVarArgs::SetVarArgs");
148 for (int i = size(); i--; )
149 a[i] = SetVar(home,lbMin,lbMax,ubMin,ubMax,minCard,maxCard);
150 }
151
152 SetVarArgs::SetVarArgs(Space& home,int n,
153 const IntSet& glb,int ubMin,int ubMax,

Callers

nothing calls this directly

Calls 6

checkFunction · 0.50
sizeFunction · 0.50
SetVarClass · 0.50
subsetFunction · 0.50
minMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected