Go to the previous, next section.
#include <CNCL/RndInt.h>
CN_RNDINT
CNObject
None
CNRNG
CNRndInt generates uniform distributed random integers in a given
interval. The result is the same as provided by the CNDiscUniform
distribution, but CNRndInt is more efficient.
BEWARE: do NOT use the CNLCG RNG as a base generator for
CNRndInt.
Constructors:
CNRndInt();
CNRndInt(CNParam *param);
CNRndInt(long low, long high, CNRNG *gen);
CNRndInt(long high, CNRNG *gen);
CNRndInt(CNRNG *gen);
CNRndInt with base RNG gen and upper/lower
interval limits low/high.
In addition to the member functions required by CNCL, CNRndInt
provides:
CNRNG *generator() const;
CNRNG *generator(CNRNG *gen);
CNRndInt.
long low() const;
long high() const;
long low(long x);
long high(long x);
long operator()();
long operator()(long high);
long operator()(long low, long high);
long as_long();
long as_long(long high);
long as_long(long low, long high);
long random integer. Interval limits may be passed as
optional parameters.
int as_int();
int as_int(long high);
int as_int(long low, long high);
int random integer. Interval limits may be passed as
optional parameters.
Go to the previous, next section.