openModeller
Version 1.5.0
|
#include <Random.hh>
Public Member Functions | |
Random () | |
double | get (double min, double max) |
double | get (double max) |
double | get () |
double | operator() (double min, double max) |
double | operator() (double max) |
double | operator() () |
int | get (int min, int max) |
int | get (int max) |
int | operator() (int min, int max) |
int | operator() (int max) |
long | get (long min, long max) |
long | get (long max) |
long | operator() (long min, long max) |
long | operator() (long max) |
double | discrete (float range, float dim_interv) |
Private Member Functions | |
double | random () |
Static Private Attributes | |
static int | _initialized = 0 |
Declaration of Random class.
LICENSE INFORMATION
Copyright(c) 2003 by CRIA - Centro de Referencia em Informacao Ambiental
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details:
http://www.gnu.org/copyleft/gpl.html Class to generate random numbers
Random::Random | ( | ) |
Definition at line 44 of file Random.cpp.
References _initialized, and initRandom().
double Random::discrete | ( | float | range, |
float | dim_interv | ||
) |
Generate a random number, r, between [-range, range], so that r = -range + k * dim_interv, where k = 0,..,N.
Definition at line 144 of file Random.cpp.
References random().
double Random::get | ( | double | min, |
double | max | ||
) |
Return real numbers between [min, max).
Definition at line 54 of file Random.cpp.
References random().
Referenced by Garp::colonize(), Garp::crossover(), BioclimHistogram::getBioclimRange(), RfAlgorithm::initialize(), LogitRule::initialize(), RangeRule::initialize(), RfAlgorithm::iterate(), GarpRule::mutate(), and Garp::select().
double Random::get | ( | double | max | ) |
Return real numbers between [0, max).
Definition at line 60 of file Random.cpp.
References random().
|
inline |
int Random::get | ( | int | min, |
int | max | ||
) |
Return integer numbers between [min, max).
Definition at line 84 of file Random.cpp.
References random().
int Random::get | ( | int | max | ) |
Return integer numbers between [0, max).
Definition at line 90 of file Random.cpp.
References random().
long Random::get | ( | long | min, |
long | max | ||
) |
Return numbers "long int's" between [min, max).
Definition at line 114 of file Random.cpp.
References random().
long Random::get | ( | long | max | ) |
Return numbers "long int's" between [0, max).
Definition at line 120 of file Random.cpp.
References random().
double Random::operator() | ( | double | min, |
double | max | ||
) |
Definition at line 69 of file Random.cpp.
References random().
double Random::operator() | ( | double | max | ) |
Definition at line 75 of file Random.cpp.
References random().
int Random::operator() | ( | int | min, |
int | max | ||
) |
Definition at line 99 of file Random.cpp.
References random().
int Random::operator() | ( | int | max | ) |
Definition at line 105 of file Random.cpp.
References random().
long Random::operator() | ( | long | min, |
long | max | ||
) |
Definition at line 129 of file Random.cpp.
References random().
long Random::operator() | ( | long | max | ) |
Definition at line 135 of file Random.cpp.
References random().
|
private |
Return real numbers in the interval [0, 1).
Definition at line 155 of file Random.cpp.
Referenced by discrete(), get(), and operator()().
|
staticprivate |