Line data Source code
1 : /*------------------------------------------------------------------------
2 : *
3 : * geqo_copy.c
4 : *
5 : * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
6 : * Portions Copyright (c) 1994, Regents of the University of California
7 : *
8 : * src/backend/optimizer/geqo/geqo_copy.c
9 : *
10 : *-------------------------------------------------------------------------
11 : */
12 :
13 : /*
14 : * contributed by:
15 : * =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
16 : * * Martin Utesch * Institute of Automatic Control *
17 : * = = University of Mining and Technology =
18 : * * utesch@aut.tu-freiberg.de * Freiberg, Germany *
19 : * =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
20 : */
21 :
22 : /* this is adopted from D. Whitley's Genitor algorithm */
23 :
24 : /*************************************************************/
25 : /* */
26 : /* Copyright (c) 1990 */
27 : /* Darrell L. Whitley */
28 : /* Computer Science Department */
29 : /* Colorado State University */
30 : /* */
31 : /* Permission is hereby granted to copy all or any part of */
32 : /* this program for free distribution. The author's name */
33 : /* and this copyright notice must be included in any copy. */
34 : /* */
35 : /*************************************************************/
36 :
37 : #include "postgres.h"
38 : #include "optimizer/geqo_copy.h"
39 :
40 : /*
41 : * geqo_copy
42 : *
43 : * copies one gene to another
44 : *
45 : */
46 : void
47 5460 : geqo_copy(PlannerInfo *root, Chromosome *chromo1, Chromosome *chromo2,
48 : int string_length)
49 : {
50 : int i;
51 :
52 19260 : for (i = 0; i < string_length; i++)
53 13800 : chromo1->string[i] = chromo2->string[i];
54 :
55 5460 : chromo1->worth = chromo2->worth;
56 5460 : }
|