@@ -53,10 +53,7 @@ int test_pluq_solve_left(rci_t m, rci_t n, int offsetA, int offsetB) {
53
53
return status ;
54
54
}
55
55
56
- int test_solve_left_random (rci_t mA , rci_t nA , rci_t nB , int consistent , int inconsistency_check ) {
57
- // check consistency if system is not consistent; otherwise mzd_solve_left is undefined
58
- if (!consistent ) inconsistency_check = 1 ;
59
-
56
+ int test_solve_left_random (rci_t mA , rci_t nA , rci_t nB , int consistent ) {
60
57
int mB = MAX (mA , nA );
61
58
mzd_t * A = mzd_init (mA , nA );
62
59
mzd_t * secret = mzd_init (nA , nB );
@@ -81,7 +78,7 @@ int test_solve_left_random(rci_t mA, rci_t nA, rci_t nB, int consistent, int inc
81
78
// add rows to B, s.t. X fits into B
82
79
if (B -> nrows < mB ) {
83
80
mzd_t * padding = mzd_init (nA - mA , nB );
84
- if (!inconsistency_check )
81
+ if (!consistent )
85
82
mzd_randomize (padding );
86
83
mzd_t * B_padded = mzd_stack (NULL , B , padding );
87
84
mzd_free (B );
@@ -95,7 +92,7 @@ int test_solve_left_random(rci_t mA, rci_t nA, rci_t nB, int consistent, int inc
95
92
assert (B -> nrows == mB );
96
93
assert (B -> ncols == nB );
97
94
98
- int consistency = !mzd_solve_left (A , B , 0 , inconsistency_check );
95
+ int consistency = !mzd_solve_left (A , B , 0 , 1 );
99
96
100
97
if (consistent && !consistency ) {
101
98
printf ("failed (solution should have been found)\n" );
@@ -132,16 +129,19 @@ int main() {
132
129
133
130
srandom (17 );
134
131
135
- for (int consistent = 0 ; consistent <= 1 ; consistent ++ ) {
136
- for (int inconsistency_check = 0 ; inconsistency_check <= 1 ; inconsistency_check ++ ) {
137
- status += test_solve_left_random (1100 , 1000 , 1000 , consistent , inconsistency_check );
138
- status += test_solve_left_random (1000 , 1000 , 1000 , consistent , inconsistency_check );
139
- status += test_solve_left_random (1100 , 1100 , 1000 , consistent , inconsistency_check );
140
- status += test_solve_left_random (1000 , 1000 , 1100 , consistent , inconsistency_check );
141
- status += test_solve_left_random (1100 , 1000 , 1100 , consistent , inconsistency_check );
142
- status += test_solve_left_random (1000 , 1100 , 1000 , consistent , inconsistency_check );
143
- }
144
- }
132
+ status += test_solve_left_random (1100 , 1000 , 1000 , 1 );
133
+ status += test_solve_left_random (1000 , 1000 , 1000 , 1 );
134
+ status += test_solve_left_random (1100 , 1100 , 1000 , 1 );
135
+ status += test_solve_left_random (1000 , 1000 , 1100 , 1 );
136
+ status += test_solve_left_random (1100 , 1000 , 1100 , 1 );
137
+ status += test_solve_left_random (1000 , 1100 , 1000 , 1 );
138
+
139
+ status += test_solve_left_random (1100 , 1000 , 1000 , 0 );
140
+ status += test_solve_left_random (1000 , 1000 , 1000 , 0 );
141
+ status += test_solve_left_random (1100 , 1100 , 1000 , 0 );
142
+ status += test_solve_left_random (1000 , 1000 , 1100 , 0 );
143
+ status += test_solve_left_random (1100 , 1000 , 1100 , 0 );
144
+ status += test_solve_left_random (1000 , 1100 , 1000 , 0 );
145
145
146
146
147
147
for (size_t i = 0 ; i < 100 ; i ++ ) {
0 commit comments