Nemo  2.3.46
ttquanti.cc File Reference
#include <sstream>
#include <fstream>
#include <string.h>
#include <cmath>
#include <algorithm>
#include "ttquanti.h"
#include "filehandler.h"
#include "output.h"
#include "Uniform.h"
#include "tstring.h"
#include "utils.h"

Functions

void store_quanti_trait_values (Patch *patch, unsigned int patchID, unsigned int size, unsigned int *cntr, sex_t SEX, age_idx AGE, DataTable< double > *ptable, DataTable< double > *gtable, unsigned int nTrait, unsigned int TraitIndex)
 

Detailed Description

Id
ttquanti.cc,v 1.37 2017-02-09 08:49:43 fred Exp

Nemo2

Copyright (C) 2006-2015 Frederic Guillaume frede.nosp@m.ric..nosp@m.guill.nosp@m.aume.nosp@m.@ieu..nosp@m.uzh..nosp@m.ch

This file is part of Nemo

Nemo is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Nemo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

created on

Date
14.11.2005
Author
fred

Function Documentation

void store_quanti_trait_values ( Patch patch,
unsigned int  patchID,
unsigned int  size,
unsigned int cntr,
sex_t  SEX,
age_idx  AGE,
DataTable< double > *  ptable,
DataTable< double > *  gtable,
unsigned int  nTrait,
unsigned int  TraitIndex 
)

References Patch::get(), TTQuanti::get_genotype(), Individual::getTrait(), TTQuanti::getValue(), and DataTable< T >::set().

Referenced by TTQuantiSH::setDataTables().

1839 {
1840  double *phe;
1841  TTQuanti *trait;
1842 
1843  for(unsigned int j = 0; j < size; ++j) {
1844 
1845  trait = dynamic_cast<TTQuanti*> (patch->get(SEX, AGE, j)->getTrait( TraitIndex ));
1846 
1847  phe = (double*)trait->getValue();
1848 
1849  for(unsigned int k = 0; k < nTrait; k++){
1850  ptable->set( k, patchID, (*cntr), phe[k]);
1851  gtable->set( k, patchID, (*cntr), trait->get_genotype(k));
1852  }
1853  (*cntr)++;
1854  }
1855 
1856 }
TTQuanti.
Definition: ttquanti.h:55
double get_genotype(unsigned int trait)
Definition: ttquanti.cc:1105
virtual void * getValue() const
Definition: ttquanti.h:86
TTrait * getTrait(IDX T)
Trait accessor.
Definition: individual.h:277
Individual * get(sex_t SEX, age_idx AGE, unsigned int at)
Returns a pointer to the individual sitting at the index passed.
Definition: metapop.h:523
void set(unsigned int group, unsigned int Class, unsigned int elmnt, T val)
Sets the element 'elmnt' of the class 'Class' in the group 'group' to the value 'val'.
Definition: datatable.h:232

Generated for Nemo v2.3.0 by  doxygen 1.8.8 --
Catalogued on GSR