Header And Logo

PostgreSQL
| The world's most advanced open source database.

geqo_copy.c

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------
00002  *
00003  * geqo_copy.c
00004  *
00005  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00006  * Portions Copyright (c) 1994, Regents of the University of California
00007  *
00008  * src/backend/optimizer/geqo/geqo_copy.c
00009  *
00010  *-------------------------------------------------------------------------
00011  */
00012 
00013 /* contributed by:
00014    =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
00015    *  Martin Utesch              * Institute of Automatic Control      *
00016    =                             = University of Mining and Technology =
00017    *  [email protected]  * Freiberg, Germany                   *
00018    =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
00019  */
00020 
00021 /* this is adopted from D. Whitley's Genitor algorithm */
00022 
00023 /*************************************************************/
00024 /*                                                           */
00025 /*  Copyright (c) 1990                                       */
00026 /*  Darrell L. Whitley                                       */
00027 /*  Computer Science Department                              */
00028 /*  Colorado State University                                */
00029 /*                                                           */
00030 /*  Permission is hereby granted to copy all or any part of  */
00031 /*  this program for free distribution.   The author's name  */
00032 /*  and this copyright notice must be included in any copy.  */
00033 /*                                                           */
00034 /*************************************************************/
00035 
00036 #include "postgres.h"
00037 #include "optimizer/geqo_copy.h"
00038 
00039 /* geqo_copy
00040  *
00041  *   copies one gene to another
00042  *
00043  */
00044 void
00045 geqo_copy(PlannerInfo *root, Chromosome *chromo1, Chromosome *chromo2,
00046           int string_length)
00047 {
00048     int         i;
00049 
00050     for (i = 0; i < string_length; i++)
00051         chromo1->string[i] = chromo2->string[i];
00052 
00053     chromo1->worth = chromo2->worth;
00054 }