Header And Logo

| The world's most advanced open source database.

Defines | Functions

geqo_random.h File Reference

#include <math.h>
#include "optimizer/geqo.h"
Include dependency graph for geqo_random.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


#define geqo_randint(root, upper, lower)   ( (int) floor( geqo_rand(root)*(((upper)-(lower))+0.999999) ) + (lower) )


void geqo_set_seed (PlannerInfo *root, double seed)
double geqo_rand (PlannerInfo *root)

Define Documentation

#define geqo_randint (   root,
)    ( (int) floor( geqo_rand(root)*(((upper)-(lower))+0.999999) ) + (lower) )

Definition at line 38 of file geqo_random.h.

Referenced by cx(), edge_failure(), geqo_mutation(), gimme_gene(), gimme_tour(), init_tour(), ox1(), ox2(), pmx(), and px().

Function Documentation

double geqo_rand ( PlannerInfo root  ) 

Definition at line 35 of file geqo_random.c.

References PlannerInfo::join_search_private, and pg_erand48().

Referenced by linear_rand().

    GeqoPrivateData *private = (GeqoPrivateData *) root->join_search_private;

    return pg_erand48(private->random_state);

void geqo_set_seed ( PlannerInfo root,
double  seed 

Definition at line 20 of file geqo_random.c.

References PlannerInfo::join_search_private, and Min.

Referenced by geqo().

    GeqoPrivateData *private = (GeqoPrivateData *) root->join_search_private;

     * XXX. This seeding algorithm could certainly be improved - but it is not
     * critical to do so.
    memset(private->random_state, 0, sizeof(private->random_state));
           Min(sizeof(private->random_state), sizeof(seed)));