30
30
31
31
namespace na {
32
32
auto validateAODConstraints (const NAComputation& comp) -> bool {
33
+ std::size_t counter = 1 ; // the first operation is `init at ...;`
33
34
for (const auto & naOp : comp) {
35
+ ++counter;
34
36
if (naOp->isShuttlingOperation ()) {
35
37
const auto & shuttlingOp =
36
38
dynamic_cast <const NAShuttlingOperation&>(*naOp);
@@ -44,27 +46,35 @@ auto validateAODConstraints(const NAComputation& comp) -> bool {
44
46
const auto & e1 = shuttlingOp.getEnd ()[i];
45
47
const auto & e2 = shuttlingOp.getEnd ()[j];
46
48
if (*s1 == *s2) {
49
+ std::cout << " Error in op number " << counter << " (two start points identical)\n " ;
47
50
return false ;
48
51
}
49
52
if (*e1 == *e2 ) {
53
+ std::cout << " Error in op number " << counter << " (two end points identical)\n " ;
50
54
return false ;
51
55
}
52
56
if (s1->x == s2->x && e1 ->x != e2 ->x ) {
57
+ std::cout << " Error in op number " << counter << " (columns not preserved)\n " ;
53
58
return false ;
54
59
}
55
60
if (s1->y == s2->y && e1 ->y != e2 ->y ) {
61
+ std::cout << " Error in op number " << counter << " (rows not preserved)\n " ;
56
62
return false ;
57
63
}
58
64
if (s1->x < s2->x && e1 ->x >= e2 ->x ) {
65
+ std::cout << " Error in op number " << counter << " (column order not preserved)\n " ;
59
66
return false ;
60
67
}
61
68
if (s1->y < s2->y && e1 ->y >= e2 ->y ) {
69
+ std::cout << " Error in op number " << counter << " (row order not preserved)\n " ;
62
70
return false ;
63
71
}
64
72
if (s1->x > s2->x && e1 ->x <= e2 ->x ) {
73
+ std::cout << " Error in op number " << counter << " (column order not preserved)\n " ;
65
74
return false ;
66
75
}
67
76
if (s1->y > s2->y && e1 ->y <= e2 ->y ) {
77
+ std::cout << " Error in op number " << counter << " (row order not preserved)\n " ;
68
78
return false ;
69
79
}
70
80
}
@@ -76,6 +86,7 @@ auto validateAODConstraints(const NAComputation& comp) -> bool {
76
86
const auto & a = localOp.getPositions ()[i];
77
87
const auto & b = localOp.getPositions ()[j];
78
88
if (*a == *b) {
89
+ std::cout << " Error in op number " << counter << " (identical positions)\n " ;
79
90
return false ;
80
91
}
81
92
}
0 commit comments