#include <genome.h>
Definition at line 37 of file genome.h.
Public Methods | |
| Genome (void) | |
| Genome (GeneticDist *D) | |
| Genome (const Genome &A) | |
| ~Genome (void) | |
| const Genome & | operator= (const Genome &A) |
| unsigned | nchrom (void) |
| unsigned | size (void) |
| int | chrom_id (const Chromosome &chrm) const |
| void | release (void) |
| void | remodel (GeneticDist *D) |
| void | resize (const unsigned nc, const unsigned nl) |
Public Attributes | |
| Chromosome * | chromosome |
Protected Methods | |
| void | copyfrom (const Genome &A) |
Protected Attributes | |
| unsigned | numchrom |
|
|
Definition at line 44 of file genome.h. References numchrom.
00044 {numchrom=0; chromosome = 0;}
|
|
|
Definition at line 39 of file genome.cpp. References chromosome, numchrom, and remodel().
00040 {
00041 numchrom = 0;
00042 chromosome = 0;
00043 remodel(D);
00044 }
|
|
|
Definition at line 46 of file genome.cpp. References chromosome, copyfrom(), and numchrom.
00047 {
00048 numchrom = 0;
00049 chromosome = 0;
00050 copyfrom(A);
00051 }
|
|
|
Definition at line 47 of file genome.h. References release().
00047 {release();};
|
|
|
Definition at line 114 of file genome.cpp. References matvec::Locus::allele, chromosome, matvec::Chromosome::id(), matvec::Chromosome::locus, matvec::Chromosome::nloci(), and numchrom.
00115 {
00116 int retval = -1;
00117 Chromosome *C;
00118 unsigned i,j,nl;
00119 for (i=0; i<numchrom; i++) {
00120 C = &(chromosome[i]);
00121 nl = C->nloci();
00122 for (j=0; j<nl; j++) {
00123 if (chrm.locus[j].allele != C->locus[j].allele) break;
00124 }
00125 if (j==nl) {
00126 retval = C->id();
00127 break;
00128 }
00129 }
00130 return retval;
00131 }
|
|
|
Definition at line 53 of file genome.cpp. References chromosome, and numchrom. Referenced by Genome(), and operator=().
00054 {
00055 if (this == &A) return;
00056 numchrom = A.numchrom;
00057 if (chromosome) {
00058 delete [] chromosome;
00059 chromosome=0;
00060 }
00061 if(numchrom>0){
00062 chromosome = new Chromosome [numchrom]; // each chrom should resize
00063 }
00064 else{
00065 chromosome = 0;
00066 }
00067 for (unsigned i=0; i<numchrom; i++) chromosome[i] = A.chromosome[i];
00068 }
|
|
|
Definition at line 51 of file genome.h. References numchrom. Referenced by matvec::Population::cond_genotype_config(), matvec::Population::genotype_config(), matvec::Population::get_genotype_freq(), matvec::Population::gibbs_iterate(), matvec::Population::ind_gamete(), and matvec::Population::llhood_phenotype().
00051 {return numchrom;}
|
|
|
Definition at line 70 of file genome.cpp. References copyfrom().
00071 {
00072 copyfrom(A);
00073 return *this;
00074 }
|
|
|
Definition at line 109 of file genome.cpp. References chromosome. Referenced by ~Genome().
00110 {
00111 if (chromosome) { delete [] chromosome; chromosome = 0; }
00112 }
|
|
|
Definition at line 76 of file genome.cpp. References matvec::GeneticDist::chrom(), chromosome, matvec::GeneticDist::nchrom(), numchrom, and matvec::Chromosome::resize(). Referenced by Genome(), matvec::new_Genome_vec(), and matvec::Individual::remodel().
00077 {
00078 numchrom = D->nchrom();
00079 ChromStruct *Chrom = D->chrom();
00080 if (chromosome) {
00081 delete [] chromosome;
00082 chromosome=0;
00083 }
00084 if (numchrom >0) {
00085 chromosome = new Chromosome [numchrom]; // each chrom should resize
00086 }
00087 else {
00088 chromosome = 0;
00089 }
00090 for (unsigned i=0; i<numchrom; i++) chromosome[i].resize(Chrom[i].nloci());
00091 }
|
|
||||||||||||
|
Definition at line 93 of file genome.cpp. References chromosome, numchrom, and matvec::Chromosome::resize(). Referenced by matvec::Population::build_pop_gamete().
00094 {
00095 numchrom = nc;
00096 if (chromosome) {
00097 delete [] chromosome;
00098 chromosome=0;
00099 }
00100 if(numchrom>0){
00101 chromosome = new Chromosome [numchrom]; // each chrom should resize
00102 }
00103 else{
00104 chromosome = 0;
00105 }
00106 for (unsigned i=0; i<numchrom; i++) chromosome[i].resize(nl);
00107 }
|
|
|
Definition at line 52 of file genome.h. References numchrom. Referenced by matvec::Population::display(), and matvec::Population::resize_genotype_counter().
00052 {return numchrom;}
|
|
|
|
Definition at line 39 of file genome.h. Referenced by chrom_id(), copyfrom(), Genome(), nchrom(), remodel(), resize(), and size(). |
1.2.16