http://stackoverflow.com/a/9144870/2192361
| 30 | |
| 31 | // http://stackoverflow.com/a/9144870/2192361 |
| 32 | unsigned reverse(unsigned x) { |
| 33 | x = ((x >> 1) & 0x55555555u) | ((x & 0x55555555u) << 1); |
| 34 | x = ((x >> 2) & 0x33333333u) | ((x & 0x33333333u) << 2); |
| 35 | x = ((x >> 4) & 0x0f0f0f0fu) | ((x & 0x0f0f0f0fu) << 4); |
| 36 | x = ((x >> 8) & 0x00ff00ffu) | ((x & 0x00ff00ffu) << 8); |
| 37 | x = ((x >> 16) & 0xffffu) | ((x & 0xffffu) << 16); |
| 38 | return x; |
| 39 | } |
| 40 | |
| 41 | template<class ty> |
| 42 | void read_idx(std::vector<dim_t> &dims, std::vector<ty> &data, |
no outgoing calls
no test coverage detected