| 193 | } |
| 194 | |
| 195 | py::array_t<double> |
| 196 | copy_matrix(Matrix matrix) |
| 197 | { |
| 198 | int nr = matrix.noRows(); |
| 199 | int nc = matrix.noCols(); |
| 200 | py::array_t<double> array({nr,nc},{nr*nc*sizeof(double), nc*sizeof(double)}); |
| 201 | double *ptr = static_cast<double*>(array.request().ptr); |
| 202 | |
| 203 | for (int i=0; i<matrix.noRows(); i++) |
| 204 | for (int j=0; j<matrix.noCols(); j++) |
| 205 | ptr[i*nc+j] = matrix(i,j); |
| 206 | return array; |
| 207 | } |
| 208 | |
| 209 | |
| 210 | GroundMotion* |
no test coverage detected