25 for (
size_t i = 0; i < p_size; i++)
a[i] = i;
27 std::random_shuffle(
a.begin(),
a.end());
29 for (
size_t i = 0; i < p_pick; i++) p_ind[i] =
a[i];
41 std::random_shuffle(inds.begin(), inds.end());
43 for (
size_t i = 0; i < p_pick; i++) p_ind[i] = inds[i];
This base provides a set of functions for maths stuff.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void pickRandomIndex(size_t p_size, size_t p_pick, vector_size_t &p_ind)
Select random (unique) indices from the 0..p_size sequence.
std::vector< size_t > vector_size_t
GLubyte GLubyte GLubyte a