42 #ifdef GECODE_HAS_SET_VARS
57 namespace Test {
namespace LDSB {
59 using namespace Gecode;
65 if (a.
size() != b.
size())
return false;
66 for (
int i = 0 ;
i < a.
size() ; ++
i)
72 #ifdef GECODE_HAS_SET_VARS
77 if (a.
size() != b.
size())
return false;
78 for (
int i = 0 ;
i < a.
size() ; ++
i) {
85 if (x.
val() != y.
val())
return false;
103 template <
class T,
class VarArgsType>
106 int nexpected = expected.size();
107 for (
int i = 0 ;
i < nexpected ; ++
i) {
111 olog <<
"Expected a solution but there are no more solutions." << std::endl;
112 olog <<
"(Expected " << nexpected <<
" but only found " <<
i <<
")" << std::endl;
113 olog <<
"Expected: " << expected[
i] << std::endl;
117 if (!
equal(s->solution(), expected[
i])) {
119 olog <<
"Solution does not match expected." << std::endl;
120 olog <<
"Solution: " << s->solution() << std::endl;
121 olog <<
"Expected: " << expected[
i] << std::endl;
130 olog <<
"More solutions than expected:" << std::endl;
131 olog <<
"(Expected only " << nexpected <<
")" << std::endl;
132 olog << s->solution() << std::endl;
152 xs.update(*
this,share,s.
xs);
161 for (
int i = 0 ;
i <
a.size() ; ++
i)
169 #ifdef GECODE_HAS_SET_VARS
180 xs.update(*
this,share,s.
xs);
189 for (
int i = 0 ;
i <
a.size() ; ++
i) {
209 LDSB(std::string label,
unsigned int c=0,
unsigned int a=0)
210 : Test::
Base(
"LDSB::" + label),
220 bool r =
check(e, T::expectedSolutions());
226 #ifdef GECODE_HAS_SET_VARS
236 LDSBSet(std::string label,
unsigned int c=0,
unsigned int a=0)
237 : Test::
Base(
"LDSB::" + label),
247 bool r =
check(e, T::expectedSolutions());
260 static const int n = 4;
262 static const int l = 0;
264 static const int u = 3;
275 static std::vector<IntArgs> expected;
277 expected.push_back(
IntArgs(4, 0,1,2,3));
286 static const int n = 4;
288 static const int l = 0;
290 static const int u = 3;
300 static std::vector<IntArgs> expected;
302 expected.push_back(
IntArgs(4, 0,1,2,3));
311 static const int n = 4;
313 static const int l = 0;
315 static const int u = 3;
325 static std::vector<IntArgs> expected;
327 expected.push_back(
IntArgs(4, 0,0,0,0));
328 expected.push_back(
IntArgs(4, 0,0,0,1));
329 expected.push_back(
IntArgs(4, 0,0,0,2));
330 expected.push_back(
IntArgs(4, 0,0,0,3));
331 expected.push_back(
IntArgs(4, 0,0,1,1));
332 expected.push_back(
IntArgs(4, 0,0,1,2));
333 expected.push_back(
IntArgs(4, 0,0,1,3));
334 expected.push_back(
IntArgs(4, 0,0,2,2));
335 expected.push_back(
IntArgs(4, 0,0,2,3));
336 expected.push_back(
IntArgs(4, 0,0,3,3));
337 expected.push_back(
IntArgs(4, 0,1,1,1));
338 expected.push_back(
IntArgs(4, 0,1,1,2));
339 expected.push_back(
IntArgs(4, 0,1,1,3));
340 expected.push_back(
IntArgs(4, 0,1,2,2));
341 expected.push_back(
IntArgs(4, 0,1,2,3));
342 expected.push_back(
IntArgs(4, 0,1,3,3));
343 expected.push_back(
IntArgs(4, 0,2,2,2));
344 expected.push_back(
IntArgs(4, 0,2,2,3));
345 expected.push_back(
IntArgs(4, 0,2,3,3));
346 expected.push_back(
IntArgs(4, 0,3,3,3));
347 expected.push_back(
IntArgs(4, 1,1,1,1));
348 expected.push_back(
IntArgs(4, 1,1,1,2));
349 expected.push_back(
IntArgs(4, 1,1,1,3));
350 expected.push_back(
IntArgs(4, 1,1,2,2));
351 expected.push_back(
IntArgs(4, 1,1,2,3));
352 expected.push_back(
IntArgs(4, 1,1,3,3));
353 expected.push_back(
IntArgs(4, 1,2,2,2));
354 expected.push_back(
IntArgs(4, 1,2,2,3));
355 expected.push_back(
IntArgs(4, 1,2,3,3));
356 expected.push_back(
IntArgs(4, 1,3,3,3));
357 expected.push_back(
IntArgs(4, 2,2,2,2));
358 expected.push_back(
IntArgs(4, 2,2,2,3));
359 expected.push_back(
IntArgs(4, 2,2,3,3));
360 expected.push_back(
IntArgs(4, 2,3,3,3));
361 expected.push_back(
IntArgs(4, 3,3,3,3));
370 static const int n = 4;
372 static const int l = 0;
374 static const int u = 3;
384 static std::vector<IntArgs> expected;
386 expected.push_back(
IntArgs(4, 0,1,2,3));
387 expected.push_back(
IntArgs(4, 0,1,3,2));
388 expected.push_back(
IntArgs(4, 0,2,1,3));
389 expected.push_back(
IntArgs(4, 0,2,3,1));
390 expected.push_back(
IntArgs(4, 0,3,1,2));
391 expected.push_back(
IntArgs(4, 0,3,2,1));
392 expected.push_back(
IntArgs(4, 1,2,0,3));
393 expected.push_back(
IntArgs(4, 1,2,3,0));
394 expected.push_back(
IntArgs(4, 1,3,0,2));
395 expected.push_back(
IntArgs(4, 1,3,2,0));
396 expected.push_back(
IntArgs(4, 2,3,0,1));
397 expected.push_back(
IntArgs(4, 2,3,1,0));
406 static const int n = 3;
408 static const int l = 0;
410 static const int u = 2;
422 static std::vector<IntArgs> expected;
424 expected.push_back(
IntArgs(3, 0,1,2));
425 expected.push_back(
IntArgs(3, 0,2,1));
426 expected.push_back(
IntArgs(3, 1,0,2));
427 expected.push_back(
IntArgs(3, 1,2,0));
428 expected.push_back(
IntArgs(3, 2,0,1));
429 expected.push_back(
IntArgs(3, 2,1,0));
438 static const int n = 4;
440 static const int l = 0;
442 static const int u = 3;
454 static std::vector<IntArgs> expected;
456 expected.push_back(
IntArgs(4, 0,1,2,3));
457 expected.push_back(
IntArgs(4, 0,2,1,3));
458 expected.push_back(
IntArgs(4, 0,3,1,2));
459 expected.push_back(
IntArgs(4, 1,2,0,3));
460 expected.push_back(
IntArgs(4, 1,3,0,2));
461 expected.push_back(
IntArgs(4, 2,3,0,1));
470 static const int n = 6;
472 static const int l = 0;
474 static const int u = 1;
484 static std::vector<IntArgs> expected;
486 expected.push_back(
IntArgs(6, 0,0, 0,0, 0,0));
487 expected.push_back(
IntArgs(6, 0,0, 0,0, 0,1));
488 expected.push_back(
IntArgs(6, 0,0, 0,0, 1,0));
489 expected.push_back(
IntArgs(6, 0,0, 0,0, 1,1));
490 expected.push_back(
IntArgs(6, 0,0, 0,1, 0,0));
491 expected.push_back(
IntArgs(6, 0,0, 0,1, 0,1));
492 expected.push_back(
IntArgs(6, 0,0, 0,1, 1,0));
493 expected.push_back(
IntArgs(6, 0,0, 0,1, 1,1));
494 expected.push_back(
IntArgs(6, 0,0, 1,0, 1,0));
495 expected.push_back(
IntArgs(6, 0,0, 1,0, 1,1));
496 expected.push_back(
IntArgs(6, 0,0, 1,1, 1,1));
497 expected.push_back(
IntArgs(6, 0,1, 0,0, 0,0));
498 expected.push_back(
IntArgs(6, 0,1, 0,0, 0,1));
499 expected.push_back(
IntArgs(6, 0,1, 0,0, 1,0));
500 expected.push_back(
IntArgs(6, 0,1, 0,0, 1,1));
501 expected.push_back(
IntArgs(6, 0,1, 0,1, 0,0));
502 expected.push_back(
IntArgs(6, 0,1, 0,1, 0,1));
503 expected.push_back(
IntArgs(6, 0,1, 0,1, 1,0));
504 expected.push_back(
IntArgs(6, 0,1, 0,1, 1,1));
505 expected.push_back(
IntArgs(6, 0,1, 1,0, 1,0));
506 expected.push_back(
IntArgs(6, 0,1, 1,0, 1,1));
507 expected.push_back(
IntArgs(6, 0,1, 1,1, 1,1));
508 expected.push_back(
IntArgs(6, 1,0, 1,0, 1,0));
509 expected.push_back(
IntArgs(6, 1,0, 1,0, 1,1));
510 expected.push_back(
IntArgs(6, 1,0, 1,1, 1,1));
511 expected.push_back(
IntArgs(6, 1,1, 1,1, 1,1));
520 static const int n = 6;
522 static const int l = 0;
524 static const int u = 1;
534 static std::vector<IntArgs> expected;
536 expected.push_back(
IntArgs(6, 0,0, 0,0, 0,0));
537 expected.push_back(
IntArgs(6, 0,0, 0,0, 0,1));
538 expected.push_back(
IntArgs(6, 0,0, 0,0, 1,1));
539 expected.push_back(
IntArgs(6, 0,0, 0,1, 0,0));
540 expected.push_back(
IntArgs(6, 0,0, 0,1, 0,1));
541 expected.push_back(
IntArgs(6, 0,0, 0,1, 1,0));
542 expected.push_back(
IntArgs(6, 0,0, 0,1, 1,1));
543 expected.push_back(
IntArgs(6, 0,0, 1,1, 0,0));
544 expected.push_back(
IntArgs(6, 0,0, 1,1, 0,1));
545 expected.push_back(
IntArgs(6, 0,0, 1,1, 1,1));
546 expected.push_back(
IntArgs(6, 0,1, 0,0, 0,0));
547 expected.push_back(
IntArgs(6, 0,1, 0,0, 0,1));
548 expected.push_back(
IntArgs(6, 0,1, 0,0, 1,0));
549 expected.push_back(
IntArgs(6, 0,1, 0,0, 1,1));
550 expected.push_back(
IntArgs(6, 0,1, 0,1, 0,0));
551 expected.push_back(
IntArgs(6, 0,1, 0,1, 0,1));
552 expected.push_back(
IntArgs(6, 0,1, 0,1, 1,0));
553 expected.push_back(
IntArgs(6, 0,1, 0,1, 1,1));
554 expected.push_back(
IntArgs(6, 0,1, 1,0, 0,0));
555 expected.push_back(
IntArgs(6, 0,1, 1,0, 0,1));
556 expected.push_back(
IntArgs(6, 0,1, 1,0, 1,0));
557 expected.push_back(
IntArgs(6, 0,1, 1,0, 1,1));
558 expected.push_back(
IntArgs(6, 0,1, 1,1, 0,0));
559 expected.push_back(
IntArgs(6, 0,1, 1,1, 0,1));
560 expected.push_back(
IntArgs(6, 0,1, 1,1, 1,0));
561 expected.push_back(
IntArgs(6, 0,1, 1,1, 1,1));
562 expected.push_back(
IntArgs(6, 1,1, 0,0, 0,0));
563 expected.push_back(
IntArgs(6, 1,1, 0,0, 0,1));
564 expected.push_back(
IntArgs(6, 1,1, 0,0, 1,1));
565 expected.push_back(
IntArgs(6, 1,1, 0,1, 0,0));
566 expected.push_back(
IntArgs(6, 1,1, 0,1, 0,1));
567 expected.push_back(
IntArgs(6, 1,1, 0,1, 1,0));
568 expected.push_back(
IntArgs(6, 1,1, 0,1, 1,1));
569 expected.push_back(
IntArgs(6, 1,1, 1,1, 0,0));
570 expected.push_back(
IntArgs(6, 1,1, 1,1, 0,1));
571 expected.push_back(
IntArgs(6, 1,1, 1,1, 1,1));
580 static const int n = 6;
582 static const int l = 0;
584 static const int u = 1;
595 static std::vector<IntArgs> expected;
597 expected.push_back(
IntArgs(6, 0,0, 0,0, 0,0));
598 expected.push_back(
IntArgs(6, 0,0, 0,0, 0,1));
599 expected.push_back(
IntArgs(6, 0,0, 0,0, 1,1));
600 expected.push_back(
IntArgs(6, 0,0, 0,1, 0,0));
601 expected.push_back(
IntArgs(6, 0,0, 0,1, 0,1));
602 expected.push_back(
IntArgs(6, 0,0, 0,1, 1,0));
603 expected.push_back(
IntArgs(6, 0,0, 0,1, 1,1));
604 expected.push_back(
IntArgs(6, 0,0, 1,1, 1,1));
605 expected.push_back(
IntArgs(6, 0,1, 0,0, 0,0));
606 expected.push_back(
IntArgs(6, 0,1, 0,0, 0,1));
607 expected.push_back(
IntArgs(6, 0,1, 0,0, 1,0));
608 expected.push_back(
IntArgs(6, 0,1, 0,0, 1,1));
609 expected.push_back(
IntArgs(6, 0,1, 0,1, 0,0));
610 expected.push_back(
IntArgs(6, 0,1, 0,1, 0,1));
611 expected.push_back(
IntArgs(6, 0,1, 0,1, 1,0));
612 expected.push_back(
IntArgs(6, 0,1, 0,1, 1,1));
613 expected.push_back(
IntArgs(6, 0,1, 1,0, 1,0));
614 expected.push_back(
IntArgs(6, 0,1, 1,0, 1,1));
615 expected.push_back(
IntArgs(6, 0,1, 1,1, 1,1));
616 expected.push_back(
IntArgs(6, 1,1, 1,1, 1,1));
625 static const int n = 4;
627 static const int l = 0;
629 static const int u = 1;
639 static std::vector<IntArgs> expected;
641 expected.push_back(
IntArgs(4, 0, 0, 0, 0));
642 expected.push_back(
IntArgs(4, 0, 0, 0, 1));
643 expected.push_back(
IntArgs(4, 0, 0, 1, 0));
644 expected.push_back(
IntArgs(4, 0, 0, 1, 1));
645 expected.push_back(
IntArgs(4, 0, 1, 0, 0));
646 expected.push_back(
IntArgs(4, 0, 1, 0, 1));
647 expected.push_back(
IntArgs(4, 0, 1, 1, 0));
648 expected.push_back(
IntArgs(4, 0, 1, 1, 1));
649 expected.push_back(
IntArgs(4, 1, 0, 0, 1));
650 expected.push_back(
IntArgs(4, 1, 0, 1, 1));
651 expected.push_back(
IntArgs(4, 1, 1, 1, 1));
660 static const int n = 12;
662 static const int l = 0;
664 static const int u = 3;
671 for (
int i = 0 ;
i < 4 ; ++
i)
681 static std::vector<IntArgs> expected;
683 expected.push_back(
IntArgs(12, 0,0,3, 1,0,2, 2,0,1, 3,0,0));
684 expected.push_back(
IntArgs(12, 0,0,3, 1,0,2, 2,1,0, 3,0,0));
685 expected.push_back(
IntArgs(12, 0,0,3, 1,1,1, 2,0,1, 3,0,0));
686 expected.push_back(
IntArgs(12, 0,0,3, 1,1,1, 2,1,0, 3,0,0));
687 expected.push_back(
IntArgs(12, 0,0,3, 1,2,0, 2,0,1, 3,0,0));
688 expected.push_back(
IntArgs(12, 0,0,3, 1,2,0, 2,1,0, 3,0,0));
689 expected.push_back(
IntArgs(12, 0,1,2, 1,0,2, 2,0,1, 3,0,0));
690 expected.push_back(
IntArgs(12, 0,1,2, 1,0,2, 2,1,0, 3,0,0));
691 expected.push_back(
IntArgs(12, 0,1,2, 1,1,1, 2,0,1, 3,0,0));
692 expected.push_back(
IntArgs(12, 0,1,2, 1,1,1, 2,1,0, 3,0,0));
693 expected.push_back(
IntArgs(12, 0,1,2, 1,2,0, 2,0,1, 3,0,0));
694 expected.push_back(
IntArgs(12, 0,1,2, 1,2,0, 2,1,0, 3,0,0));
695 expected.push_back(
IntArgs(12, 0,2,1, 1,0,2, 2,0,1, 3,0,0));
696 expected.push_back(
IntArgs(12, 0,2,1, 1,0,2, 2,1,0, 3,0,0));
697 expected.push_back(
IntArgs(12, 0,2,1, 1,1,1, 2,0,1, 3,0,0));
698 expected.push_back(
IntArgs(12, 0,2,1, 1,1,1, 2,1,0, 3,0,0));
699 expected.push_back(
IntArgs(12, 0,2,1, 1,2,0, 2,0,1, 3,0,0));
700 expected.push_back(
IntArgs(12, 0,2,1, 1,2,0, 2,1,0, 3,0,0));
701 expected.push_back(
IntArgs(12, 0,3,0, 1,0,2, 2,0,1, 3,0,0));
702 expected.push_back(
IntArgs(12, 0,3,0, 1,0,2, 2,1,0, 3,0,0));
703 expected.push_back(
IntArgs(12, 0,3,0, 1,1,1, 2,0,1, 3,0,0));
704 expected.push_back(
IntArgs(12, 0,3,0, 1,1,1, 2,1,0, 3,0,0));
705 expected.push_back(
IntArgs(12, 0,3,0, 1,2,0, 2,0,1, 3,0,0));
706 expected.push_back(
IntArgs(12, 0,3,0, 1,2,0, 2,1,0, 3,0,0));
714 static const int nrows = 4;
716 static const int ncols = 3;
719 static const int n = nrows*ncols;
721 static const int l = 0;
723 static const int u = 3;
730 for (
int i = 0 ;
i < nrows ; ++
i)
740 for (
int i = 0 ;
i < nrows ;
i++) {
742 symvars << m(1,
i) << m(2,
i);
749 static std::vector<IntArgs> expected;
751 expected.push_back(
IntArgs(12, 0,0,3, 1,0,2, 2,0,1, 3,0,0));
752 expected.push_back(
IntArgs(12, 0,0,3, 1,1,1, 2,0,1, 3,0,0));
753 expected.push_back(
IntArgs(12, 0,1,2, 1,0,2, 2,0,1, 3,0,0));
754 expected.push_back(
IntArgs(12, 0,1,2, 1,1,1, 2,0,1, 3,0,0));
763 static const int n = 2;
765 static const int l = 0;
767 static const int u = 6;
770 rel(h, xs[0] + xs[1] == 6);
779 static std::vector<IntArgs> expected;
781 expected.push_back(
IntArgs(2, 0,6));
782 expected.push_back(
IntArgs(2, 1,5));
783 expected.push_back(
IntArgs(2, 2,4));
784 expected.push_back(
IntArgs(2, 3,3));
793 static const int n = 3;
795 static const int l = 0;
797 static const int u = 8;
821 static std::vector<IntArgs> expected;
823 expected.push_back(
IntArgs(3, 0,1,5));
824 expected.push_back(
IntArgs(3, 1,1,1));
833 static const int n = 4;
835 static const int l = 0;
837 static const int u = 3;
848 static std::vector<IntArgs> expected;
850 expected.push_back(
IntArgs(4, 0,1,2,3));
859 static const int n = 4;
861 static const int l = 0;
863 static const int u = 3;
873 static std::vector<IntArgs> expected;
875 expected.push_back(
IntArgs(4, 0,1,2,3));
884 static const int n = 4;
886 static const int l = 0;
888 static const int u = 3;
898 static std::vector<IntArgs> expected;
900 expected.push_back(
IntArgs(4, 3,2,1,0));
909 static const int n = 4;
911 static const int l = 0;
913 static const int u = 3;
923 static std::vector<IntArgs> expected;
925 expected.push_back(
IntArgs(4, 0,0,0,0));
926 expected.push_back(
IntArgs(4, 0,0,0,1));
927 expected.push_back(
IntArgs(4, 0,0,1,0));
928 expected.push_back(
IntArgs(4, 0,0,1,1));
929 expected.push_back(
IntArgs(4, 0,0,1,2));
930 expected.push_back(
IntArgs(4, 0,1,0,0));
931 expected.push_back(
IntArgs(4, 0,1,0,1));
932 expected.push_back(
IntArgs(4, 0,1,0,2));
933 expected.push_back(
IntArgs(4, 0,1,1,0));
934 expected.push_back(
IntArgs(4, 0,1,1,1));
935 expected.push_back(
IntArgs(4, 0,1,1,2));
936 expected.push_back(
IntArgs(4, 0,1,2,0));
937 expected.push_back(
IntArgs(4, 0,1,2,1));
938 expected.push_back(
IntArgs(4, 0,1,2,2));
939 expected.push_back(
IntArgs(4, 0,1,2,3));
948 static const int n = 4;
950 static const int l = 0;
952 static const int u = 3;
961 static std::vector<IntArgs> expected;
963 expected.push_back(
IntArgs(4, 0,0,0,0));
964 expected.push_back(
IntArgs(4, 0,0,0,1));
965 expected.push_back(
IntArgs(4, 0,0,1,0));
966 expected.push_back(
IntArgs(4, 0,0,1,1));
967 expected.push_back(
IntArgs(4, 0,0,1,2));
968 expected.push_back(
IntArgs(4, 0,1,0,0));
969 expected.push_back(
IntArgs(4, 0,1,0,1));
970 expected.push_back(
IntArgs(4, 0,1,0,2));
971 expected.push_back(
IntArgs(4, 0,1,1,0));
972 expected.push_back(
IntArgs(4, 0,1,1,1));
973 expected.push_back(
IntArgs(4, 0,1,1,2));
974 expected.push_back(
IntArgs(4, 0,1,2,0));
975 expected.push_back(
IntArgs(4, 0,1,2,1));
976 expected.push_back(
IntArgs(4, 0,1,2,2));
977 expected.push_back(
IntArgs(4, 0,1,2,3));
986 static const int n = 4;
988 static const int l = 0;
990 static const int u = 3;
1001 static std::vector<IntArgs> expected;
1003 expected.push_back(
IntArgs(4, 0,1,2,3));
1004 expected.push_back(
IntArgs(4, 0,1,3,2));
1005 expected.push_back(
IntArgs(4, 0,2,1,3));
1006 expected.push_back(
IntArgs(4, 0,2,3,1));
1007 expected.push_back(
IntArgs(4, 0,3,1,2));
1008 expected.push_back(
IntArgs(4, 0,3,2,1));
1009 expected.push_back(
IntArgs(4, 2,0,1,3));
1010 expected.push_back(
IntArgs(4, 2,0,3,1));
1011 expected.push_back(
IntArgs(4, 2,3,0,1));
1012 expected.push_back(
IntArgs(4, 3,0,1,2));
1013 expected.push_back(
IntArgs(4, 3,0,2,1));
1014 expected.push_back(
IntArgs(4, 3,2,0,1));
1023 static const int n = 3;
1025 static const int l = 0;
1027 static const int u = 2;
1038 static std::vector<IntArgs> expected;
1040 expected.push_back(
IntArgs(3, 0,1,2));
1041 expected.push_back(
IntArgs(3, 0,2,1));
1042 expected.push_back(
IntArgs(3, 1,0,2));
1043 expected.push_back(
IntArgs(3, 1,2,0));
1044 expected.push_back(
IntArgs(3, 2,0,1));
1045 expected.push_back(
IntArgs(3, 2,1,0));
1054 static const int n = 4;
1056 static const int l = 0;
1058 static const int u = 3;
1071 static std::vector<IntArgs> expected;
1073 expected.push_back(
IntArgs(4, 0,1,2,3));
1074 expected.push_back(
IntArgs(4, 0,2,1,3));
1075 expected.push_back(
IntArgs(4, 0,2,3,1));
1076 expected.push_back(
IntArgs(4, 2,0,1,3));
1077 expected.push_back(
IntArgs(4, 2,0,3,1));
1078 expected.push_back(
IntArgs(4, 2,3,0,1));
1087 static const int n = 4;
1089 static const int l = 0;
1091 static const int u = 3;
1101 static std::vector<IntArgs> expected;
1103 expected.push_back(
IntArgs(4, 0,0,0,0));
1104 expected.push_back(
IntArgs(4, 0,0,0,1));
1105 expected.push_back(
IntArgs(4, 0,0,1,1));
1106 expected.push_back(
IntArgs(4, 0,0,1,2));
1107 expected.push_back(
IntArgs(4, 0,1,1,1));
1108 expected.push_back(
IntArgs(4, 0,1,1,2));
1109 expected.push_back(
IntArgs(4, 0,1,2,2));
1110 expected.push_back(
IntArgs(4, 0,1,2,3));
1125 for (
int i = 0 ;
i <
n ;
i++) {
1137 { xs.update(*
this, share, s.
xs); }
1139 {
return new Latin(share,*
this); }
1142 for (
int i = 0 ;
i <
a.size() ; ++
i)
1149 static std::vector<IntArgs> expected;
1151 expected.push_back(
IntArgs(16, 1,2,3,4, 2,1,4,3, 3,4,1,2, 4,3,2,1));
1152 expected.push_back(
IntArgs(16, 1,2,3,4, 2,1,4,3, 3,4,2,1, 4,3,1,2));
1153 expected.push_back(
IntArgs(16, 1,2,3,4, 2,3,4,1, 3,4,1,2, 4,1,2,3));
1154 expected.push_back(
IntArgs(16, 1,2,3,4, 2,4,1,3, 3,1,4,2, 4,3,2,1));
1164 bool r =
check(e, Latin::expectedSolutions());
1203 static const int n = 4;
1205 static const int l = 0;
1207 static const int u = 1;
1215 va << xs[0] << xs[2];
1223 static std::vector<IntArgs> expected;
1225 expected.push_back(
IntArgs(4, 0,0,0,0));
1226 expected.push_back(
IntArgs(4, 0,0,0,1));
1239 expected.push_back(
IntArgs(4, 0,1,0,1));
1241 expected.push_back(
IntArgs(4, 1,0,1,0));
1242 expected.push_back(
IntArgs(4, 1,0,1,1));
1243 expected.push_back(
IntArgs(4, 1,1,1,1));
1258 static const int n = 4;
1260 static const int l = 0;
1262 static const int u = 3;
1271 rel(h, xs[1] != xs[2]);
1282 static std::vector<IntArgs> expected;
1284 expected.push_back(
IntArgs(4, 3,2,0,1));
1289 #ifdef GECODE_HAS_SET_VARS
1298 int x = va_arg(args,
int);
1315 static const int n = 2;
1317 static const int l = 0;
1319 static const int u = 1;
1328 static std::vector<IntSetArgs> expected;
1330 expected.push_back(
ISA(2, 0,1,-1, 0,1,-1));
1331 expected.push_back(
ISA(2, 0,1,-1, 0, -1));
1332 expected.push_back(
ISA(2, 0,1,-1, 1,-1));
1333 expected.push_back(
ISA(2, 0,1,-1, -1));
1334 expected.push_back(
ISA(2, 0, -1, 0,1,-1));
1335 expected.push_back(
ISA(2, 0, -1, 0, -1));
1336 expected.push_back(
ISA(2, 0, -1, 1,-1));
1337 expected.push_back(
ISA(2, 0, -1, -1));
1340 expected.push_back(
ISA(2, 1,-1, 1,-1));
1341 expected.push_back(
ISA(2, 1,-1, -1));
1345 expected.push_back(
ISA(2, -1, -1));
1365 static const int n = 2;
1367 static const int l = 0;
1369 static const int u = 1;
1378 static std::vector<IntSetArgs> expected;
1380 expected.push_back(
ISA(2, 0,1,-1, 0,1,-1));
1381 expected.push_back(
ISA(2, 0,1,-1, 0, -1));
1383 expected.push_back(
ISA(2, 0,1,-1, -1));
1384 expected.push_back(
ISA(2, 0, -1, 0,1,-1));
1385 expected.push_back(
ISA(2, 0, -1, 0, -1));
1386 expected.push_back(
ISA(2, 0, -1, 1,-1));
1387 expected.push_back(
ISA(2, 0, -1, -1));
1392 expected.push_back(
ISA(2, -1, 0,1,-1));
1393 expected.push_back(
ISA(2, -1, 0, -1));
1395 expected.push_back(
ISA(2, -1, -1));
1404 static const int n = 3;
1406 static const int l = 1;
1408 static const int u = 4;
1413 for (
int i = 0 ;
i < 3 ;
i++)
1419 static std::vector<IntSetArgs> expected;
1421 expected.push_back(
ISA(3, 1,-1, 1,-1, 1,-1));
1422 expected.push_back(
ISA(3, 1,-1, 1,-1, 2,-1));
1423 expected.push_back(
ISA(3, 1,-1, 2,-1, 1,-1));
1424 expected.push_back(
ISA(3, 1,-1, 2,-1, 2,-1));
1425 expected.push_back(
ISA(3, 1,-1, 2,-1, 3,-1));
1434 static const int n = 4;
1436 static const int l = 0;
1438 static const int u = 1;
1445 for (
int i = 0 ;
i < 4 ;
i++)
1451 static std::vector<IntSetArgs> expected;
1453 expected.push_back(
ISA(4, 0,-1, 1,-1, 0,-1, 1,-1));
1454 expected.push_back(
ISA(4, 0,-1, 1,-1, 1,-1, 0,-1));
1456 expected.push_back(
ISA(4, 1,-1, 0,-1, 1,-1, 0,-1));
1465 static const int n = 4;
1467 static const int l = 0;
1469 static const int u = 0;
1479 static std::vector<IntSetArgs> expected;
1483 expected.push_back(
ISA(4, 0, -1,0,-1,0,-1,0,-1));
1484 expected.push_back(
ISA(4, 0, -1,0,-1,0,-1, -1));
1488 expected.push_back(
ISA(4, 0, -1, -1,0,-1, -1));
1493 expected.push_back(
ISA(4, -1,0,-1, -1,0,-1));
1494 expected.push_back(
ISA(4, -1,0,-1, -1, -1));
1498 expected.push_back(
ISA(4, -1, -1, -1, -1));
1507 LDSB<VarSym1>
varsym1(
"VarSym1");
1508 LDSB<VarSym1b>
varsym1b(
"VarSym1b");
1509 LDSB<VarSym2>
varsym2(
"VarSym2");
1510 LDSB<VarSym3>
varsym3(
"VarSym3");
1511 LDSB<VarSym4>
varsym4(
"VarSym4");
1512 LDSB<VarSym5>
varsym5(
"VarSym5");
1513 LDSB<MatSym1>
matsym1(
"MatSym1");
1514 LDSB<MatSym2>
matsym2(
"MatSym2");
1515 LDSB<MatSym3>
matsym3(
"MatSym3");
1516 LDSB<MatSym4>
matsym4(
"MatSym4");
1521 LDSB<ValSym1>
valsym1(
"ValSym1");
1522 LDSB<ValSym1b>
valsym1b(
"ValSym1b");
1523 LDSB<ValSym1c>
valsym1c(
"ValSym1c");
1524 LDSB<ValSym2>
valsym2(
"ValSym2");
1525 LDSB<ValSym2b>
valsym2b(
"ValSym2b");
1526 LDSB<ValSym3>
valsym3(
"ValSym3");
1527 LDSB<ValSym4>
valsym4(
"ValSym4");
1528 LDSB<ValSym5>
valsym5(
"ValSym5");
1530 LDSBLatin
latin(
"Latin");
1531 LDSB<Recomputation>
recomp(
"Recomputation", 999,999);
1532 LDSB<TieBreak>
tiebreak(
"TieBreak");
1534 #ifdef GECODE_HAS_SET_VARS
1535 LDSBSet<SetVarSym1>
setvarsym1(
"SetVarSym1");
1536 LDSBSet<SetValSym1>
setvalsym1(
"SetValSym1");
1537 LDSBSet<SetValSym2>
setvalsym2(
"SetValSym2", 0, 1);