#include <math.h>
#include "optimizer/geqo.h"
Go to the source code of this file.
Defines | |
#define | geqo_randint(root, upper, lower) ( (int) floor( geqo_rand(root)*(((upper)-(lower))+0.999999) ) + (lower) ) |
Functions | |
void | geqo_set_seed (PlannerInfo *root, double seed) |
double | geqo_rand (PlannerInfo *root) |
#define geqo_randint | ( | root, | ||
upper, | ||||
lower | ||||
) | ( (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().
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)); memcpy(private->random_state, &seed, Min(sizeof(private->random_state), sizeof(seed))); }