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);
69 : m(m0), n(n0), intensity(intensity0) {
72 for (
int i=0;
i<m*
n;
i++) {
74 intsSum += intensity[
i];
78 for (
int i=0;
i<m;
i++)
85 extern const unsigned int rds_n;
122 : rd(rds[opt.
size()]) {
136 for (
int i=0;
i<rd.
m;
i++) {
137 for (
int j=0; j<rd.
n; j++) {
145 for (
int i=0;
i<rd.
m;
i++) {
148 for (
int j=0; j<rd.
n; j++)
150 incr_sum(N[
b], qs, rd.
m*rd.
n);
155 rel(*
this, _cost == beamtime*(rd.
m*rd.
n+1)+K);
172 for (
int i=1;
i<y.
size();
i++) {
173 rel(*
this, s[
i-1] >= y[
i]-y[
i-1]);
182 beamtime.
update(*
this, share, s.beamtime);
183 N.
update(*
this, share, s.N);
184 K.
update(*
this, share, s.K);
185 _cost.
update(*
this, share, s._cost);
186 q.
update(*
this, share, s.q);
197 cost(
void)
const {
return _cost; }
203 <<
"B / K = " << beamtime <<
" / " << K <<
",\nN = " << N << std::endl;
215 bool operator<(
const Idx& rhs)
const {
return weight > rhs.weight; }
229 virtual size_t size(
void)
const {
230 return sizeof(Choice);
233 virtual void archive(
Archive& e)
const {
243 index.
init(rt.rd.
m+1);
244 for (
int i = rt.rd.
m;
i--; ) {
247 for (
int j = rt.rd.
n; j--; )
251 for (
int i = rt.rd.
m;
i--; )
253 index[rt.rd.
m].idx = 10;
259 :
Brancher(home, share, b), done(b.done) {
260 index.
update(home, share, b.index);
269 for (
int j=0; j<row->rd.
n; j++) {
270 for (
int b=0; b<row->rd.
btMax; b++) {
286 for (
int i=0;
i<rt.rd.
m;
i++) {
291 branch(*row, getRow(row, index[
i].idx),
297 std::cerr << index[
i].idx;
301 index[
i].weight += 1;
302 if (
i && index[
i] < index[
i-1])
303 std::swap(index[
i], index[i-1]);
308 return new Choice(*
this, fail);
312 bool fail; e >> fail;
313 return new Choice(*
this, fail);
322 std::ostream& o)
const {
323 const Choice&
c =
static_cast<const Choice&
>(
_c);
324 o << (c.fail ?
"fail" :
"ok");
338 if (!--index[index.
size()-1].idx) {
339 index[index.
size()-1].idx = 10;
340 for (
int i = index.
size()-1;
i--; )
341 index[
i].weight *= 0.9;
344 (void) index.~SharedArray<Idx>();
345 return sizeof(*this);
359 opt.
parse(argc,argv);
361 if (opt.
size() >= rds_n) {
362 std::cerr <<
"Error: size must be between 0 and "
363 << rds_n-1 << std::endl;
367 IntMinimizeScript::run<Radiotherapy,BAB,SizeOptions>(
opt);
379 static const int intensity0[] = {
389 static const int intensity1[] = {
390 6, 10, 6, 8, 10, 0, 4, 10, 0, 6, 2, 8, 0, 2, 0 ,
391 1, 8, 3, 1, 0, 8, 0, 3, 6, 10, 9, 8, 9, 6, 9 ,
392 8, 5, 6, 7, 7, 0, 6, 8, 2, 7, 5, 2, 0, 9, 2 ,
393 9, 2, 10, 5, 7, 1, 3, 7, 5, 1, 8, 2, 3, 10, 4 ,
394 8, 7, 4, 1, 6, 3, 0, 1, 2, 6, 4, 4, 0, 5, 0 ,
395 9, 0, 7, 4, 9, 7, 4, 1, 4, 1, 1, 9, 2, 9, 9 ,
396 3, 6, 10, 0, 6, 6, 10, 10, 7, 0, 10, 2, 10, 2, 4 ,
397 8, 9, 5, 2, 6, 1, 9, 0, 4, 2, 4, 1, 5, 1, 4 ,
398 6, 10, 0, 0, 7, 0, 0, 5, 8, 5, 10, 3, 2, 2, 10 ,
399 4, 3, 0, 6, 10, 7, 2, 7, 2, 9, 2, 8, 9, 7, 9 ,
400 10, 2, 0, 5, 5, 1, 3, 7, 1, 6, 5, 4, 2, 8, 1 ,
401 3, 6, 4, 3, 7, 10, 6, 7, 7, 6, 5, 9, 10, 8, 3 ,
402 9, 9, 5, 2, 4, 2, 3, 3, 1, 2, 9, 2, 5, 6, 3 ,
403 7, 5, 2, 6, 4, 8, 1, 0, 2, 4, 7, 9, 3, 3, 0 ,
404 5, 3, 8, 7, 10, 6, 7, 7, 6, 10, 4, 4, 5, 8, 0
427 static const int case1_beam1_matrix[] = {
428 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
429 2, 1, 0, 0, 0, 0, 0, 0, 0, 5, 0, 3, 0, 2,
430 3, 1, 0, 0, 0, 0, 0, 0, 18, 0, 0, 4, 6, 0,
431 2, 0, 0, 3, 11, 8, 15, 1, 11, 0, 0, 0, 10, 0,
432 0, 0, 0, 9, 11, 14, 6, 2, 7, 0, 0, 0, 7, 0,
433 0, 8, 2, 7, 10, 11, 7, 2, 0, 7, 0, 0, 0, 1,
434 0, 0, 4, 1, 6, 7, 0, 0, 0, 0, 0, 0, 0, 1,
435 0, 3, 1, 0, 4, 6, 0, 0, 0, 1, 0, 0, 0, 1,
436 0, 1, 5, 6, 8, 8, 5, 0, 2, 0, 0, 0, 7, 0,
437 0, 5, 2, 8, 10, 11, 5, 3, 7, 0, 2, 4, 11, 0,
438 0, 0, 0, 1, 12, 13, 9, 7, 11, 1, 2, 3, 6, 0,
439 0, 0, 0, 0, 0, 0, 0, 4, 20, 0, 0, 8, 5, 0,
440 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 0, 2,
441 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
442 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 1
446 static const int case1_beam2_matrix[] = {
447 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 4, 3, 4, 0, 2,
448 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 2, 0, 1,
449 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 1, 0, 0, 3,
450 0, 0, 0, 5, 5, 3, 0, 0, 3, 2, 8, 6, 0, 0, 3,
451 0, 0, 7, 11, 10, 11, 5, 8, 4, 11, 13, 20, 0, 0, 3,
452 0, 10, 10, 9, 7, 7, 7, 2, 9, 0, 0, 0, 9, 0, 2,
453 0, 4, 7, 7, 5, 6, 2, 0, 4, 0, 0, 0, 3, 0, 2,
454 0, 10, 2, 7, 1, 2, 0, 0, 0, 0, 0, 0, 0, 3, 1,
455 0, 0, 5, 6, 3, 1, 0, 6, 8, 0, 0, 0, 0, 1, 2,
456 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2,
457 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2
461 static const int case1_beam3_matrix[] = {
462 2, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 1,
463 1, 2, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 1, 2, 2,
464 1, 3, 0, 0, 0, 0, 0, 0, 0, 6, 4, 1, 12, 0, 2,
465 2, 0, 0, 0, 0, 0, 0, 0, 0, 11, 6, 1, 9, 0, 2,
466 2, 0, 0, 0, 0, 0, 0, 0, 2, 11, 0, 0, 0, 2, 1,
467 0, 0, 0, 0, 0, 1, 0, 4, 0, 0, 0, 0, 0, 1, 1,
468 0, 3, 0, 2, 6, 7, 6, 6, 4, 0, 0, 0, 0, 0, 2,
469 0, 0, 10, 12, 11, 10, 13, 13, 12, 5, 0, 0, 0, 0, 2,
470 0, 0, 11, 12, 10, 10, 14, 15, 15, 5, 2, 7, 12, 0, 2,
471 0, 9, 5, 9, 7, 6, 12, 16, 13, 8, 5, 7, 7, 0, 2,
472 2, 0, 0, 0, 0, 0, 4, 20, 12, 8, 1, 6, 8, 0, 2,
473 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 7, 0, 2,
474 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
475 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1,
476 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 1
480 static const int case1_beam4_matrix[] = {
481 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 2,
482 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2,
483 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2,
484 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 13, 0, 4, 0, 2,
485 0, 6, 5, 5, 8, 9, 11, 20, 8, 9, 18, 10, 7, 0, 2,
486 0, 3, 10, 9, 12, 11, 15, 15, 11, 11, 16, 15, 3, 0, 3,
487 0, 5, 7, 12, 14, 11, 15, 15, 13, 10, 15, 10, 5, 0, 3,
488 0, 5, 1, 9, 11, 9, 13, 9, 12, 6, 3, 0, 0, 0, 2,
489 0, 0, 0, 0, 4, 2, 4, 0, 7, 0, 0, 0, 0, 0, 2,
490 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
491 2, 0, 0, 1, 7, 4, 0, 0, 0, 10, 10, 4, 0, 1, 1,
492 2, 2, 0, 0, 0, 0, 0, 4, 0, 14, 14, 9, 0, 0, 1,
493 2, 2, 0, 0, 0, 0, 0, 0, 0, 12, 16, 5, 1, 0, 2,
494 2, 2, 0, 0, 0, 0, 0, 0, 1, 10, 12, 6, 3, 0, 2,
495 1, 3, 0, 0, 0, 0, 0, 0, 2, 12, 15, 3, 0, 1, 2
499 static const int case1_beam5_matrix[] = {
500 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2,
501 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2,
502 0, 0, 6, 4, 3, 1, 0, 0, 7, 0, 0, 0, 0, 3, 2,
503 0, 13, 6, 1, 1, 1, 5, 0, 2, 0, 0, 0, 0, 1, 2,
504 0, 2, 12, 5, 4, 2, 2, 0, 1, 20, 11, 11, 5, 0, 2,
505 0, 9, 12, 7, 3, 2, 7, 3, 5, 14, 12, 13, 11, 0, 2,
506 0, 5, 11, 13, 6, 6, 5, 5, 5, 15, 11, 13, 12, 0, 2,
507 0, 0, 0, 1, 4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 11, 0, 3, 2, 7, 11, 10, 13, 7, 2, 2, 0, 0, 0, 2,
550 3, 0, 0, 14, 10, 1, 5, 2, 8, 15, 9, 9, 13, 5, 0, 0, 0, 0, 3,
551 2, 0, 0, 16, 9, 5, 5, 4, 7, 18, 0, 0, 0, 0, 0, 0, 0, 1, 2,
552 2, 0, 0, 15, 10, 7, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2,
553 2, 0, 0, 0, 18, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2
557 static const int case2_beam3_matrix[] = {
558 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,
559 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
560 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 4, 3, 2, 6, 2, 2,
561 1, 0, 0, 0, 0, 0, 0, 4, 2, 10, 11, 12, 7, 7, 4, 0, 4, 1,
562 2, 0, 0, 0, 0, 0, 0, 4, 6, 9, 10, 12, 6, 5, 4, 4, 3, 2,
563 2, 0, 0, 0, 0, 14, 0, 7, 2, 9, 8, 8, 3, 6, 4, 4, 2, 2,
564 3, 0, 0, 0, 10, 11, 0, 0, 1, 7, 4, 2, 2, 0, 0, 0, 2, 2,
565 0, 0, 0, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
566 0, 0, 0, 0, 4, 1, 1, 0, 2, 2, 0, 0, 2, 0, 3, 0, 1, 2,
567 0, 0, 0, 0, 5, 5, 7, 7, 8, 9, 5, 8, 1, 1, 0, 0, 0, 3,
568 0, 0, 8, 0, 10, 10, 12, 15, 16, 10, 7, 6, 0, 3, 0, 0, 0, 3,
569 0, 0, 20, 4, 12, 12, 11, 19, 17, 17, 11, 9, 12, 12, 11, 13, 3, 1,
570 0, 0, 0, 11, 8, 10, 11, 15, 18, 12, 5, 3, 6, 8, 11, 12, 9, 0,
571 1, 0, 0, 6, 10, 1, 3, 17, 17, 13, 5, 1, 4, 16, 8, 15, 3, 1,
572 2, 0, 0, 8, 0, 0, 0, 0, 0, 11, 6, 0, 6, 0, 0, 0, 0, 3,
573 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2,
574 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2,
575 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2
579 static const int case2_beam4_matrix[] = {
580 3, 0, 5, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 2, 2,
581 0, 0, 5, 2, 2, 0, 7, 3, 3, 0, 0, 0, 0, 0, 0, 3, 1, 2,
582 0, 0, 0, 4, 3, 0, 8, 11, 9, 4, 0, 2, 0, 0, 0, 0, 4, 1,
583 0, 0, 9, 5, 5, 2, 12, 13, 10, 7, 3, 1, 4, 0, 0, 0, 0, 3,
584 0, 16, 9, 4, 10, 7, 15, 16, 8, 5, 6, 4, 7, 10, 0, 11, 0, 2,
585 0, 0, 12, 6, 12, 12, 18, 18, 14, 9, 7, 7, 8, 12, 13, 12, 10, 0,
586 0, 0, 0, 8, 13, 15, 18, 20, 12, 13, 12, 12, 12, 13, 11, 10, 8, 0,
587 0, 0, 0, 3, 5, 14, 17, 16, 11, 8, 4, 10, 12, 11, 14, 9, 1, 3,
588 0, 0, 0, 0, 0, 3, 14, 8, 5, 4, 5, 9, 4, 0, 0, 0, 0, 3,
589 4, 3, 0, 0, 1, 0, 8, 3, 3, 0, 0, 0, 0, 0, 2, 0, 0, 3,
590 1, 7, 0, 0, 1, 2, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
591 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 5, 1, 4, 1, 4, 0, 0, 2,
592 2, 5, 4, 0, 0, 0, 0, 0, 0, 0, 8, 10, 7, 0, 6, 1, 4, 1,
593 2, 4, 4, 0, 0, 0, 0, 0, 0, 4, 5, 5, 6, 1, 6, 6, 2, 2,
594 2, 4, 3, 2, 0, 0, 0, 0, 4, 3, 12, 2, 1, 7, 3, 4, 2, 2,
595 2, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 3, 7, 3, 12, 5, 5, 1,
596 2, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 2, 2,
597 3, 3, 5, 0, 3, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 3
601 static const int case2_beam5_matrix[] = {
602 0, 0, 0, 15, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2,
603 0, 0, 2, 10, 16, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2,
604 0, 0, 6, 9, 15, 3, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 3,
605 2, 4, 9, 12, 15, 3, 4, 0, 3, 0, 2, 17, 13, 0, 0, 0, 2, 3,
606 0, 5, 12, 14, 17, 5, 2, 0, 0, 8, 17, 16, 13, 4, 0, 0, 0, 3,
607 0, 6, 13, 16, 17, 5, 2, 2, 4, 5, 12, 10, 10, 13, 6, 0, 0, 3,
608 0, 0, 20, 17, 18, 8, 4, 5, 6, 10, 14, 13, 11, 2, 1, 4, 0, 3,
609 0, 0, 0, 14, 18, 11, 8, 9, 9, 10, 13, 12, 8, 8, 5, 6, 5, 0,
610 0, 0, 0, 2, 11, 10, 6, 3, 1, 6, 10, 11, 5, 8, 9, 8, 9, 0,
611 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 3, 10, 4, 5, 3, 1,
612 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 6, 6, 2, 2, 2, 2, 1,
613 0, 0, 0, 0, 0, 0, 1, 0, 3, 3, 4, 3, 4, 1, 0, 0, 2, 0,
614 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0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 6, 3, 3, 5, 9, 0, 1, 1,
638 0, 6, 17, 4, 14, 14, 6, 1, 1, 5, 2, 3, 5, 7, 0, 1, 0,
639 0, 0, 0, 11, 6, 13, 7, 2, 2, 5, 2, 4, 3, 6, 0, 2, 0,
640 1, 0, 0, 0, 6, 0, 8, 2, 3, 5, 3, 7, 4, 7, 0, 0, 0,
641 0, 0, 0, 0, 0, 0, 6, 0, 4, 4, 7, 10, 4, 0, 0, 0, 0,
642 0, 0, 0, 0, 0, 0, 0, 0, 2, 8, 5, 0, 10, 0, 1, 0, 0,
643 0, 0, 0, 0, 0, 0, 0, 0, 6, 2, 0, 0, 0, 0, 1, 0, 0,
644 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0
648 static const int case3_beam2_matrix[] = {
649 0, 0, 1, 1, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
650 0, 0, 8, 0, 1, 4, 5, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0,
651 2, 0, 0, 0, 3, 2, 2, 1, 1, 0, 0, 1, 4, 7, 11, 9, 0, 0, 0,
652 2, 0, 0, 0, 3, 2, 2, 0, 2, 4, 1, 4, 7, 11, 10, 20, 1, 0, 0,
653 3, 0, 2, 0, 2, 2, 2, 1, 7, 8, 5, 9, 13, 16, 13, 14, 12, 0, 0,
654 2, 0, 1, 0, 3, 2, 4, 5, 15, 16, 12, 11, 15, 17, 15, 14, 9, 0, 3,
655 2, 0, 11, 0, 6, 3, 0, 5, 17, 16, 10, 10, 13, 17, 13, 14, 7, 1, 3,
656 2, 0, 5, 0, 8, 1, 0, 2, 16, 16, 9, 8, 10, 14, 12, 13, 12, 0, 3,
657 0, 0, 0, 2, 8, 1, 0, 7, 15, 17, 7, 8, 10, 12, 9, 12, 5, 1, 0,
658 0, 0, 0, 0, 5, 0, 2, 7, 15, 13, 5, 4, 9, 7, 4, 0, 0, 2, 0,
659 0, 0, 0, 0, 4, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
660 0, 0, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
661 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
662 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
663 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
667 static const int case3_beam3_matrix[] = {
668 0, 0, 0, 0, 0, 0, 0, 0, 15, 8, 10, 0, 0, 0, 0, 0, 0,
669 0, 0, 0, 0, 0, 0, 0, 15, 10, 7, 10, 7, 18, 0, 0, 0, 0,
670 0, 3, 5, 5, 3, 0, 7, 8, 12, 9, 12, 11, 20, 0, 0, 0, 0,
671 0, 0, 0, 4, 5, 2, 6, 5, 12, 9, 12, 12, 14, 3, 0, 1, 0,
672 0, 0, 0, 7, 2, 4, 7, 9, 11, 9, 10, 10, 7, 5, 0, 0, 0,
673 0, 0, 1, 7, 1, 2, 7, 8, 10, 4, 5, 1, 0, 0, 0, 0, 0,
674 0, 0, 0, 3, 0, 3, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0,
675 0, 7, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0,
676 3, 2, 4, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 7, 10, 8, 0,
677 0, 0, 4, 4, 0, 0, 0, 9, 6, 7, 7, 10, 6, 13, 8, 10, 0,
678 0, 6, 12, 12, 0, 0, 0, 15, 9, 11, 15, 16, 15, 17, 4, 17, 0,
679 0, 5, 14, 12, 5, 0, 9, 18, 15, 18, 19, 18, 16, 17, 6, 14, 0,
680 0, 14, 7, 13, 3, 2, 16, 17, 13, 17, 17, 16, 17, 12, 8, 12, 0,
681 0, 4, 14, 8, 5, 1, 10, 12, 7, 19, 17, 18, 15, 13, 0, 0, 3,
682 0, 0, 6, 10, 0, 0, 0, 4, 5, 16, 17, 16, 13, 15, 2, 0, 3,
683 0, 0, 0, 0, 0, 0, 0, 0, 5, 17, 15, 16, 12, 15, 2, 2, 0,
684 1, 0, 0, 0, 0, 0, 2, 2, 0, 7, 15, 9, 11, 13, 7, 1, 0,
685 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 15, 0, 3, 0,
686 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 1, 2, 0,
687 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0
691 static const int case3_beam4_matrix[] = {
692 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0,
693 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 3, 0,
694 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 12, 0, 3, 0,
695 2, 0, 0, 0, 0, 0, 2, 0, 10, 9, 20, 0, 0, 15, 0, 3, 0,
696 0, 0, 0, 14, 0, 0, 0, 3, 7, 11, 16, 16, 6, 16, 2, 2, 0,
697 0, 0, 10, 9, 5, 0, 0, 16, 7, 10, 17, 16, 13, 11, 12, 0, 0,
698 0, 9, 10, 10, 5, 2, 11, 9, 9, 12, 16, 18, 12, 13, 3, 0, 3,
699 0, 5, 11, 10, 6, 4, 10, 15, 10, 13, 17, 18, 16, 5, 11, 0, 2,
700 0, 1, 13, 11, 7, 2, 19, 12, 14, 12, 16, 18, 16, 12, 7, 11, 0,
701 0, 0, 14, 6, 7, 0, 0, 11, 13, 13, 17, 16, 16, 11, 7, 11, 0,
702 0, 0, 5, 0, 0, 0, 0, 7, 4, 8, 11, 12, 12, 10, 7, 9, 0,
703 2, 0, 0, 0, 0, 0, 0, 1, 2, 2, 5, 5, 7, 7, 8, 1, 1,
704 3, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 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7, 3, 10, 3, 5, 7, 4, 0,
746 2, 0, 0, 0, 16, 0, 0, 0, 0, 0, 3, 2, 4, 7, 9, 4, 9, 3, 5, 6, 4, 0,
747 0, 0, 0, 0, 0, 0, 0, 12, 6, 8, 5, 4, 5, 8, 6, 3, 8, 3, 5, 6, 3, 0,
748 0, 0, 0, 0, 0, 0, 0, 14, 15, 10, 0, 3, 9, 8, 4, 2, 7, 3, 4, 5, 1, 0,
749 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, 4, 2, 7, 2, 4, 5, 0, 2,
750 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 4, 1, 8, 2, 3, 2, 2, 2,
751 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 12, 5, 0, 0, 0, 0, 0, 2,
752 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 0, 0, 0
756 static const int case4_beam2_matrix[] = {
757 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
758 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 3, 2, 9, 17, 10, 11, 6, 0, 0, 5, 0,
759 0, 0, 0, 0, 0, 0, 7, 6, 0, 0, 0, 0, 1, 2, 7, 14, 16, 14, 16, 7, 5, 5, 0, 4,
760 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 5, 10, 16, 20, 12, 17, 8, 13, 13, 0, 4,
761 0, 3, 7, 2, 0, 5, 5, 0, 6, 2, 0, 0, 3, 12, 16, 17, 17, 10, 19, 9, 11, 13, 0, 4,
762 3, 0, 19, 9, 11, 10, 3, 2, 0, 7, 7, 13, 20, 14, 17, 15, 18, 7, 18, 11, 11, 15, 0, 4,
763 0, 3, 4, 9, 10, 9, 0, 2, 0, 2, 0, 13, 13, 13, 14, 14, 17, 4, 17, 11,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
818 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0,
819 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 6, 0, 0, 0, 6, 2, 10, 0, 3, 0, 0,
820 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 7, 9, 5, 6, 0, 12, 10, 7, 15, 0, 3, 0,
821 4, 0, 0, 0, 12, 0, 0, 0, 0, 9, 7, 10, 4, 4, 0, 8, 0, 15, 12, 10, 11, 0, 3, 0,
822 2, 0, 5, 12, 8, 0, 0, 9, 6, 14, 14, 8, 10, 8, 5, 5, 3, 18, 13, 12, 15, 0, 4, 0,
823 0, 19, 19, 15, 19, 1, 0, 17, 10, 14, 15, 13, 12, 9, 5, 8, 5, 20, 13, 13, 13, 0, 4, 1,
824 3, 3, 14, 0, 10, 0, 15, 8, 5, 9, 2, 5, 10, 11, 5, 9, 7, 20, 15, 11, 11, 0, 4, 0,
825 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 8, 14, 9, 18, 11, 10, 11, 0, 4, 0,
826 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 1, 0, 3, 4, 11, 12, 12, 13, 8, 11, 0, 4, 0,
827 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 4, 0, 2, 0, 2, 10, 9, 13, 6, 0, 0, 2, 3, 0,
828 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 6, 4, 0, 0, 0, 0, 4, 0, 0
832 static const int case5_beam1_matrix[] = {
833 1, 2, 1, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2,
834 1, 2, 0, 0, 0, 0, 0, 0, 0, 4, 0, 11, 0, 0, 0, 1,
835 1, 2, 0, 0, 0, 0, 0, 0, 1, 9, 8, 1, 8, 4, 5, 0,
836 1, 2, 0, 0, 5, 0, 4, 4, 1, 7, 4, 5, 5,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, 0, 3, 13, 0, 1, 0, 1, 4, 0, 2,
861 2, 6, 0, 8, 0, 0, 3, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1,
862 0, 0, 5, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
863 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
864 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2
868 static const int case5_beam3_matrix[] = {
869 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
870 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 4, 1,
871 1, 2, 0, 0, 0, 0, 0, 0, 0, 10, 11, 5, 10, 3, 4, 1,
872 1, 2, 1, 2, 0, 0, 0, 3, 0, 0, 11, 5, 4, 0, 2, 0,
873 2, 1, 0, 9, 0, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1,
874 1, 3, 3, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2,
875 3, 0, 0, 4, 8, 6, 2, 7, 6, 9, 0, 0, 0, 0, 0, 2,
876 0, 0, 0, 12, 13, 11, 9, 12, 10, 7, 9, 5, 3, 10, 4, 0,
877 0, 0, 10, 14, 13, 10, 12, 15, 9, 11, 12, 8, 7, 8, 9, 0,
878 2, 0, 7, 13, 12, 12, 11, 14, 10, 10, 10, 1, 6, 7, 8, 0,
879 0, 1, 0, 9, 19, 11, 18, 14, 8, 0, 0, 0, 0, 7, 0, 0,
880 0, 0, 0, 0, 8, 20, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2,
881 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2,
882 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 2, 1, 2
886 static const int case5_beam4_matrix[] = {
887 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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0, 0, 15, 15, 17, 4, 1, 0,
912 2, 4, 0, 0, 0, 0, 0, 0, 6, 0, 5, 12, 9, 14, 6, 8, 0,
913 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 6, 3, 0,
914 2, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0,
915 2, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0,
916 2, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
void size(unsigned int s)
Set default size.
const int n
Width of intensity matrix.
Options for scripts with additional size parameter
IntVarBranch INT_VAR_NONE(void)
Select first unassigned variable.
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatNum c)
Post propagator for .
virtual Choice * choice(const Space &, Archive &e)
Return choice.
IntVarArgs getRow(Radiotherapy *row, int i)
void post(Home home, Term *t, int n, FloatRelType frt, FloatVal c)
Post propagator for linear constraint over floats.
int main(int argc, char *argv[])
Main-function.
const FloatNum max
Largest allowed float value.
Actor must always be disposed.
void put(unsigned int i)
Add i to the contents.
int size(void) const
Return size of array (number of elements)
void update(Space &home, bool share, VarImpVar< VarImp > &y)
Update this variable to be a clone of variable y.
virtual bool status(const Space &) const
Check status of brancher, return true if alternatives left.
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc)
virtual Gecode::Choice * choice(Space &home)
Return choice.
size_t dispose(Space &home)
Dispose member function.
const int m
Height of intensity matrix.
Parametric base-class for scripts.
Base-class for both propagators and branchers.
virtual Actor * copy(Space &home, bool share)
Copy brancher.
Nested search on the q variables.
void update(Space &, bool share, VarArray< Var > &a)
Update array to be a clone of array a.
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.
void quicksort(Type *l, Type *r, Less &less)
Standard quick sort.
void init(int n)
Initialize as array with n elements.
int n
Number of negative literals for node type.
Execution has resulted in failure.
virtual IntVar cost(void) const
Cost to be minimized.
IntValBranch INT_VAL_MIN(void)
Select smallest value.
virtual void archive(Archive &e) const
Archive into e.
unsigned int size(I &i)
Size of all ranges of range iterator i.
virtual void print(const Space &, const Gecode::Choice &_c, unsigned int, std::ostream &o) const
Print explanation.
bool clone
Whether engines create a clone when being initialized.
virtual void print(std::ostream &os) const
Print solution.
int size(void) const
Return number of elements.
Passing integer variables.
const int * intensity
Intensity matrix.
Passing integer arguments.
T * dfs(T *s, const Search::Options &o)
Invoke depth-first search engine for subclass T of space s with options o.
static BrancherHandle post(Home home)
Post brancher.
void update(Space &home, bool share, SharedHandle &sh)
Updating during cloning.
int intsSum
Sum of all intensities.
virtual Space * copy(bool share)
Perform copying during cloning.
Node * x
Pointer to corresponding Boolean expression node.
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
Choice for performing commit
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
Instance data for radio therapy problem.
virtual size_t dispose(Space &home)
Delete actor and return its size.
void incr_sum(IntVar &x, IntVarArgs &y, int mn)
Post incremental sum constraint.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
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.
bool operator<(const FloatVal &x, const FloatVal &y)
IntValBranch INT_VAL_SPLIT_MIN(void)
Select values not greater than mean of smallest and largest value.
struct Gecode::@518::NNF::@57::@58 b
For binary nodes (and, or, eqv)
Gecode toplevel namespace
LinFloatExpr sum(const FloatVarArgs &x)
Construct linear float expression as sum of float variables.
BrancherHandle 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.
Home class for posting propagators
int btMax
Maximal beam time (computed from other parameters)
Radiotherapy(bool share, Radiotherapy &s)
Constructor for cloning s.
Domain propagation or consistency.
Radiotherapy(const SizeOptions &opt)
The actual problem.
Multi _c(Gecode::IntArgs(3, 1, 2, 3))