#include "./binary_matrix.h" #include "./rngtest.h" namespace splat { binary_matrix_test::binary_matrix_test(std::vector> &testData) : RNGTEST(testData){ testPValue = runTest(data); testPassed = testPValue > 0.01; } std::string binary_matrix_test::getName() { return "Binary Matrix Rank Test"; } // We will use matrices of size 32x32 as recommended double binary_matrix_test::runTest(std::vector> &data) { double num_matrices = (data.size()*32) / (32*32); // [0] -> Full Rank // [1] -> Full rank -1 // [2] -> < full rank -1 double counts[3] = {0,0,0}; for(int matrixIndex = 0; matrixIndex < num_matrices; matrixIndex++){ splat::matrix<32> matrix; for(int i=0; i<32; i++){ matrix[i] = data[(matrixIndex*32) + i]; } int rank = splat::getRank(matrix); if(rank==32){ counts[0]++; }else if(rank==31){ counts[1]++; }else{ counts[2]++; } } double x2obs = 0; // std::cout << "debug: "<< counts[0] << ","<