00001 //**************************************************** 00002 // April, 1993, University of Illinois 00003 // Copyright (C) 1993, 1994 Tianlin Wang 00004 /* Copyright (C) 1994-2003 Matvec Development Team. 00005 00006 This program is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public 00017 License along with this library; if not, write to the Free 00018 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 00019 MA 02111-1307, USA 00020 */ 00021 00022 #ifndef Genome_H 00023 #define Genome_H 00024 00025 #include "geneticdist.h" 00026 #include "chromosome.h" 00027 00028 namespace matvec { 00029 class Chromosome; 00030 /*! 00031 \class Genome Genome.h 00032 \brief a genome consists of chromosomes 00033 00034 \sa Chromosome 00035 */ 00036 00037 class Genome { 00038 protected: 00039 unsigned numchrom; 00040 void copyfrom(const Genome& A); 00041 public: 00042 Chromosome *chromosome; 00043 00044 Genome(void) {numchrom=0; chromosome = 0;} 00045 Genome(GeneticDist *D); 00046 Genome(const Genome& A); // copy constructor 00047 ~Genome(void){release();}; 00048 00049 const Genome& operator=(const Genome& A); 00050 00051 unsigned nchrom(void) {return numchrom;} 00052 unsigned size(void) {return numchrom;} 00053 int chrom_id(const Chromosome& chrm) const; 00054 void release(void); 00055 void remodel(GeneticDist *D); 00056 void resize(const unsigned nc, const unsigned nl); 00057 }; 00058 extern Genome* new_Genome_vec(const unsigned m, 00059 GeneticDist *D = 0); 00060 } 00061 #endif
1.2.16