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

Method Alpha

examples/alpha.cpp:63–106  ·  view source on GitHub ↗

Actual model

Source from the content-addressed store, hash-verified

61 };
62 /// Actual model
63 Alpha(const Options& opt)
64 : Script(opt), le(*this,n,1,n) {
65 IntVar
66 a(le[ 0]), b(le[ 1]), c(le[ 2]), e(le[ 4]), f(le[ 5]),
67 g(le[ 6]), h(le[ 7]), i(le[ 8]), j(le[ 9]), k(le[10]),
68 l(le[11]), m(le[12]), n(le[13]), o(le[14]), p(le[15]),
69 q(le[16]), r(le[17]), s(le[18]), t(le[19]), u(le[20]),
70 v(le[21]), w(le[22]), x(le[23]), y(le[24]), z(le[25]);
71
72 rel(*this, b+a+l+l+e+t == 45, opt.ipl());
73 rel(*this, c+e+l+l+o == 43, opt.ipl());
74 rel(*this, c+o+n+c+e+r+t == 74, opt.ipl());
75 rel(*this, f+l+u+t+e == 30, opt.ipl());
76 rel(*this, f+u+g+u+e == 50, opt.ipl());
77 rel(*this, g+l+e+e == 66, opt.ipl());
78 rel(*this, j+a+z+z == 58, opt.ipl());
79 rel(*this, l+y+r+e == 47, opt.ipl());
80 rel(*this, o+b+o+e == 53, opt.ipl());
81 rel(*this, o+p+e+r+a == 65, opt.ipl());
82 rel(*this, p+o+l+k+a == 59, opt.ipl());
83 rel(*this, q+u+a+r+t+e+t == 50, opt.ipl());
84 rel(*this, s+a+x+o+p+h+o+n+e == 134, opt.ipl());
85 rel(*this, s+c+a+l+e == 51, opt.ipl());
86 rel(*this, s+o+l+o == 37, opt.ipl());
87 rel(*this, s+o+n+g == 61, opt.ipl());
88 rel(*this, s+o+p+r+a+n+o == 82, opt.ipl());
89 rel(*this, t+h+e+m+e == 72, opt.ipl());
90 rel(*this, v+i+o+l+i+n == 100, opt.ipl());
91 rel(*this, w+a+l+t+z == 34, opt.ipl());
92
93 distinct(*this, le, opt.ipl());
94
95 switch (opt.branching()) {
96 case BRANCH_NONE:
97 branch(*this, le, INT_VAR_NONE(), INT_VAL_MIN());
98 break;
99 case BRANCH_INVERSE:
100 branch(*this, le.slice(le.size()-1,-1), INT_VAR_NONE(), INT_VAL_MIN());
101 break;
102 case BRANCH_SIZE:
103 branch(*this, le, INT_VAR_SIZE_MIN(), INT_VAL_MIN());
104 break;
105 }
106 }
107
108 /// Constructor for cloning \a s
109 Alpha(Alpha& s) : Script(s) {

Callers

nothing calls this directly

Calls 11

distinctFunction · 0.85
INT_VAR_NONEFunction · 0.85
INT_VAL_MINFunction · 0.85
INT_VAR_SIZE_MINFunction · 0.85
branchingMethod · 0.80
relFunction · 0.50
branchFunction · 0.50
iplMethod · 0.45
sliceMethod · 0.45
sizeMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected