File UniqueRandomNumbersGenerator.h

Copyright

This code is licensed under the 3-clause BSD license.

Copyright ETH Zurich, Laboratory for Physical Chemistry, Reiher Group.

See LICENSE.txt for details.

namespace Scine

This header file contains functions that allow for common notation for common things that can be done at a different degree of derivatives.

This header contains alias definitions defining which classes to use for the different degrees of derivatives.

namespace Utils
template<class IntegerType>
class UniqueRandomNumbersGenerator
#include <UniqueRandomNumbersGenerator.h>

Class to sample without replacement N numbers from a range bounded by min_ and max_.

The user gives a minimum number and a maximum number as the boundaries of a range of possible numbers. Upon calling the UniqueRandomNumbersGenerator::generate(unsigned N) function, N values are sampled without replacement from the possible values.

Public Functions

void setMin(IntegerType min)
void setMax(IntegerType max)
void setRange(IntegerType min, IntegerType max)
std::vector<IntegerType> generate(unsigned N)
template<class Generator>
std::vector<IntegerType> generate(Generator &generator, unsigned N)

Public Members

IntegerType min_ = 0
IntegerType max_ = 0