PostgreSQL Source Code git master
Loading...
Searching...
No Matches
geqo_selection.h File Reference
#include "optimizer/geqo.h"
Include dependency graph for geqo_selection.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void geqo_selection (PlannerInfo *root, Chromosome *momma, Chromosome *daddy, Pool *pool, double bias)
 

Function Documentation

◆ geqo_selection()

void geqo_selection ( PlannerInfo root,
Chromosome momma,
Chromosome daddy,
Pool pool,
double  bias 
)
extern

Definition at line 55 of file geqo_selection.c.

57{
58 int first,
59 second;
60
61 first = linear_rand(root, pool->size, bias);
62 second = linear_rand(root, pool->size, bias);
63
64 /*
65 * Ensure we have selected different genes, except if pool size is only
66 * one, when we can't.
67 */
68 if (pool->size > 1)
69 {
70 while (first == second)
71 second = linear_rand(root, pool->size, bias);
72 }
73
74 geqo_copy(root, momma, &pool->data[first], pool->string_length);
75 geqo_copy(root, daddy, &pool->data[second], pool->string_length);
76}
void geqo_copy(PlannerInfo *root, Chromosome *chromo1, Chromosome *chromo2, int string_length)
Definition geqo_copy.c:47
static int linear_rand(PlannerInfo *root, int pool_size, double bias)
static int fb(int x)
tree ctl root
Definition radixtree.h:1857
int string_length
Definition geqo_gene.h:45
int size
Definition geqo_gene.h:44
Chromosome * data
Definition geqo_gene.h:43

References Pool::data, fb(), geqo_copy(), linear_rand(), root, Pool::size, and Pool::string_length.

Referenced by geqo().