[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
Would it make sense to implement something like floor and ceil for vectors/arrays in eigen3 ? One typical operation that
we sometimes need to do is:
min_b[0] = (int)(floor (min_p[0] * leaf_size[0]));
max_b[0] = (int)(floor (max_p[0] * leaf_size[0]));
min_b[1] = (int)(floor (min_p[1] * leaf_size[1]));
max_b[1] = (int)(floor (max_p[1] * leaf_size[1]));
min_b[2] = (int)(floor (min_p[2] * leaf_size[2]));
max_b[2] = (int)(floor (max_p[2] * leaf_size[2]));
I imagine this would be faster (and cleaner) using something like:
min_b = (min_p * leaf_size).floor ();
max_b = (max_p * leaf_size).floor ();
PS. See http://www.masm32.com/board/index.php?topic=9515.0 for a discussion on SSE floor/ceil.
Thanks,
Radu.
--
| Radu Bogdan Rusu | http://rbrusu.com/