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

Method con

test/set/construct.cpp:53–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51 return true;
52 }
53 void con(Space& home, int glbMin, int glbMax,
54 int lubMin, int lubMax,
55 unsigned int minCard = 0,
56 unsigned int maxCard = Gecode::Set::Limits::card,
57 bool fail=true) {
58 bool ok = false;
59 try {
60 SetVar x(home, glbMin, glbMax, lubMin, lubMax, minCard, maxCard);
61 ok = true;
62 } catch (Gecode::Set::VariableEmptyDomain&) {
63 if (!fail) {
64 home.fail();
65 return;
66 }
67 ok = true;
68 }
69
70 if (ok) {
71 try {
72 SetVarArray xs(home, 1,
73 glbMin, glbMax, lubMin, lubMax, minCard, maxCard);
74 } catch (Gecode::Set::VariableEmptyDomain&) {
75 if (!fail) {
76 home.fail();
77 return;
78 } else {
79 return;
80 }
81 }
82 if (fail) {
83 home.fail();
84 }
85 }
86 }
87 void con(Space& home, const IntSet& glb, int lubMin, int lubMax,
88 unsigned int minCard = 0,
89 unsigned int maxCard = Gecode::Set::Limits::card,

Callers

nothing calls this directly

Calls 1

failMethod · 0.45

Tested by

no test coverage detected