PostgreSQL Source Code  git master
geqo_random.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * geqo_random.h
4  * random number generator
5  *
6  * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * src/include/optimizer/geqo_random.h
10  *
11  *-------------------------------------------------------------------------
12  */
13 
14 /* contributed by:
15  =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
16  * Martin Utesch * Institute of Automatic Control *
17  = = University of Mining and Technology =
18  * utesch@aut.tu-freiberg.de * Freiberg, Germany *
19  =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
20  */
21 
22 /* -- parts of this are adapted from D. Whitley's Genitor algorithm -- */
23 
24 #ifndef GEQO_RANDOM_H
25 #define GEQO_RANDOM_H
26 
27 #include <math.h>
28 
29 #include "optimizer/geqo.h"
30 
31 
32 extern void geqo_set_seed(PlannerInfo *root, double seed);
33 
34 /* geqo_rand returns a random float value in the range [0.0, 1.0) */
35 extern double geqo_rand(PlannerInfo *root);
36 
37 /* geqo_randint returns integer value between lower and upper inclusive */
38 extern int geqo_randint(PlannerInfo *root, int upper, int lower);
39 
40 #endif /* GEQO_RANDOM_H */
void geqo_set_seed(PlannerInfo *root, double seed)
Definition: geqo_random.c:20
int geqo_randint(PlannerInfo *root, int upper, int lower)
Definition: geqo_random.c:36
double geqo_rand(PlannerInfo *root)
Definition: geqo_random.c:28
Datum lower(PG_FUNCTION_ARGS)
Definition: oracle_compat.c:49
Datum upper(PG_FUNCTION_ARGS)
Definition: oracle_compat.c:80