| 16 | typedef std::vector<std::pair<unsigned long,double> > sparse_vect; |
| 17 | |
| 18 | void np_to_cpp ( |
| 19 | const numpy_image<double>& x_, |
| 20 | std::vector<matrix<double,0,1>>& samples |
| 21 | ) |
| 22 | { |
| 23 | auto x = make_image_view(x_); |
| 24 | DLIB_CASSERT(x.nc() > 0); |
| 25 | DLIB_CASSERT(x.nr() > 0); |
| 26 | samples.resize(x.nr()); |
| 27 | for (long r = 0; r < x.nr(); ++r) |
| 28 | { |
| 29 | samples[r].set_size(x.nc()); |
| 30 | for (long c = 0; c < x.nc(); ++c) |
| 31 | { |
| 32 | samples[r](c) = x[r][c]; |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | void np_to_cpp ( |
| 38 | const numpy_image<double>& x_, |
no test coverage detected