@@ -101,21 +101,21 @@ class BlackHoleBranch : Branching {
101101 ViewArray<Int::IntView> x;
102102 // / Cache of last computed decision
103103 mutable int pos, val;
104- // / Branching description
105- class Description : public BranchingDesc {
104+ // / Choice
105+ class Choice : public Gecode ::Choice {
106106 public:
107107 // / Position of variable
108108 int pos;
109109 // / Value of variable
110110 int val;
111- /* * Initialize description for branching \a b, number of
112- * alternatives \a a, position \a pos0, and value \a val0.
111+ /* * Initialize description for branching \a b, position \a pos0,
112+ * and value \a val0.
113113 */
114- Description (const Branching& b, unsigned int a , int pos0, int val0)
115- : BranchingDesc (b,a ), pos(pos0), val(val0) {}
114+ Choice (const Branching& b, int pos0, int val0)
115+ : Gecode::Choice (b,2 ), pos(pos0), val(val0) {}
116116 // / Report size occupied
117117 virtual size_t size (void ) const {
118- return sizeof (Description );
118+ return sizeof (Choice );
119119 }
120120 };
121121
@@ -131,38 +131,33 @@ class BlackHoleBranch : Branching {
131131public:
132132 // / Check status of branching, return true if alternatives left.
133133 virtual bool status (const Space&) const {
134- for (pos = 0 ; pos < x.size (); ++pos) {
134+ for (pos = 0 ; pos < x.size (); ++pos)
135135 if (!x[pos].assigned ()) {
136136 int w = 4 ;
137- for (Int::ViewValues<Int::IntView> vals (x[pos]); vals (); ++vals) {
137+ for (Int::ViewValues<Int::IntView> vals (x[pos]); vals (); ++vals)
138138 if (layer[vals.val ()] < w) {
139139 val = vals.val ();
140140 if ((w = layer[vals.val ()]) == 0 ) break ;
141141 }
142- }
143142 return true ;
144143 }
145- }
146144 // No non-assigned variables left
147145 return false ;
148146 }
149- // / Return branching description
150- virtual BranchingDesc* description (Space&) {
147+ // / Return choice
148+ virtual Choice* choice (Space&) {
151149 assert (pos >= 0 && pos < x.size () && val >= 1 && val < 52 );
152- return new Description (*this , 2 , pos, val);
150+ return new Choice (*this , pos, val);
153151 }
154- // / Perform commit for branching description \a d and alternative \a a.
155- virtual ExecStatus commit (Space& home, const BranchingDesc& d ,
152+ // / Perform commit for choice \a _c and alternative \a a.
153+ virtual ExecStatus commit (Space& home, const Gecode::Choice& _c ,
156154 unsigned int a) {
157- const Description& desc =
158- static_cast <const Description&>(d);
155+ const Choice& c = static_cast <const Choice&>(_c);
159156 pos = val = -1 ;
160157 if (a)
161- return me_failed (x[desc.pos ].nq (home, desc.val ))
162- ? ES_FAILED : ES_OK;
158+ return me_failed (x[c.pos ].nq (home, c.val )) ? ES_FAILED : ES_OK;
163159 else
164- return me_failed (x[desc.pos ].eq (home, desc.val ))
165- ? ES_FAILED : ES_OK;
160+ return me_failed (x[c.pos ].eq (home, c.val )) ? ES_FAILED : ES_OK;
166161 }
167162 // / Copy branching
168163 virtual Actor* copy (Space& home, bool share) {
0 commit comments