Class Permutation

Inheritance Relationships

Base Type

  • public std::vector< int >

Class Documentation

class Permutation : public std::vector<int>

A permutation of indices into an array.

This class tends to be faster than the two-argument version of std::random_shuffle when permute is called several times, since the random number generator doesn’t need to be allocated each time.

Public Functions

inline Permutation(std::size_t n)

Create a permutation of the numbers 0, … , n - 1.

inline void permute(unsigned int n)

Create a permutation of the numbers 0, …, n - 1.