* @brief Populate a square matrix with the identity matrix. * @param a The array to populate. * @param N The number of rows and columns in the square matrix. */
| 248 | * @param N The number of rows and columns in the square matrix. |
| 249 | */ |
| 250 | inline void eye(float *a, size_t N) { |
| 251 | for (size_t i = 0; i < N; i++) { |
| 252 | for (size_t j = 0; j < N; j++) { |
| 253 | a[i * N + j] = (i == j) ? 1.0 : 0.0; |
| 254 | } |
| 255 | } |
| 256 | } |
| 257 | |
| 258 | // Note transformation operations here are purely for testing - they are not |
| 259 | // optimized to be used in hot paths. |
nothing calls this directly
no outgoing calls
no test coverage detected