35static int compare(
const void *arg1,
const void *arg2);
50 new_pool->
size = (int) pool_size;
58 for (
i = 0;
i < pool_size;
i++)
59 chromo[
i].
string =
palloc((string_length + 1) *
sizeof(
Gene));
116 if (
i == 0 && bad >= 10000)
117 elog(
ERROR,
"geqo failed to make a valid plan");
123 elog(
DEBUG1,
"%d invalid tours found while selecting %d pool entries",
204 mid = pool->
size / 2;
205 bot = pool->
size - 1;
218 else if (bot - top <= 1)
230 mid = top + ((bot - top) / 2);
235 mid = top + ((bot - top) / 2);
void geqo_copy(PlannerInfo *root, Chromosome *chromo1, Chromosome *chromo2, int string_length)
Cost geqo_eval(PlannerInfo *root, Gene *tour, int num_gene)
Pool * alloc_pool(PlannerInfo *root, int pool_size, int string_length)
void sort_pool(PlannerInfo *root, Pool *pool)
void free_chromo(PlannerInfo *root, Chromosome *chromo)
void free_pool(PlannerInfo *root, Pool *pool)
void random_init_pool(PlannerInfo *root, Pool *pool)
void spread_chromo(PlannerInfo *root, Chromosome *chromo, Pool *pool)
Chromosome * alloc_chromo(PlannerInfo *root, int string_length)
static int compare(const void *arg1, const void *arg2)
void init_tour(PlannerInfo *root, Gene *tour, int num_gene)
void pfree(void *pointer)
#define qsort(a, b, c, d)
static pg_noinline void Size size