generate a matrix inside 'in' and do the tranposition inside 'out'
| 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) |
| 198 | { |
| 199 | // generate a matrix |
| 200 | for(uint_ i = 0 ; i < rows ; ++i){ |
| 201 | for(uint_ j = 0 ; j < cols ; ++j){ |
| 202 | in[i*cols + j] = i*cols + j; |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | // store transposed result |
| 207 | for(uint_ j = 0; j < cols ; ++j){ |
| 208 | for(uint_ i = 0 ; i < rows ; ++i){ |
| 209 | out[j*rows + i] = in[i*cols + j]; |
| 210 | } |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | // neccessary for 64-bit integer on win32 |
| 215 | #ifdef _WIN32 |