~ubuntu-branches/ubuntu/natty/postgresql-8.4/natty-updates

« back to all changes in this revision

Viewing changes to src/backend/optimizer/geqo/geqo_copy.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-03-20 12:00:13 UTC
  • Revision ID: james.westby@ubuntu.com-20090320120013-hogj7egc5mjncc5g
Tags: upstream-8.4~0cvs20090328
ImportĀ upstreamĀ versionĀ 8.4~0cvs20090328

Show diffs side-by-side

added added

removed removed

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