compare 'expectedResult' to 'transposedMatrix'. prints an error message if not equal.
| 179 | |
| 180 | // compare 'expectedResult' to 'transposedMatrix'. prints an error message if not equal. |
| 181 | bool check_transposition(const std::vector<float>& expectedResult, |
| 182 | uint_ size, |
| 183 | const std::vector<float>& transposedMatrix) |
| 184 | { |
| 185 | for(uint_ i = 0 ; i < size ; ++i){ |
| 186 | if(expectedResult[i] != transposedMatrix[i]){ |
| 187 | std::cout << "idx = " << i << " , expected " << expectedResult[i] |
| 188 | << " , got " << transposedMatrix[i] << std::endl; |
| 189 | std::cout << "FAILED" << std::endl; |
| 190 | return false; |
| 191 | } |
| 192 | } |
| 193 | return true; |
| 194 | } |
| 195 | |
| 196 | // generate a matrix inside 'in' and do the tranposition inside 'out' |
| 197 | void generate_matrix(std::vector<float>& in, std::vector<float>& out, uint_ rows, uint_ cols) |