Plaquette
 
Loading...
Searching...
No Matches
pq_random.h
1/*
2 * pq_random.h
3 *
4 * Provides methods for generating uniform random numbers.
5 *
6 * (c) 2008 Sofian Audry -- info(@)sofianaudry(.)com
7 *
8 * This class was adapted from the files Random.{h,cc} in the Torch
9 * library (http://torch.ch)
10 * Copyright (C) 2003--2004 Ronan Collobert (collober@idiap.ch)
11 *
12 * This program is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation, either version 3 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 */
25#ifndef RANDOM_H_
26#define RANDOM_H_
27
28namespace pq {
29
30// Floating point random numbers.
31
33float randomFloat();
34
36float randomFloat(float max);
37
39float randomFloat(float min, float max);
40
52bool randomTrigger(float timeWindow, float samplePeriod);
53
55[[deprecated("Use randomFloat() instead.")]]
56float randomUniform();
58[[deprecated("Use randomFloat(float) instead.")]]
59float randomUniform(float max);
61[[deprecated("Use randomFloat(float, float) instead.")]]
62float randomUniform(float min, float max);
63
64} // namespace pq
65
66#endif