#include <m4ri/config.h>
#include <stdlib.h>
#include <m4ri/m4ri.h>
for (
rci_t i = 0; i < r[0]; ++i){
for (
rci_t j = 0; j < i; ++j)
for (
rci_t j = i + 1; j < n; ++j)
}
for (
rci_t i = r[0]; i < m; ++i)
for (
rci_t j = 0; j < r[0]; ++j)
for (
rci_t i = 0; i < r[0]; ++i){
}
int status = 0;
for (
rci_t i = 0; i < m; ++i)
for (
rci_t j = 0; j < n; ++j){
status = 1;
break;
}
}
return status;
}
printf("pluq: testing full rank m: %5d, n: %5d", m, n);
for (
rci_t i = 0; i < m; ++i){
for (
rci_t j = 0; j < i && j < n;++j)
for (
rci_t j = i + 1; j < m; ++j)
if(i<n)
}
for (
rci_t i = 0; i < m; ++i){
for (
rci_t j = 0; j < i && j < n; ++j)
for (
rci_t j = i + 1; j < n; ++j)
}
for (
rci_t i = 0; i < n && i < m; ++i){
}
int status = 0;
for (
rci_t i = 0; i < m; ++i)
for (
rci_t j=0; j < n; ++j){
status = 1;
}
}
if (status){
printf(" ... FAILED\n");
} else
printf (" ... passed\n");
return status;
}
printf("pluq: testing half rank m: %5d, n: %5d", m, n);
for (
rci_t i = 0; i < m && i < n; ++i) {
for (
rci_t j = 0; j < i;++j)
if (i%2)
for (
rci_t j = i; j < n;++j)
for (
rci_t j = i + 1; j < m; ++j)
}
for (
rci_t i = 0; i < r; ++i) {
for (
rci_t j = 0; j < i; ++j)
for (
rci_t j = i + 1; j < n; ++j)
}
for (
rci_t i = r; i < m; ++i)
for (
rci_t j = 0; j < r;++j)
for (
rci_t i = 0; i < r; ++i){
}
int status = 0;
for (
rci_t i = 0; i < m; ++i) {
for (
rci_t j = 0; j < n; ++j){
status = 1;
}
}
if(status)
break;
}
if (status)
printf(" ... FAILED\n");
else
printf (" ... passed\n");
return status;
}
printf("pluq: testing structured m: %5d, n: %5d", m, n);
for(
rci_t i = 0; i < m; i += 2)
for (
rci_t j = i; j < n; ++j)
int status = check_pluq(A, &r);
printf(", rank: %5d ",r);
if (status) {
printf(" ... FAILED\n");
} else
printf (" ... passed\n");
return status;
}
printf("pluq: testing random m: %5d, n: %5d", m, n);
int status = check_pluq(A, &r);
printf(", rank: %5d ",r);
if (status) {
printf(" ... FAILED\n");
} else
printf (" ... passed\n");
return status;
}
int test_pluq_string(
rci_t m,
rci_t n,
const char *str) {
printf("pluq: testing string m: %5d, n: %5d", m, n);
int status = check_pluq(A, &r);
printf(", rank: %5d ",r);
if (status) {
printf(" ... FAILED\n");
} else
printf (" ... passed\n");
return status;
}
int main() {
int status = 0;
srandom(17);
status += test_pluq_string(4, 4, "0101011100010110");
status += test_pluq_structured(37, 37);
status += test_pluq_structured(63, 63);
status += test_pluq_structured(64, 64);
status += test_pluq_structured(65, 65);
status += test_pluq_structured(128, 128);
status += test_pluq_structured(37, 137);
status += test_pluq_structured(65, 5);
status += test_pluq_structured(128, 18);
status += test_pluq_full_rank(13, 13);
status += test_pluq_full_rank(37, 37);
status += test_pluq_full_rank(63, 63);
status += test_pluq_full_rank(64, 64);
status += test_pluq_full_rank(65, 65);
status += test_pluq_full_rank(97, 97);
status += test_pluq_full_rank(128, 128);
status += test_pluq_full_rank(150, 150);
status += test_pluq_full_rank(256, 256);
status += test_pluq_full_rank(1024, 1024);
status += test_pluq_full_rank(13, 11);
status += test_pluq_full_rank(37, 39);
status += test_pluq_full_rank(64, 164);
status += test_pluq_full_rank(97, 92);
status += test_pluq_full_rank(128, 121);
status += test_pluq_full_rank(150, 153);
status += test_pluq_full_rank(256, 258);
status += test_pluq_full_rank(1024, 1023);
status += test_pluq_half_rank(64, 64);
status += test_pluq_half_rank(65, 65);
status += test_pluq_half_rank(66, 66);
status += test_pluq_half_rank(127, 127);
status += test_pluq_half_rank(129, 129);
status += test_pluq_half_rank(148, 148);
status += test_pluq_half_rank(132, 132);
status += test_pluq_half_rank(256, 256);
status += test_pluq_half_rank(1024, 1024);
status += test_pluq_half_rank(129, 127);
status += test_pluq_half_rank(132, 136);
status += test_pluq_half_rank(256, 251);
status += test_pluq_half_rank(1024, 2100);
status += test_pluq_random(63, 63);
status += test_pluq_random(64, 64);
status += test_pluq_random(65, 65);
status += test_pluq_random(128, 128);
status += test_pluq_random(128, 131);
status += test_pluq_random(132, 731);
status += test_pluq_random(150, 150);
status += test_pluq_random(252, 24);
status += test_pluq_random(256, 256);
status += test_pluq_random(1024, 1022);
status += test_pluq_random(1024, 1024);
status += test_pluq_random(128, 1280);
status += test_pluq_random(128, 130);
status += test_pluq_random(132, 132);
status += test_pluq_random(150, 151);
status += test_pluq_random(252, 2);
status += test_pluq_random(256, 251);
status += test_pluq_random(1024, 1025);
status += test_pluq_random(1024, 1021);
if (!status) {
printf("All tests passed.\n");
return 0;
} else {
return -1;
}
}