Generated on Thu Apr 5 2018 19:44:19 for Gecode by doxygen 1.8.13
radiotherapy.cpp
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Guido Tack <tack@gecode.org>
5  *
6  * Contributing authors:
7  * Mikael Lagerkvist <lagerkvist@gecode.org>
8  *
9  * Copyright:
10  * Guido Tack, 2009
11  * Mikael Lagerkvist, 2009
12  *
13  * Last modified:
14  * $Date$ by $Author$
15  * $Revision$
16  *
17  * This file is part of Gecode, the generic constraint
18  * development environment:
19  * http://www.gecode.org
20  *
21  * Permission is hereby granted, free of charge, to any person obtaining
22  * a copy of this software and associated documentation files (the
23  * "Software"), to deal in the Software without restriction, including
24  * without limitation the rights to use, copy, modify, merge, publish,
25  * distribute, sublicense, and/or sell copies of the Software, and to
26  * permit persons to whom the Software is furnished to do so, subject to
27  * the following conditions:
28  *
29  * The above copyright notice and this permission notice shall be
30  * included in all copies or substantial portions of the Software.
31  *
32  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
33  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
34  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
35  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
36  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
37  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
38  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39  *
40  */
41 
42 #include <gecode/driver.hh>
43 #include <gecode/int.hh>
44 #include <gecode/minimodel.hh>
45 
46 using namespace Gecode;
47 
50 private:
52  int incr_sum(int row) {
53  int sum = intensity[row*n];
54  for (int i=1; i<n; i++)
55  sum += std::max(intensity[row*n+i]-intensity[row*n+i-1],0);
56  return sum;
57  }
58 public:
59  const int m;
60  const int n;
61  const int* intensity;
62 
63  int btMin;
64  int btMax;
65  int intsSum;
66 
68  RadiotherapyData(int m0, int n0, const int* intensity0)
69  : m(m0), n(n0), intensity(intensity0) {
70  btMax = 0;
71  intsSum = 0;
72  for (int i=0; i<m*n; i++) {
73  btMax = std::max(btMax, intensity[i]);
74  intsSum += intensity[i];
75  }
76 
77  btMin = 0;
78  for (int i=0; i<m; i++)
79  btMin = std::max(btMin, incr_sum(i));
80  }
81 };
82 
83 namespace {
84  extern RadiotherapyData rds[];
85  extern const unsigned int rds_n;
86 }
87 
103 private:
105  const RadiotherapyData rd;
106 
108  IntVar beamtime;
110  IntVar K;
112  IntVarArray N;
114  IntVarArray q;
115 
117  IntVar _cost;
118 
119 public:
122  : IntMinimizeScript(opt), rd(rds[opt.size()]) {
123 
124  // Initialize variables
125  beamtime = IntVar(*this, rd.btMin, rd.intsSum);
126  K = IntVar(*this, 0, rd.m*rd.n);
127  N = IntVarArray(*this, rd.btMax, 0, rd.m*rd.n);
128  q = IntVarArray(*this, rd.m*rd.n*rd.btMax, 0, rd.m*rd.n);
129 
130  IntArgs coeffs(rd.btMax);
131  for (int i=0; i<rd.btMax; i++)
132  coeffs[i] = i+1;
133  linear(*this, coeffs, N, IRT_EQ, beamtime);
134  linear(*this, N, IRT_EQ, K);
135 
136  for (int i=0; i<rd.m; i++) {
137  for (int j=0; j<rd.n; j++) {
138  IntVarArgs qs(rd.btMax);
139  for (int b=0; b<rd.btMax; b++)
140  qs[b] = q[i*rd.n*rd.btMax+j*rd.btMax+b];
141  linear(*this, coeffs, qs, IRT_EQ, rd.intensity[i*rd.n+j], IPL_DOM);
142  }
143  }
144 
145  for (int i=0; i<rd.m; i++) {
146  for (int b=0; b<rd.btMax; b++) {
147  IntVarArgs qs(rd.n);
148  for (int j=0; j<rd.n; j++)
149  qs[j] = q[i*rd.n*rd.btMax+j*rd.btMax+b];
150  incr_sum(N[b], qs, rd.m*rd.n);
151  }
152  }
153 
154  _cost = IntVar(*this, 0, (rd.m*rd.n+1)*(rd.intsSum+1));
155  rel(*this, _cost == beamtime*(rd.m*rd.n+1)+K);
156 
157  // First branch over beamtime and N
158  IntVarArgs ba(1); ba[0] = beamtime;
159  branch(*this, ba, INT_VAR_NONE(), INT_VAL_MIN());
160  branch(*this, N, INT_VAR_NONE(), INT_VAL_SPLIT_MIN());
161 
162  // Then perform a nested search over q
163  NestedSearch::post(*this);
164 
165  }
166 
168  void incr_sum(IntVar& x, IntVarArgs& y, int mn) {
169  IntVarArgs s(*this, y.size()-1, 0, mn);
170  IntVarArgs t(y.size());
171  t[0] = y[0];
172  for (int i=1; i<y.size(); i++) {
173  rel(*this, s[i-1] >= y[i]-y[i-1]);
174  t[i] = s[i-1];
175  }
176  linear(*this, t, IRT_LQ, x);
177  }
178 
181  : IntMinimizeScript(s), rd(s.rd) {
182  beamtime.update(*this, s.beamtime);
183  N.update(*this, s.N);
184  K.update(*this, s.K);
185  _cost.update(*this, s._cost);
186  q.update(*this, s.q);
187  }
188 
190  virtual Space*
191  copy(void) {
192  return new Radiotherapy(*this);
193  }
194 
196  virtual IntVar
197  cost(void) const { return _cost; }
198 
200  virtual void
201  print(std::ostream& os) const {
202  os << std::endl
203  << "B / K = " << beamtime << " / " << K << ",\nN = " << N << std::endl;
204  }
205 
207  class NestedSearch : public Brancher {
208  private:
210  bool done;
212  struct Idx {
213  int idx;
214  int weight;
215  bool operator<(const Idx& rhs) const { return weight > rhs.weight; }
217  };
219  SharedArray<Idx> index;
221  class Choice : public Gecode::Choice {
222  public:
224  bool fail;
226  Choice(const Brancher& b, bool fail0)
227  : Gecode::Choice(b,1), fail(fail0) {}
229  virtual void archive(Archive& e) const {
231  e.put(fail);
232  }
233  };
235  NestedSearch(Space& home) : Brancher(home), done(false) {
236  Radiotherapy& rt = static_cast<Radiotherapy&>(home);
237  // Set up ordering of rows. As a heuristic, pre-order the rows
238  // with the potentially cheapest ones first.
239  index.init(rt.rd.m+1);
240  for (int i = rt.rd.m; i--; ) {
241  index[i].idx = i;
242  index[i].weight = 0;
243  for (int j = rt.rd.n; j--; )
244  index[i].weight += rt.rd.intensity[i*rt.rd.n + j] == 0;
245  }
246  Support::quicksort(&(index[0]), rt.rd.m);
247  for (int i = rt.rd.m; i--; )
248  index[i].weight = 0;
249  index[rt.rd.m].idx = 10;
250  // A shared object must be disposed properly
251  home.notice(*this, AP_DISPOSE);
252  }
255  : Brancher(home, b), done(b.done), index(b.index) {
256  }
257  public:
258  virtual bool status(const Space&) const {
259  return !done;
260  }
261 
263  IntVarArgs ri(row->rd.n*row->rd.btMax);
264  for (int j=0; j<row->rd.n; j++) {
265  for (int b=0; b<row->rd.btMax; b++) {
266  ri[j*row->rd.btMax+b] =
267  row->q[i*row->rd.n*row->rd.btMax+j*row->rd.btMax+b];
268  }
269  }
270  return ri;
271  }
273  virtual Gecode::Choice* choice(Space& home) {
274  done = true;
275  Radiotherapy& rt = static_cast<Radiotherapy&>(home);
276 
277  std::cout << "*";
278 
279  // Perform nested search for each row
280  bool fail = false;
281  for (int i=0; i<rt.rd.m; i++) {
282  // Create fresh clone for row i
283  Radiotherapy* row = static_cast<Radiotherapy*>(rt.clone());
284 
285  // Branch over row i
286  branch(*row, getRow(row, index[i].idx),
288  Search::Options o; o.clone = false;
289  if (Radiotherapy* newSol = dfs(row, o) ) {
290  // Found a solution for row i, so try to find one for i+1
291  delete newSol;
292  std::cerr << index[i].idx;
293  } else {
294  // Found no solution for row i, so back to search the N variables
295  fail = true;
296  index[i].weight += 1;
297  if (i && index[i] < index[i-1])
298  std::swap(index[i], index[i-1]);
299  break;
300  }
301  }
302 
303  return new Choice(*this, fail);
304  }
306  virtual Choice* choice(const Space&, Archive& e) {
307  bool fail; e >> fail;
308  return new Choice(*this, fail);
309  }
311  virtual ExecStatus commit(Space&, const Gecode::Choice& _c, unsigned int) {
312  return static_cast<const Choice&>(_c).fail ? ES_FAILED : ES_OK;
313  }
315  virtual void print(const Space&, const Gecode::Choice& _c,
316  unsigned int,
317  std::ostream& o) const {
318  const Choice& c = static_cast<const Choice&>(_c);
319  o << (c.fail ? "fail" : "ok");
320  }
322  virtual Actor* copy(Space& home) {
323  return new (home) NestedSearch(home, *this);
324  }
326  static void post(Home home) {
327  (void) new (home) NestedSearch(home);
328  }
330  size_t dispose(Space& home) {
331  home.ignore(*this,AP_DISPOSE);
332  // Periodic scaling of weights
333  if (!--index[index.size()-1].idx) {
334  index[index.size()-1].idx = 10;
335  for (int i = index.size()-1; i--; )
336  index[i].weight *= 0.9;
337  }
338  (void) Brancher::dispose(home);
339  (void) index.~SharedArray<Idx>();
340  return sizeof(*this);
341  }
342  };
343 
344 };
345 
349 int
350 main(int argc, char* argv[]) {
351  SizeOptions opt("Radiotherapy");
352  opt.solutions(0);
353  opt.size(0);
354  opt.parse(argc,argv);
355 
356  if (opt.size() >= rds_n) {
357  std::cerr << "Error: size must be between 0 and "
358  << rds_n-1 << std::endl;
359  return 1;
360  }
361 
362  IntMinimizeScript::run<Radiotherapy,BAB,SizeOptions>(opt);
363  return 0;
364 }
365 
366 namespace {
372 
373  // Small instance
374  static const int intensity0[] = {
375  7, 2, 14, 8, 9,
376  13, 4, 1, 2, 9,
377  5, 12, 2, 11, 9,
378  10, 2, 4, 9, 7,
379  10, 2, 8, 11, 1
380  };
381  RadiotherapyData rd0(5,5,intensity0);
382 
383  // Larger instance
384  static const int intensity1[] = {
385  6, 10, 6, 8, 10, 0, 4, 10, 0, 6, 2, 8, 0, 2, 0 ,
386  1, 8, 3, 1, 0, 8, 0, 3, 6, 10, 9, 8, 9, 6, 9 ,
387  8, 5, 6, 7, 7, 0, 6, 8, 2, 7, 5, 2, 0, 9, 2 ,
388  9, 2, 10, 5, 7, 1, 3, 7, 5, 1, 8, 2, 3, 10, 4 ,
389  8, 7, 4, 1, 6, 3, 0, 1, 2, 6, 4, 4, 0, 5, 0 ,
390  9, 0, 7, 4, 9, 7, 4, 1, 4, 1, 1, 9, 2, 9, 9 ,
391  3, 6, 10, 0, 6, 6, 10, 10, 7, 0, 10, 2, 10, 2, 4 ,
392  8, 9, 5, 2, 6, 1, 9, 0, 4, 2, 4, 1, 5, 1, 4 ,
393  6, 10, 0, 0, 7, 0, 0, 5, 8, 5, 10, 3, 2, 2, 10 ,
394  4, 3, 0, 6, 10, 7, 2, 7, 2, 9, 2, 8, 9, 7, 9 ,
395  10, 2, 0, 5, 5, 1, 3, 7, 1, 6, 5, 4, 2, 8, 1 ,
396  3, 6, 4, 3, 7, 10, 6, 7, 7, 6, 5, 9, 10, 8, 3 ,
397  9, 9, 5, 2, 4, 2, 3, 3, 1, 2, 9, 2, 5, 6, 3 ,
398  7, 5, 2, 6, 4, 8, 1, 0, 2, 4, 7, 9, 3, 3, 0 ,
399  5, 3, 8, 7, 10, 6, 7, 7, 6, 10, 4, 4, 5, 8, 0
400  };
401  RadiotherapyData rd1(15,15,intensity1);
402 
403  /*
404  * The following 25 clinical instances were provided by
405  * - James F. Dempsey, ViewRay, Inc.
406  * - H. Edwin Romeijn, Department of Industrial and Operations
407  * Engineering, The University of Michigan
408  * - J. Cole Smith, Department of Industrial and Systems
409  * Engineering, University of Florida
410  * - Z. Caner Taskin, Department of Industrial and Systems
411  * Engineering, University of Florida
412  * - Chunhua Men, Department of Industrial and Systems Engineering,
413  * University of Florida
414  * They are from the artiples
415  * - "Mixed-Integer Programming Techniques for Decomposing IMRT
416  * Fluence Maps Using Rectangular Apertures", Z. Caner Taskin,
417  * J. Cole Smith, H. Edwin Romeijn
418  * - "Optimal Multileaf Collimator Leaf Sequencing in IMRT Treatment
419  * Planning", Z. Caner Tasin, J. Cole Smith, H. Edwin Romeijn, James
420  * F. Dempsey
421  */
422  static const int case1_beam1_matrix[] = {
423  2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
424  2, 1, 0, 0, 0, 0, 0, 0, 0, 5, 0, 3, 0, 2,
425  3, 1, 0, 0, 0, 0, 0, 0, 18, 0, 0, 4, 6, 0,
426  2, 0, 0, 3, 11, 8, 15, 1, 11, 0, 0, 0, 10, 0,
427  0, 0, 0, 9, 11, 14, 6, 2, 7, 0, 0, 0, 7, 0,
428  0, 8, 2, 7, 10, 11, 7, 2, 0, 7, 0, 0, 0, 1,
429  0, 0, 4, 1, 6, 7, 0, 0, 0, 0, 0, 0, 0, 1,
430  0, 3, 1, 0, 4, 6, 0, 0, 0, 1, 0, 0, 0, 1,
431  0, 1, 5, 6, 8, 8, 5, 0, 2, 0, 0, 0, 7, 0,
432  0, 5, 2, 8, 10, 11, 5, 3, 7, 0, 2, 4, 11, 0,
433  0, 0, 0, 1, 12, 13, 9, 7, 11, 1, 2, 3, 6, 0,
434  0, 0, 0, 0, 0, 0, 0, 4, 20, 0, 0, 8, 5, 0,
435  3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 0, 2,
436  2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
437  1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 1
438  };
439  RadiotherapyData case1_beam1(15, 14, case1_beam1_matrix);
440 
441  static const int case1_beam2_matrix[] = {
442  2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 4, 3, 4, 0, 2,
443  2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 2, 0, 1,
444  3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 1, 0, 0, 3,
445  0, 0, 0, 5, 5, 3, 0, 0, 3, 2, 8, 6, 0, 0, 3,
446  0, 0, 7, 11, 10, 11, 5, 8, 4, 11, 13, 20, 0, 0, 3,
447  0, 10, 10, 9, 7, 7, 7, 2, 9, 0, 0, 0, 9, 0, 2,
448  0, 4, 7, 7, 5, 6, 2, 0, 4, 0, 0, 0, 3, 0, 2,
449  0, 10, 2, 7, 1, 2, 0, 0, 0, 0, 0, 0, 0, 3, 1,
450  0, 0, 5, 6, 3, 1, 0, 6, 8, 0, 0, 0, 0, 1, 2,
451  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2,
452  0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2
453  };
454  RadiotherapyData case1_beam2(11, 15, case1_beam2_matrix);
455 
456  static const int case1_beam3_matrix[] = {
457  2, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 1,
458  1, 2, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 1, 2, 2,
459  1, 3, 0, 0, 0, 0, 0, 0, 0, 6, 4, 1, 12, 0, 2,
460  2, 0, 0, 0, 0, 0, 0, 0, 0, 11, 6, 1, 9, 0, 2,
461  2, 0, 0, 0, 0, 0, 0, 0, 2, 11, 0, 0, 0, 2, 1,
462  0, 0, 0, 0, 0, 1, 0, 4, 0, 0, 0, 0, 0, 1, 1,
463  0, 3, 0, 2, 6, 7, 6, 6, 4, 0, 0, 0, 0, 0, 2,
464  0, 0, 10, 12, 11, 10, 13, 13, 12, 5, 0, 0, 0, 0, 2,
465  0, 0, 11, 12, 10, 10, 14, 15, 15, 5, 2, 7, 12, 0, 2,
466  0, 9, 5, 9, 7, 6, 12, 16, 13, 8, 5, 7, 7, 0, 2,
467  2, 0, 0, 0, 0, 0, 4, 20, 12, 8, 1, 6, 8, 0, 2,
468  0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 7, 0, 2,
469  0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
470  2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1,
471  0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 1
472  };
473  RadiotherapyData case1_beam3(15, 15, case1_beam3_matrix);
474 
475  static const int case1_beam4_matrix[] = {
476  3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 2,
477  0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2,
478  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2,
479  0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 13, 0, 4, 0, 2,
480  0, 6, 5, 5, 8, 9, 11, 20, 8, 9, 18, 10, 7, 0, 2,
481  0, 3, 10, 9, 12, 11, 15, 15, 11, 11, 16, 15, 3, 0, 3,
482  0, 5, 7, 12, 14, 11, 15, 15, 13, 10, 15, 10, 5, 0, 3,
483  0, 5, 1, 9, 11, 9, 13, 9, 12, 6, 3, 0, 0, 0, 2,
484  0, 0, 0, 0, 4, 2, 4, 0, 7, 0, 0, 0, 0, 0, 2,
485  2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
486  2, 0, 0, 1, 7, 4, 0, 0, 0, 10, 10, 4, 0, 1, 1,
487  2, 2, 0, 0, 0, 0, 0, 4, 0, 14, 14, 9, 0, 0, 1,
488  2, 2, 0, 0, 0, 0, 0, 0, 0, 12, 16, 5, 1, 0, 2,
489  2, 2, 0, 0, 0, 0, 0, 0, 1, 10, 12, 6, 3, 0, 2,
490  1, 3, 0, 0, 0, 0, 0, 0, 2, 12, 15, 3, 0, 1, 2
491  };
492  RadiotherapyData case1_beam4(15, 15, case1_beam4_matrix);
493 
494  static const int case1_beam5_matrix[] = {
495  3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2,
496  0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2,
497  0, 0, 6, 4, 3, 1, 0, 0, 7, 0, 0, 0, 0, 3, 2,
498  0, 13, 6, 1, 1, 1, 5, 0, 2, 0, 0, 0, 0, 1, 2,
499  0, 2, 12, 5, 4, 2, 2, 0, 1, 20, 11, 11, 5, 0, 2,
500  0, 9, 12, 7, 3, 2, 7, 3, 5, 14, 12, 13, 11, 0, 2,
501  0, 5, 11, 13, 6, 6, 5, 5, 5, 15, 11, 13, 12, 0, 2,
502  0, 0, 0, 1, 4, 5, 0, 0, 0, 7, 9, 9, 8, 0, 2,
503  4, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 4, 5, 0, 2,
504  2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
505  2, 2, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 9, 0, 3
506  };
507  RadiotherapyData case1_beam5(11, 15, case1_beam5_matrix);
508 
509  static const int case2_beam1_matrix[] = {
510  1, 1, 1, 4, 1, 0, 1, 5, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 2,
511  1, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
512  1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 2, 7, 2, 1,
513  1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 12, 12, 5, 8, 5, 3, 0,
514  2, 1, 3, 0, 0, 0, 0, 0, 4, 20, 10, 1, 0, 8, 7, 8, 6, 7, 2, 1,
515  1, 3, 1, 0, 3, 1, 13, 18, 14, 10, 5, 0, 3, 7, 7, 7, 6, 7, 2, 0,
516  2, 0, 0, 0, 3, 1, 9, 8, 8, 6, 2, 3, 4, 5, 11, 10, 9, 10, 3, 0,
517  2, 0, 0, 0, 1, 1, 7, 8, 5, 4, 1, 1, 0, 4, 3, 1, 0, 0, 0, 2,
518  2, 0, 0, 1, 0, 0, 4, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
519  2, 0, 0, 4, 2, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
520  3, 0, 5, 6, 3, 1, 2, 5, 3, 1, 3, 0, 1, 0, 4, 5, 5, 9, 0, 1,
521  1, 0, 2, 8, 3, 2, 3, 6, 5, 3, 4, 6, 4, 5, 10, 11, 8, 10, 4, 0,
522  0, 0, 0, 8, 5, 4, 5, 8, 5, 7, 6, 5, 3, 5, 8, 7, 7, 10, 2, 0,
523  3, 0, 9, 11, 5, 5, 6, 11, 7, 6, 6, 6, 4, 6, 8, 7, 7, 9, 2, 0,
524  2, 0, 11, 11, 5, 6, 7, 9, 9, 6, 8, 5, 4, 6, 10, 6, 7, 7, 2, 0,
525  2, 0, 6, 11, 4, 3, 1, 0, 0, 0, 0, 4, 7, 6, 2, 0, 0, 3, 0, 2,
526  1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
527  1, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 2
528  };
529  RadiotherapyData case2_beam1(18, 20, case2_beam1_matrix);
530 
531  static const int case2_beam2_matrix[] = {
532  2, 3, 2, 1, 5, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 3,
533  3, 3, 3, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,
534  3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 3, 2,
535  3, 3, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 8, 5, 1,
536  2, 3, 1, 0, 0, 0, 0, 1, 0, 0, 5, 6, 5, 5, 1, 2, 6, 2, 1,
537  2, 2, 2, 0, 0, 0, 0, 8, 0, 4, 2, 5, 2, 7, 5, 1, 4, 2, 1,
538  2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 3, 4, 7, 4, 0,
539  3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6, 6, 7, 5, 7, 8, 7, 0,
540  2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 7, 10, 7, 2, 3, 5, 12, 6, 0,
541  4, 0, 0, 0, 0, 6, 5, 6, 4, 8, 10, 12, 9, 7, 1, 6, 6, 6, 0,
542  0, 0, 0, 18, 18, 3, 3, 4, 6, 9, 12, 12, 7, 5, 0, 0, 0, 0, 2,
543  0, 0, 0, 20, 11, 0, 1, 4, 5, 10, 10, 8, 6, 1, 6, 3, 4, 1, 3,
544  0, 0, 0, 16, 11, 0, 3, 2, 7, 11, 10, 13, 7, 2, 2, 0, 0, 0, 2,
545  3, 0, 0, 14, 10, 1, 5, 2, 8, 15, 9, 9, 13, 5, 0, 0, 0, 0, 3,
546  2, 0, 0, 16, 9, 5, 5, 4, 7, 18, 0, 0, 0, 0, 0, 0, 0, 1, 2,
547  2, 0, 0, 15, 10, 7, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2,
548  2, 0, 0, 0, 18, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2
549  };
550  RadiotherapyData case2_beam2(17, 19, case2_beam2_matrix);
551 
552  static const int case2_beam3_matrix[] = {
553  1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,
554  1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
555  1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 4, 3, 2, 6, 2, 2,
556  1, 0, 0, 0, 0, 0, 0, 4, 2, 10, 11, 12, 7, 7, 4, 0, 4, 1,
557  2, 0, 0, 0, 0, 0, 0, 4, 6, 9, 10, 12, 6, 5, 4, 4, 3, 2,
558  2, 0, 0, 0, 0, 14, 0, 7, 2, 9, 8, 8, 3, 6, 4, 4, 2, 2,
559  3, 0, 0, 0, 10, 11, 0, 0, 1, 7, 4, 2, 2, 0, 0, 0, 2, 2,
560  0, 0, 0, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
561  0, 0, 0, 0, 4, 1, 1, 0, 2, 2, 0, 0, 2, 0, 3, 0, 1, 2,
562  0, 0, 0, 0, 5, 5, 7, 7, 8, 9, 5, 8, 1, 1, 0, 0, 0, 3,
563  0, 0, 8, 0, 10, 10, 12, 15, 16, 10, 7, 6, 0, 3, 0, 0, 0, 3,
564  0, 0, 20, 4, 12, 12, 11, 19, 17, 17, 11, 9, 12, 12, 11, 13, 3, 1,
565  0, 0, 0, 11, 8, 10, 11, 15, 18, 12, 5, 3, 6, 8, 11, 12, 9, 0,
566  1, 0, 0, 6, 10, 1, 3, 17, 17, 13, 5, 1, 4, 16, 8, 15, 3, 1,
567  2, 0, 0, 8, 0, 0, 0, 0, 0, 11, 6, 0, 6, 0, 0, 0, 0, 3,
568  2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2,
569  2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2,
570  2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2
571  };
572  RadiotherapyData case2_beam3(18, 18, case2_beam3_matrix);
573 
574  static const int case2_beam4_matrix[] = {
575  3, 0, 5, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 2, 2,
576  0, 0, 5, 2, 2, 0, 7, 3, 3, 0, 0, 0, 0, 0, 0, 3, 1, 2,
577  0, 0, 0, 4, 3, 0, 8, 11, 9, 4, 0, 2, 0, 0, 0, 0, 4, 1,
578  0, 0, 9, 5, 5, 2, 12, 13, 10, 7, 3, 1, 4, 0, 0, 0, 0, 3,
579  0, 16, 9, 4, 10, 7, 15, 16, 8, 5, 6, 4, 7, 10, 0, 11, 0, 2,
580  0, 0, 12, 6, 12, 12, 18, 18, 14, 9, 7, 7, 8, 12, 13, 12, 10, 0,
581  0, 0, 0, 8, 13, 15, 18, 20, 12, 13, 12, 12, 12, 13, 11, 10, 8, 0,
582  0, 0, 0, 3, 5, 14, 17, 16, 11, 8, 4, 10, 12, 11, 14, 9, 1, 3,
583  0, 0, 0, 0, 0, 3, 14, 8, 5, 4, 5, 9, 4, 0, 0, 0, 0, 3,
584  4, 3, 0, 0, 1, 0, 8, 3, 3, 0, 0, 0, 0, 0, 2, 0, 0, 3,
585  1, 7, 0, 0, 1, 2, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
586  3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 5, 1, 4, 1, 4, 0, 0, 2,
587  2, 5, 4, 0, 0, 0, 0, 0, 0, 0, 8, 10, 7, 0, 6, 1, 4, 1,
588  2, 4, 4, 0, 0, 0, 0, 0, 0, 4, 5, 5, 6, 1, 6, 6, 2, 2,
589  2, 4, 3, 2, 0, 0, 0, 0, 4, 3, 12, 2, 1, 7, 3, 4, 2, 2,
590  2, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 3, 7, 3, 12, 5, 5, 1,
591  2, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 2, 2,
592  3, 3, 5, 0, 3, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 3
593  };
594  RadiotherapyData case2_beam4(18, 18, case2_beam4_matrix);
595 
596  static const int case2_beam5_matrix[] = {
597  0, 0, 0, 15, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2,
598  0, 0, 2, 10, 16, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2,
599  0, 0, 6, 9, 15, 3, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 3,
600  2, 4, 9, 12, 15, 3, 4, 0, 3, 0, 2, 17, 13, 0, 0, 0, 2, 3,
601  0, 5, 12, 14, 17, 5, 2, 0, 0, 8, 17, 16, 13, 4, 0, 0, 0, 3,
602  0, 6, 13, 16, 17, 5, 2, 2, 4, 5, 12, 10, 10, 13, 6, 0, 0, 3,
603  0, 0, 20, 17, 18, 8, 4, 5, 6, 10, 14, 13, 11, 2, 1, 4, 0, 3,
604  0, 0, 0, 14, 18, 11, 8, 9, 9, 10, 13, 12, 8, 8, 5, 6, 5, 0,
605  0, 0, 0, 2, 11, 10, 6, 3, 1, 6, 10, 11, 5, 8, 9, 8, 9, 0,
606  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 3, 10, 4, 5, 3, 1,
607  0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 6, 6, 2, 2, 2, 2, 1,
608  0, 0, 0, 0, 0, 0, 1, 0, 3, 3, 4, 3, 4, 1, 0, 0, 2, 0,
609  0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0, 4, 1, 2,
610  2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 8, 3, 1,
611  1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 0, 2,
612  1, 3, 5, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,
613  1, 2, 1, 4, 8, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2
614  };
615  RadiotherapyData case2_beam5(17, 18, case2_beam5_matrix);
616 
617  static const int case3_beam1_matrix[] = {
618  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
619  0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 13, 8, 8, 1, 0, 0, 0,
620  1, 2, 0, 0, 0, 0, 0, 0, 11, 9, 5, 5, 4, 5, 0, 2, 0,
621  1, 0, 0, 0, 0, 0, 8, 13, 9, 6, 4, 4, 4, 8, 0, 2, 0,
622  0, 2, 17, 10, 13, 14, 10, 8, 7, 6, 4, 4, 5, 8, 0, 2, 0,
623  0, 12, 20, 9, 14, 15, 7, 2, 5, 5, 5, 3, 4, 9, 0, 1, 1,
624  0, 17, 13, 10, 15, 16, 5, 1, 5, 7, 5, 6, 4, 8, 0, 2, 1,
625  1, 0, 15, 9, 15, 20, 6, 1, 4, 7, 7, 6, 5, 9, 7, 1, 1,
626  0, 0, 2, 7, 16, 9, 5, 0, 3, 7, 5, 5, 4, 7, 4, 5, 0,
627  0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 4, 2, 6, 5, 4, 0,
628  0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 3, 3, 3, 6, 5, 4, 0,
629  0, 0, 0, 5, 7, 5, 8, 0, 2, 7, 5, 4, 5, 7, 4, 5, 0,
630  0, 4, 9, 8, 16, 19, 5, 1, 3, 7, 6, 5, 6, 9, 6, 1, 1,
631  0, 13, 12, 8, 14, 14, 4, 2, 0, 8, 4, 5, 5, 8, 2, 0, 2,
632  0, 20, 11, 7, 14, 15, 3, 0, 0, 6, 3, 3, 5, 9, 0, 1, 1,
633  0, 6, 17, 4, 14, 14, 6, 1, 1, 5, 2, 3, 5, 7, 0, 1, 0,
634  0, 0, 0, 11, 6, 13, 7, 2, 2, 5, 2, 4, 3, 6, 0, 2, 0,
635  1, 0, 0, 0, 6, 0, 8, 2, 3, 5, 3, 7, 4, 7, 0, 0, 0,
636  0, 0, 0, 0, 0, 0, 6, 0, 4, 4, 7, 10, 4, 0, 0, 0, 0,
637  0, 0, 0, 0, 0, 0, 0, 0, 2, 8, 5, 0, 10, 0, 1, 0, 0,
638  0, 0, 0, 0, 0, 0, 0, 0, 6, 2, 0, 0, 0, 0, 1, 0, 0,
639  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0
640  };
641  RadiotherapyData case3_beam1(22, 17, case3_beam1_matrix);
642 
643  static const int case3_beam2_matrix[] = {
644  0, 0, 1, 1, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
645  0, 0, 8, 0, 1, 4, 5, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0,
646  2, 0, 0, 0, 3, 2, 2, 1, 1, 0, 0, 1, 4, 7, 11, 9, 0, 0, 0,
647  2, 0, 0, 0, 3, 2, 2, 0, 2, 4, 1, 4, 7, 11, 10, 20, 1, 0, 0,
648  3, 0, 2, 0, 2, 2, 2, 1, 7, 8, 5, 9, 13, 16, 13, 14, 12, 0, 0,
649  2, 0, 1, 0, 3, 2, 4, 5, 15, 16, 12, 11, 15, 17, 15, 14, 9, 0, 3,
650  2, 0, 11, 0, 6, 3, 0, 5, 17, 16, 10, 10, 13, 17, 13, 14, 7, 1, 3,
651  2, 0, 5, 0, 8, 1, 0, 2, 16, 16, 9, 8, 10, 14, 12, 13, 12, 0, 3,
652  0, 0, 0, 2, 8, 1, 0, 7, 15, 17, 7, 8, 10, 12, 9, 12, 5, 1, 0,
653  0, 0, 0, 0, 5, 0, 2, 7, 15, 13, 5, 4, 9, 7, 4, 0, 0, 2, 0,
654  0, 0, 0, 0, 4, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
655  0, 0, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
656  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
657  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
658  0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
659  };
660  RadiotherapyData case3_beam2(15, 19, case3_beam2_matrix);
661 
662  static const int case3_beam3_matrix[] = {
663  0, 0, 0, 0, 0, 0, 0, 0, 15, 8, 10, 0, 0, 0, 0, 0, 0,
664  0, 0, 0, 0, 0, 0, 0, 15, 10, 7, 10, 7, 18, 0, 0, 0, 0,
665  0, 3, 5, 5, 3, 0, 7, 8, 12, 9, 12, 11, 20, 0, 0, 0, 0,
666  0, 0, 0, 4, 5, 2, 6, 5, 12, 9, 12, 12, 14, 3, 0, 1, 0,
667  0, 0, 0, 7, 2, 4, 7, 9, 11, 9, 10, 10, 7, 5, 0, 0, 0,
668  0, 0, 1, 7, 1, 2, 7, 8, 10, 4, 5, 1, 0, 0, 0, 0, 0,
669  0, 0, 0, 3, 0, 3, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0,
670  0, 7, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0,
671  3, 2, 4, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 7, 10, 8, 0,
672  0, 0, 4, 4, 0, 0, 0, 9, 6, 7, 7, 10, 6, 13, 8, 10, 0,
673  0, 6, 12, 12, 0, 0, 0, 15, 9, 11, 15, 16, 15, 17, 4, 17, 0,
674  0, 5, 14, 12, 5, 0, 9, 18, 15, 18, 19, 18, 16, 17, 6, 14, 0,
675  0, 14, 7, 13, 3, 2, 16, 17, 13, 17, 17, 16, 17, 12, 8, 12, 0,
676  0, 4, 14, 8, 5, 1, 10, 12, 7, 19, 17, 18, 15, 13, 0, 0, 3,
677  0, 0, 6, 10, 0, 0, 0, 4, 5, 16, 17, 16, 13, 15, 2, 0, 3,
678  0, 0, 0, 0, 0, 0, 0, 0, 5, 17, 15, 16, 12, 15, 2, 2, 0,
679  1, 0, 0, 0, 0, 0, 2, 2, 0, 7, 15, 9, 11, 13, 7, 1, 0,
680  0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 15, 0, 3, 0,
681  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 1, 2, 0,
682  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0
683  };
684  RadiotherapyData case3_beam3(20, 17, case3_beam3_matrix);
685 
686  static const int case3_beam4_matrix[] = {
687  0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0,
688  0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 3, 0,
689  0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 12, 0, 3, 0,
690  2, 0, 0, 0, 0, 0, 2, 0, 10, 9, 20, 0, 0, 15, 0, 3, 0,
691  0, 0, 0, 14, 0, 0, 0, 3, 7, 11, 16, 16, 6, 16, 2, 2, 0,
692  0, 0, 10, 9, 5, 0, 0, 16, 7, 10, 17, 16, 13, 11, 12, 0, 0,
693  0, 9, 10, 10, 5, 2, 11, 9, 9, 12, 16, 18, 12, 13, 3, 0, 3,
694  0, 5, 11, 10, 6, 4, 10, 15, 10, 13, 17, 18, 16, 5, 11, 0, 2,
695  0, 1, 13, 11, 7, 2, 19, 12, 14, 12, 16, 18, 16, 12, 7, 11, 0,
696  0, 0, 14, 6, 7, 0, 0, 11, 13, 13, 17, 16, 16, 11, 7, 11, 0,
697  0, 0, 5, 0, 0, 0, 0, 7, 4, 8, 11, 12, 12, 10, 7, 9, 0,
698  2, 0, 0, 0, 0, 0, 0, 1, 2, 2, 5, 5, 7, 7, 8, 1, 1,
699  3, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 6, 5, 11, 0, 2,
700  0, 6, 3, 2, 2, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,
701  0, 0, 0, 0, 4, 4, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0,
702  0, 0, 0, 0, 4, 6, 2, 9, 12, 6, 5, 5, 5, 0, 0, 0, 1,
703  0, 0, 0, 4, 2, 4, 0, 7, 10, 8, 10, 10, 5, 0, 0, 1, 0,
704  1, 0, 0, 3, 0, 0, 0, 0, 6, 5, 11, 9, 11, 0, 0, 0, 0,
705  0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 10, 13, 13, 0, 0, 0, 0
706  };
707  RadiotherapyData case3_beam4(19, 17, case3_beam4_matrix);
708 
709  static const int case3_beam5_matrix[] = {
710  0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
711  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
712  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
713  0, 0, 7, 1, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0,
714  0, 0, 0, 0, 0, 0, 1, 15, 0, 0, 0, 0, 4, 5, 0, 0, 0, 3, 0,
715  0, 0, 0, 0, 1, 0, 0, 13, 2, 0, 5, 9, 9, 9, 1, 7, 0, 3, 0,
716  1, 0, 1, 2, 5, 0, 0, 3, 5, 0, 8, 10, 9, 12, 10, 17, 4, 2, 0,
717  3, 0, 0, 0, 5, 1, 0, 8, 9, 2, 10, 13, 12, 14, 12, 14, 10, 1, 3,
718  3, 0, 0, 0, 3, 2, 2, 11, 11, 8, 14, 15, 16, 17, 15, 15, 5, 2, 3,
719  3, 0, 2, 2, 2, 1, 3, 9, 8, 7, 7, 15, 13, 19, 18, 13, 15, 1, 0,
720  3, 0, 0, 2, 0, 2, 2, 6, 1, 3, 1, 7, 9, 12, 11, 19, 0, 0, 0,
721  3, 0, 0, 4, 0, 2, 3, 2, 1, 1, 0, 3, 4, 7, 20, 0, 0, 0, 0,
722  3, 0, 16, 0, 3, 0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
723  4, 0, 16, 3, 4, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
724  0, 1, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
725  };
726  RadiotherapyData case3_beam5(15, 19, case3_beam5_matrix);
727 
728  static const int case4_beam1_matrix[] = {
729  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0,
730  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 5, 8, 10, 0, 0, 0, 0, 2,
731  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 2, 9, 2, 0, 2, 1, 2,
732  0, 0, 0, 0, 0, 0, 0, 10, 17, 12, 0, 7, 5, 0, 0, 1, 6, 7, 4, 4, 3, 1,
733  2, 0, 0, 0, 20, 0, 0, 0, 0, 0, 2, 1, 3, 1, 1, 1, 6, 7, 6, 4, 0, 1,
734  2, 1, 0, 8, 6, 0, 0, 0, 0, 0, 0, 2, 3, 2, 2, 1, 6, 7, 7, 7, 0, 0,
735  2, 0, 11, 5, 2, 4, 6, 0, 0, 3, 4, 2, 6, 1, 2, 1, 8, 5, 8, 8, 2, 0,
736  1, 0, 1, 1, 0, 0, 2, 4, 7, 2, 0, 1, 3, 1, 5, 0, 11, 4, 7, 9, 2, 0,
737  0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 6, 1, 10, 3, 7, 8, 3, 0,
738  1, 0, 0, 0, 0, 0, 3, 5, 8, 0, 1, 1, 2, 1, 7, 1, 11, 3, 6, 8, 4, 0,
739  1, 0, 7, 4, 2, 6, 6, 0, 6, 3, 2, 4, 7, 6, 10, 2, 11, 3, 6, 7, 4, 0,
740  0, 8, 16, 13, 0, 0, 0, 0, 0, 0, 2, 3, 6, 6, 7, 3, 10, 3, 5, 7, 4, 0,
741  2, 0, 0, 0, 16, 0, 0, 0, 0, 0, 3, 2, 4, 7, 9, 4, 9, 3, 5, 6, 4, 0,
742  0, 0, 0, 0, 0, 0, 0, 12, 6, 8, 5, 4, 5, 8, 6, 3, 8, 3, 5, 6, 3, 0,
743  0, 0, 0, 0, 0, 0, 0, 14, 15, 10, 0, 3, 9, 8, 4, 2, 7, 3, 4, 5, 1, 0,
744  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, 4, 2, 7, 2, 4, 5, 0, 2,
745  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 4, 1, 8, 2, 3, 2, 2, 2,
746  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 12, 5, 0, 0, 0, 0, 0, 2,
747  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 0, 0, 0
748  };
749  RadiotherapyData case4_beam1(19, 22, case4_beam1_matrix);
750 
751  static const int case4_beam2_matrix[] = {
752  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
753  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 3, 2, 9, 17, 10, 11, 6, 0, 0, 5, 0,
754  0, 0, 0, 0, 0, 0, 7, 6, 0, 0, 0, 0, 1, 2, 7, 14, 16, 14, 16, 7, 5, 5, 0, 4,
755  0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 5, 10, 16, 20, 12, 17, 8, 13, 13, 0, 4,
756  0, 3, 7, 2, 0, 5, 5, 0, 6, 2, 0, 0, 3, 12, 16, 17, 17, 10, 19, 9, 11, 13, 0, 4,
757  3, 0, 19, 9, 11, 10, 3, 2, 0, 7, 7, 13, 20, 14, 17, 15, 18, 7, 18, 11, 11, 15, 0, 4,
758  0, 3, 4, 9, 10, 9, 0, 2, 0, 2, 0, 13, 13, 13, 14, 14, 17, 4, 17, 11, 11, 16, 0, 4,
759  0, 1, 0, 0, 0, 6, 0, 0, 1, 1, 0, 5, 13, 9, 11, 9, 12, 5, 14, 11, 10, 18, 0, 4,
760  0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 10, 9, 8, 7, 12, 2, 13, 10, 11, 17, 0, 4,
761  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 8, 2, 0, 4, 13, 8, 12, 19, 0, 4,
762  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 3, 0, 0, 0, 0, 5, 8, 15, 0, 2, 0,
763  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 5, 0,
764  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 3, 0, 0
765  };
766  RadiotherapyData case4_beam2(13, 24, case4_beam2_matrix);
767 
768  static const int case4_beam3_matrix[] = {
769  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0,
770  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0,
771  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 3, 2, 0, 0, 0, 0, 0, 0, 0,
772  0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 5, 4, 3, 0, 0, 0, 0, 0, 0, 1, 0,
773  0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 4, 4, 6, 3, 1, 0, 0, 5, 5, 0, 0, 1, 0,
774  1, 0, 0, 0, 11, 0, 9, 8, 5, 6, 3, 5, 6, 2, 0, 0, 1, 3, 4, 7, 0, 0, 0,
775  2, 2, 0, 0, 7, 11, 0, 6, 8, 5, 6, 2, 3, 0, 0, 0, 2, 1, 5, 3, 3, 0, 0,
776  1, 2, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 3, 1, 3, 2, 2, 0, 0,
777  1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 7, 2, 0, 3, 1, 2, 0, 0,
778  1, 0, 6, 2, 4, 7, 3, 0, 0, 0, 3, 4, 6, 8, 6, 6, 4, 0, 2, 1, 3, 0, 2,
779  0, 7, 6, 7, 7, 13, 14, 9, 10, 6, 6, 8, 8, 9, 8, 6, 5, 0, 2, 0, 2, 0, 2,
780  0, 7, 8, 8, 8, 12, 12, 14, 10, 8, 7, 8, 7, 7, 7, 5, 6, 0, 1, 0, 2, 0, 2,
781  0, 0, 0, 1, 7, 20, 13, 8, 17, 11, 6, 6, 5, 6, 9, 7, 7, 0, 1, 0, 3, 0, 2,
782  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 6, 7, 8, 8, 0, 1, 1, 4, 0, 2,
783  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 8, 0, 3, 2, 4, 0, 2,
784  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 4, 5, 0, 0,
785  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0,
786  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0
787  };
788  RadiotherapyData case4_beam3(18, 23, case4_beam3_matrix);
789 
790  static const int case4_beam4_matrix[] = {
791  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 7, 1, 2, 0, 0,
792  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 6, 0, 5, 0, 3, 1, 3, 1, 0,
793  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 7, 8, 10, 0, 2, 1, 4, 0, 0,
794  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 8, 9, 8, 1, 2, 1, 4, 0, 2,
795  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 7, 6, 4, 9, 9, 7, 0, 2, 2, 3, 0, 0,
796  0, 0, 0, 0, 3, 17, 8, 9, 15, 14, 6, 10, 5, 5, 7, 5, 5, 1, 2, 3, 3, 0, 2,
797  0, 0, 2, 7, 12, 20, 19, 16, 12, 12, 12, 9, 8, 8, 5, 2, 5, 0, 2, 3, 4, 0, 3,
798  0, 12, 10, 13, 9, 15, 15, 11, 11, 14, 8, 10, 10, 10, 5, 4, 3, 0, 2, 4, 4, 0, 0,
799  0, 2, 13, 4, 6, 12, 10, 6, 4, 7, 5, 6, 8, 8, 5, 4, 2, 0, 3, 3, 4, 0, 0,
800  1, 0, 4, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 3, 1, 0, 3, 3, 2, 0, 0,
801  2, 1, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 0, 4, 4, 0, 0, 0,
802  2, 3, 0, 0, 13, 0, 2, 9, 0, 8, 7, 8, 2, 0, 0, 0, 4, 2, 6, 4, 4, 0, 0,
803  0, 0, 0, 0, 0, 0, 4, 7, 1, 3, 7, 9, 7, 4, 0, 0, 1, 7, 5, 5, 0, 1, 0,
804  0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 9, 7, 8, 7, 1, 0, 0, 0, 0, 0, 0, 1, 0,
805  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 11, 2, 0, 0, 0, 0, 0, 0, 0, 0,
806  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 6, 0, 0, 0, 0, 0, 0, 0,
807  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 7, 0, 0, 0, 0, 0, 0, 0
808  };
809  RadiotherapyData case4_beam4(17, 23, case4_beam4_matrix);
810 
811  static const int case4_beam5_matrix[] = {
812  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 3, 0, 0, 0, 1, 4, 0, 0,
813  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0,
814  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 6, 0, 0, 0, 6, 2, 10, 0, 3, 0, 0,
815  3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 7, 9, 5, 6, 0, 12, 10, 7, 15, 0, 3, 0,
816  4, 0, 0, 0, 12, 0, 0, 0, 0, 9, 7, 10, 4, 4, 0, 8, 0, 15, 12, 10, 11, 0, 3, 0,
817  2, 0, 5, 12, 8, 0, 0, 9, 6, 14, 14, 8, 10, 8, 5, 5, 3, 18, 13, 12, 15, 0, 4, 0,
818  0, 19, 19, 15, 19, 1, 0, 17, 10, 14, 15, 13, 12, 9, 5, 8, 5, 20, 13, 13, 13, 0, 4, 1,
819  3, 3, 14, 0, 10, 0, 15, 8, 5, 9, 2, 5, 10, 11, 5, 9, 7, 20, 15, 11, 11, 0, 4, 0,
820  5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 8, 14, 9, 18, 11, 10, 11, 0, 4, 0,
821  0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 1, 0, 3, 4, 11, 12, 12, 13, 8, 11, 0, 4, 0,
822  0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 4, 0, 2, 0, 2, 10, 9, 13, 6, 0, 0, 2, 3, 0,
823  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 6, 4, 0, 0, 0, 0, 4, 0, 0
824  };
825  RadiotherapyData case4_beam5(12, 24, case4_beam5_matrix);
826 
827  static const int case5_beam1_matrix[] = {
828  1, 2, 1, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2,
829  1, 2, 0, 0, 0, 0, 0, 0, 0, 4, 0, 11, 0, 0, 0, 1,
830  1, 2, 0, 0, 0, 0, 0, 0, 1, 9, 8, 1, 8, 4, 5, 0,
831  1, 2, 0, 0, 5, 0, 4, 4, 1, 7, 4, 5, 5, 5, 4, 0,
832  0, 1, 0, 8, 2, 2, 1, 1, 0, 0, 0, 0, 2, 5, 1, 1,
833  0, 0, 2, 2, 4, 4, 4, 2, 0, 0, 0, 0, 0, 6, 3, 1,
834  0, 1, 3, 2, 3, 5, 4, 1, 2, 2, 4, 2, 2, 6, 4, 1,
835  0, 0, 0, 0, 1, 0, 0, 1, 0, 2, 4, 2, 0, 0, 0, 1,
836  0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 0, 0, 0, 0, 1,
837  0, 0, 1, 3, 3, 0, 2, 2, 1, 3, 6, 0, 0, 0, 0, 1,
838  0, 3, 2, 4, 7, 5, 2, 4, 4, 8, 0, 0, 2, 10, 3, 1,
839  0, 3, 3, 7, 9, 7, 4, 3, 0, 0, 0, 0, 0, 6, 4, 0,
840  2, 0, 1, 7, 0, 0, 0, 4, 0, 0, 0, 5, 0, 8, 3, 1,
841  2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 6, 0, 2, 1, 1,
842  2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2
843  };
844  RadiotherapyData case5_beam1(15, 16, case5_beam1_matrix);
845 
846  static const int case5_beam2_matrix[] = {
847  2, 2, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 1, 2,
848  2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
849  2, 3, 4, 0, 0, 0, 0, 5, 5, 5, 0, 0, 5, 0, 1, 0, 1,
850  2, 2, 4, 0, 0, 0, 0, 0, 2, 2, 3, 0, 3, 0, 1, 5, 0,
851  2, 2, 2, 0, 0, 0, 0, 0, 0, 8, 4, 0, 2, 2, 3, 8, 0,
852  3, 1, 1, 0, 0, 0, 3, 1, 2, 13, 14, 13, 4, 10, 2, 16, 0,
853  3, 2, 0, 0, 0, 0, 0, 0, 9, 19, 16, 6, 8, 18, 2, 9, 0,
854  3, 0, 0, 8, 8, 1, 6, 7, 6, 20, 8, 0, 0, 0, 0, 1, 2,
855  4, 2, 2, 17, 2, 0, 0, 0, 3, 13, 0, 1, 0, 1, 4, 0, 2,
856  2, 6, 0, 8, 0, 0, 3, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1,
857  0, 0, 5, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
858  0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
859  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2
860  };
861  RadiotherapyData case5_beam2(13, 17, case5_beam2_matrix);
862 
863  static const int case5_beam3_matrix[] = {
864  1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
865  1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 4, 1,
866  1, 2, 0, 0, 0, 0, 0, 0, 0, 10, 11, 5, 10, 3, 4, 1,
867  1, 2, 1, 2, 0, 0, 0, 3, 0, 0, 11, 5, 4, 0, 2, 0,
868  2, 1, 0, 9, 0, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1,
869  1, 3, 3, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2,
870  3, 0, 0, 4, 8, 6, 2, 7, 6, 9, 0, 0, 0, 0, 0, 2,
871  0, 0, 0, 12, 13, 11, 9, 12, 10, 7, 9, 5, 3, 10, 4, 0,
872  0, 0, 10, 14, 13, 10, 12, 15, 9, 11, 12, 8, 7, 8, 9, 0,
873  2, 0, 7, 13, 12, 12, 11, 14, 10, 10, 10, 1, 6, 7, 8, 0,
874  0, 1, 0, 9, 19, 11, 18, 14, 8, 0, 0, 0, 0, 7, 0, 0,
875  0, 0, 0, 0, 8, 20, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2,
876  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2,
877  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 2, 1, 2
878  };
879  RadiotherapyData case5_beam3(14, 16, case5_beam3_matrix);
880 
881  static const int case5_beam4_matrix[] = {
882  0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
883  0, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
884  0, 0, 11, 5, 3, 3, 12, 10, 20, 1, 0, 4, 6, 2, 6, 0,
885  1, 0, 9, 7, 7, 10, 11, 8, 8, 18, 12, 8, 6, 4, 8, 0,
886  0, 0, 9, 10, 9, 10, 12, 7, 9, 7, 6, 9, 5, 5, 6, 0,
887  0, 0, 0, 6, 11, 7, 8, 7, 4, 10, 6, 9, 1, 0, 5, 1,
888  3, 1, 0, 0, 5, 1, 3, 2, 0, 0, 0, 0, 0, 0, 0, 2,
889  1, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1,
890  1, 2, 0, 0, 2, 0, 2, 0, 0, 3, 0, 1, 3, 0, 0, 1,
891  1, 2, 0, 0, 0, 0, 0, 0, 11, 1, 6, 6, 4, 0, 3, 0,
892  1, 2, 0, 0, 0, 0, 0, 2, 9, 6, 3, 8, 6, 0, 6, 1,
893  1, 1, 1, 0, 0, 0, 0, 0, 6, 2, 0, 4, 1, 1, 3, 1,
894  1, 1, 1, 0, 0, 0, 0, 0, 3, 0, 0, 6, 0, 1, 1, 1,
895  1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 10, 1, 1, 0, 1
896  };
897  RadiotherapyData case5_beam4(14, 16, case5_beam4_matrix);
898 
899  static const int case5_beam5_matrix[] = {
900  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 2,
901  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
902  0, 0, 7, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
903  2, 0, 9, 12, 3, 0, 1, 0, 0, 10, 0, 0, 0, 0, 0, 0, 1,
904  3, 0, 10, 11, 11, 1, 9, 3, 5, 0, 6, 3, 14, 12, 0, 0, 3,
905  2, 0, 5, 7, 12, 5, 9, 10, 4, 0, 0, 5, 20, 2, 5, 0, 0,
906  1, 4, 0, 2, 4, 7, 3, 5, 9, 0, 0, 15, 15, 17, 4, 1, 0,
907  2, 4, 0, 0, 0, 0, 0, 0, 6, 0, 5, 12, 9, 14, 6, 8, 0,
908  2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 6, 3, 0,
909  2, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0,
910  2, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0,
911  2, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
912  };
913  RadiotherapyData case5_beam5(12, 17, case5_beam5_matrix);
915 
917  RadiotherapyData rds[] = {rd0, rd1,
918  case1_beam1,
919  case1_beam2,
920  case1_beam3,
921  case1_beam4,
922  case1_beam5,
923  case2_beam1,
924  case2_beam2,
925  case2_beam3,
926  case2_beam4,
927  case2_beam5,
928  case3_beam1,
929  case3_beam2,
930  case3_beam3,
931  case3_beam4,
932  case3_beam5,
933  case4_beam1,
934  case4_beam2,
935  case4_beam3,
936  case4_beam4,
937  case4_beam5,
938  case5_beam1,
939  case5_beam2,
940  case5_beam3,
941  case5_beam4,
942  case5_beam5
943  };
945  const unsigned int rds_n = sizeof(rds) / sizeof(RadiotherapyData);
946 }
947 // STATISTICS: example-any
void size(unsigned int s)
Set default size.
Definition: options.hpp:590
const int n
Width of intensity matrix.
Options for scripts with additional size parameter
Definition: driver.hh:679
NodeType t
Type of node.
Definition: bool-expr.cpp:234
IntVarBranch INT_VAR_NONE(void)
Select first unassigned variable.
Definition: var.hpp:100
virtual Choice * choice(const Space &, Archive &e)
Return choice.
IntVarArgs getRow(Radiotherapy *row, int i)
int size(void) const
Return size of array (number of elements)
Definition: array.hpp:1657
void post(Home home, Term *t, int n, FloatRelType frt, FloatVal c)
Post propagator for linear constraint over floats.
Definition: post.cpp:242
int main(int argc, char *argv[])
Main-function.
void branch(Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatValBranch vals, FloatBranchFilter bf, FloatVarValPrint vvp)
Branch over x with variable selection vars and value selection vals.
Definition: branch.cpp:43
const FloatNum max
Largest allowed float value.
Definition: float.hh:848
Actor must always be disposed.
Definition: core.hpp:554
void put(unsigned int i)
Add i to the contents.
Definition: archive.hpp:178
void update(Space &home, VarArray< Var > &a)
Update array to be a clone of array a.
Definition: array.hpp:1060
Search engine options
Definition: search.hh:748
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc)
Definition: options.cpp:670
Less or equal ( )
Definition: int.hh:907
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatVal c)
Post propagator for .
Definition: linear.cpp:45
virtual Gecode::Choice * choice(Space &home)
Return choice.
size_t dispose(Space &home)
Dispose member function.
Integer variable array.
Definition: int.hh:742
Multi _c(Gecode::IntArgs(3, 1, 2, 3))
const int m
Height of intensity matrix.
Computation spaces.
Definition: core.hpp:1668
Parametric base-class for scripts.
Definition: driver.hh:733
Base-class for both propagators and branchers.
Definition: core.hpp:620
Nested search on the q variables.
virtual IntVar cost(void) const
Cost to be minimized.
Gecode::FloatVal c(-8, 8)
RadiotherapyData(int m0, int n0, const int *intensity0)
Construct instance data.
Gecode::IntArgs i(4, 1, 2, 3, 4)
Base-class for branchers.
Definition: core.hpp:1368
virtual void print(std::ostream &os) const
Print solution.
void quicksort(Type *l, Type *r, Less &less)
Standard quick sort.
Definition: sort.hpp:134
void init(int n)
Initialize as array with n elements.
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:238
Equality ( )
Definition: int.hh:905
Options opt
The options.
Definition: test.cpp:101
Execution has resulted in failure.
Definition: core.hpp:466
int size(void) const
Return number of elements.
IntValBranch INT_VAL_MIN(void)
Select smallest value.
Definition: val.hpp:59
unsigned int size(I &i)
Size of all ranges of range iterator i.
bool clone
Whether engines create a clone when being initialized.
Definition: search.hh:751
virtual void print(const Space &, const Gecode::Choice &_c, unsigned int, std::ostream &o) const
Print explanation.
void update(Space &home, VarImpVar< VarImp > &y)
Update this variable to be a clone of variable y.
Definition: var.hpp:128
Radiotherapy(Radiotherapy &s)
Constructor for cloning s.
Passing integer variables.
Definition: int.hh:637
const int * intensity
Intensity matrix.
Passing integer arguments.
Definition: int.hh:608
T * dfs(T *s, const Search::Options &o)
Invoke depth-first search engine for subclass T of space s with options o.
Definition: dfs.hpp:77
virtual Space * copy(void)
Perform copying during cloning.
IntPropLevel ba(IntPropLevel ipl)
Extract basic or advanced from propagation level.
Definition: ipl.hpp:47
struct Gecode::@585::NNF::@62::@63 b
For binary nodes (and, or, eqv)
Post propagator for SetVar SetOpType SetVar y
Definition: set.hh:769
int intsSum
Sum of all intensities.
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
Definition: core.hpp:3944
virtual void archive(Archive &e) const
Archive into e.
Definition: core.cpp:857
Choice for performing commit
Definition: core.hpp:1338
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
Definition: core.hpp:3929
Instance data for radio therapy problem.
virtual size_t dispose(Space &home)
Delete actor and return its size.
Definition: core.hpp:3172
void incr_sum(IntVar &x, IntVarArgs &y, int mn)
Post incremental sum constraint.
Archive representation
Definition: archive.hpp:46
ExecStatus
Definition: core.hpp:464
Integer variables.
Definition: int.hh:351
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Definition: rel.cpp:47
Domain propagation Options: basic versus advanced propagation.
Definition: int.hh:958
int btMin
Minimal beam time (computed from other parameters)
virtual ExecStatus commit(Space &, const Gecode::Choice &_c, unsigned int)
Perform commit for choice _c and alternative a.
void solutions(unsigned int n)
Set default number of solutions to search for.
Definition: options.hpp:287
Post propagator for SetVar x
Definition: set.hh:769
Execution is okay.
Definition: core.hpp:468
bool operator<(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:230
IntValBranch INT_VAL_SPLIT_MIN(void)
Select values not greater than mean of smallest and largest value.
Definition: val.hpp:79
Gecode toplevel namespace
LinFloatExpr sum(const FloatVarArgs &x)
Construct linear float expression as sum of float variables.
Definition: float-expr.cpp:548
Home class for posting propagators
Definition: core.hpp:846
int btMax
Maximal beam time (computed from other parameters)
static void post(Home home)
Post brancher.
Radiotherapy(const SizeOptions &opt)
The actual problem.
Example: Radiotherapy
virtual Actor * copy(Space &home)
Copy brancher.
IntRelType swap(IntRelType irt)
Return swapped relation type of irt.
Definition: irt.hpp:41
virtual bool status(const Space &) const
Check status of brancher, return true if alternatives left.