Nemo  2.3.46
TTQuantiSH Class Reference

TTQuantiSH. More...

#include <ttquanti.h>

+ Inheritance diagram for TTQuantiSH:
+ Collaboration diagram for TTQuantiSH:

Public Member Functions

 TTQuantiSH (TProtoQuanti *TP)
 
virtual ~TTQuantiSH ()
 
void resetPtrs ()
 
virtual void init ()
 
virtual bool setStatRecorders (std::string &token)
 
void addQuanti (age_t AGE)
 
void addEigen (age_t AGE)
 
void addEigenValues (age_t AGE)
 
void addEigenVect1 (age_t AGE)
 
void addQuantiPerPatch (age_t AGE)
 
void addAvgPerPatch (age_t AGE)
 
void addVarPerPatch (age_t AGE)
 
void addCovarPerPatch (age_t AGE)
 
void addEigenPerPatch (age_t AGE)
 
void addEigenValuesPerPatch (age_t AGE)
 
void addEigenVect1PerPatch (age_t AGE)
 
void addEigenStatsPerPatcg (age_t AGE)
 
void addSkewPerPatch (age_t AGE)
 
void setDataTables (age_t AGE)
 
void setAdultStats ()
 
void setOffsprgStats ()
 
void setStats (age_t AGE)
 
double getMeanPhenot (unsigned int i)
 
double getVa (unsigned int i)
 
double getVb (unsigned int i)
 
double getVp (unsigned int i)
 
double getQst (unsigned int i)
 
double getCovar (unsigned int i)
 
double getEigenValue (unsigned int i)
 
double getEigenVectorElt (unsigned int t1, unsigned int t2)
 
double getMeanPhenotPerPatch (unsigned int i, unsigned int p)
 
double getVaPerPatch (unsigned int i, unsigned int p)
 
double getVpPerPatch (unsigned int i, unsigned int p)
 
double getEigenValuePerPatch (unsigned int i, unsigned int p)
 
double getCovarPerPatch (unsigned int p, unsigned int i)
 
double getEigenVectorEltPerPatch (unsigned int p, unsigned int v)
 
double getSkewPerPatch (unsigned int i, unsigned int p)
 
- Public Member Functions inherited from TraitStatHandler< TProtoQuanti, TTQuantiSH >
 TraitStatHandler (TProtoQuanti *trait_proto)
 
virtual ~TraitStatHandler ()
 
- Public Member Functions inherited from StatHandler< TTQuantiSH >
 StatHandler ()
 
virtual ~StatHandler ()
 
virtual void clear ()
 Empties the _recorders list, they are destroyed in StatHandlerBase::reset(). More...
 
virtual StatRecorder
< TTQuantiSH > * 
add (std::string Title, std::string Name, age_t AGE, unsigned int ARG1, unsigned int ARG2, double(TTQuantiSH::*getStatNoArg)(void), double(TTQuantiSH::*getStatOneArg)(unsigned int), double(TTQuantiSH::*getStatTwoArg)(unsigned int, unsigned int), void(TTQuantiSH::*setStat)(void))
 Adds a StatRecorder to the list, it is also added to the StatHandlerBase::_stats list. More...
 
- Public Member Functions inherited from StatHandlerBase
 StatHandlerBase ()
 
virtual ~StatHandlerBase ()
 
virtual void reset ()
 Empties the _stats list and calls clear() (defined in the derived class). More...
 
Metapopget_pop_ptr ()
 
void set_service (StatServices *srv)
 
StatServicesget_service ()
 
unsigned int getOccurrence ()
 
unsigned int getNumOccurrences ()
 
unsigned int getCurrentOccurrence ()
 
unsigned int getNbRecorders ()
 
std::list< StatRecBase * > & getStats ()
 
virtual void add (StatRecBase *rec)
 
virtual void update ()
 This function is left empty as the StatServices calls StatRecorder::setVal directly. More...
 
- Public Member Functions inherited from Handler
virtual ~Handler ()
 

Private Attributes

double * _meanP
 
double * _meanG
 
double * _Va
 
double * _Vb
 
double * _Vp
 
double * _covar
 
double * _eigval
 
double ** _eigvect
 
double ** _pmeanP
 
double ** _pmeanG
 
double ** _pVa
 
double ** _pVp
 
double ** _pcovar
 
double ** _peigval
 
double ** _peigvect
 
unsigned int _nb_trait
 
unsigned int _patchNbr
 
bool _eVar
 
gsl_matrix * _G
 
gsl_matrix * _evec
 
gsl_vector * _eval
 
gsl_eigen_symmv_workspace * _ws
 
DataTable< double > _phenoTable
 
DataTable< double > _genoTable
 
unsigned int _table_set_gen
 
unsigned int _table_set_age
 
unsigned int _table_set_repl
 

Additional Inherited Members

- Protected Types inherited from StatHandler< TTQuantiSH >
typedef std::list
< StatRecorder< TTQuantiSH >
* >::iterator 
REC_IT
 
- Protected Attributes inherited from TraitStatHandler< TProtoQuanti, TTQuantiSH >
TProtoQuanti_SHLinkedTrait
 Pointer to a TraitProtoype object. More...
 
int _SHLinkedTraitIndex
 Index of the trait in the Individual::Traits table. More...
 
- Protected Attributes inherited from StatHandler< TTQuantiSH >
std::list< StatRecorder
< TTQuantiSH > * > 
_recorders
 The list of stat recorders. More...
 
- Protected Attributes inherited from StatHandlerBase
Metapop_pop
 Link to the current population, set through the link to the StatService. More...
 

Detailed Description

Constructor & Destructor Documentation

TTQuantiSH::TTQuantiSH ( TProtoQuanti TP)
inline
252  _meanP(0), _meanG(0), _Va(0), _Vb(0), _Vp(0), _covar(0), _eigval(0), _eigvect(0),
253  _pmeanP(0), _pmeanG(0), _pVa(0), _pVp(0), _pcovar(0), _peigval(0), _peigvect(0),
254  _nb_trait(0),_patchNbr(0),_G(0),_evec(0),_eval(0),_ws(0),
255  _table_set_gen(999999), _table_set_age(999999), _table_set_repl(999999)
256  {}
double ** _pVa
Definition: ttquanti.h:236
double ** _pcovar
Definition: ttquanti.h:236
double * _Va
Definition: ttquanti.h:235
double * _Vp
Definition: ttquanti.h:235
gsl_matrix * _G
Definition: ttquanti.h:241
gsl_matrix * _evec
Definition: ttquanti.h:241
double * _meanP
Definition: ttquanti.h:235
double ** _pVp
Definition: ttquanti.h:236
double ** _pmeanG
Definition: ttquanti.h:236
double ** _eigvect
Definition: ttquanti.h:235
double * _meanG
Definition: ttquanti.h:235
double * _eigval
Definition: ttquanti.h:235
unsigned int _nb_trait
Definition: ttquanti.h:238
unsigned int _patchNbr
Definition: ttquanti.h:238
unsigned int _table_set_repl
Definition: ttquanti.h:246
unsigned int _table_set_age
Definition: ttquanti.h:246
double * _Vb
Definition: ttquanti.h:235
gsl_vector * _eval
Definition: ttquanti.h:242
unsigned int _table_set_gen
Definition: ttquanti.h:246
double ** _peigval
Definition: ttquanti.h:236
double ** _pmeanP
Definition: ttquanti.h:236
double ** _peigvect
Definition: ttquanti.h:236
gsl_eigen_symmv_workspace * _ws
Definition: ttquanti.h:243
double * _covar
Definition: ttquanti.h:235
virtual TTQuantiSH::~TTQuantiSH ( )
inlinevirtual

References resetPtrs().

258 {resetPtrs();}
void resetPtrs()
Definition: ttquanti.cc:1156

Member Function Documentation

void TTQuantiSH::addAvgPerPatch ( age_t  AGE)

References _nb_trait, StatHandlerBase::_pop, StatHandler< TTQuantiSH >::add(), ADULTS, ALL, getMeanPhenotPerPatch(), Metapop::getPatchNbr(), tstring::int2str(), OFFSPRG, setAdultStats(), and setOffsprgStats().

Referenced by addQuantiPerPatch(), and setStatRecorders().

1501 {
1502  if (AGE == ALL) {
1505  return;
1506  }
1507 
1508  unsigned int patchNbr = _pop->getPatchNbr();
1509 
1510  string suffix = (AGE == ADULTS ? "adlt.":"off.");
1511  string name;
1512  string patch;
1513  string t1;
1514 
1515  void (TTQuantiSH::* setter) (void) = (AGE == ADULTS ?
1517 
1518  add("Mean phenotype of trait 1 in patch 1", suffix + "q1.p1", AGE, 0, 0, 0, 0,
1520 
1521  for(unsigned int p = 0; p < patchNbr; p++) {
1522  for(unsigned int i = 0; i < _nb_trait; i++) {
1523  if(p == 0 && i == 0) continue;
1524  name = "Mean phenotype of trait " + tstring::int2str(i+1) + " in patch " + tstring::int2str(p+1);
1525  t1 = "q" + tstring::int2str(i+1);
1526  patch = ".p" + tstring::int2str(p+1);
1527  add(name, suffix + t1 + patch, AGE, i, p, 0, 0, &TTQuantiSH::getMeanPhenotPerPatch, 0);
1528  }
1529  }
1530 
1531 }
void addAvgPerPatch(age_t AGE)
Definition: ttquanti.cc:1500
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:54
TTQuantiSH.
Definition: ttquanti.h:233
unsigned int getPatchNbr()
Definition: metapop.h:270
void setOffsprgStats()
Definition: ttquanti.h:281
static string int2str(const int i)
Writes an integer value into a string.
Definition: tstring.h:95
unsigned int _nb_trait
Definition: ttquanti.h:238
virtual StatRecorder< TTQuantiSH > * add(std::string Title, std::string Name, age_t AGE, unsigned int ARG1, unsigned int ARG2, double(TTQuantiSH::*getStatNoArg)(void), double(TTQuantiSH::*getStatOneArg)(unsigned int), double(TTQuantiSH::*getStatTwoArg)(unsigned int, unsigned int), void(TTQuantiSH::*setStat)(void))
Adds a StatRecorder to the list, it is also added to the StatHandlerBase::_stats list.
Definition: stathandler.h:144
#define ALL
All ages age class flag.
Definition: types.h:56
void setAdultStats()
Definition: ttquanti.h:280
Metapop * _pop
Link to the current population, set through the link to the StatService.
Definition: stathandler.h:61
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
double getMeanPhenotPerPatch(unsigned int i, unsigned int p)
Definition: ttquanti.h:292
void TTQuantiSH::addCovarPerPatch ( age_t  AGE)

References _nb_trait, StatHandlerBase::_pop, StatHandler< TTQuantiSH >::add(), ADULTS, ALL, getCovarPerPatch(), Metapop::getPatchNbr(), tstring::int2str(), OFFSPRG, setAdultStats(), setOffsprgStats(), and warning().

Referenced by addQuantiPerPatch(), and setStatRecorders().

1582 {
1583  if(_nb_trait < 2) {
1584  warning("not recording traits covariance with only one \"quanti\" trait!\n");
1585  return;
1586  }
1587 
1588  if (AGE == ALL) {
1591  return;
1592  }
1593 
1594  string suffix = (AGE == ADULTS ? "adlt.":"off.");
1595  string patch;
1596  string cov;
1597  unsigned int patchNbr = _pop->getPatchNbr();
1598 
1599  void (TTQuantiSH::* setter) (void) = (AGE == ADULTS ?
1601 
1602  add("Genetic covariance of trait 1 and trait 2 in patch 1", suffix + "cov.q12.p1", AGE, 0, 0, 0, 0,
1603  &TTQuantiSH::getCovarPerPatch, setter);
1604 
1605  unsigned int c;
1606  for(unsigned int p = 0; p < patchNbr; p++) {
1607  patch = ".p" + tstring::int2str(p+1);
1608  c = 0;
1609  for(unsigned int t = 0; t < _nb_trait; ++t) {
1610  for(unsigned int v = t + 1; v < _nb_trait; ++v){
1611  if(p==0 && t==0 && v==1) {c++; continue;}
1612  cov = tstring::int2str((t+1)*10+v+1);
1613  add("", suffix + "cov.q" + cov + patch, AGE, p, c++, 0, 0, &TTQuantiSH::getCovarPerPatch, 0);
1614  }
1615  }
1616  }
1617 
1618 }
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:54
TTQuantiSH.
Definition: ttquanti.h:233
unsigned int getPatchNbr()
Definition: metapop.h:270
void warning(const char *str,...)
Definition: output.cc:56
void setOffsprgStats()
Definition: ttquanti.h:281
static string int2str(const int i)
Writes an integer value into a string.
Definition: tstring.h:95
unsigned int _nb_trait
Definition: ttquanti.h:238
virtual StatRecorder< TTQuantiSH > * add(std::string Title, std::string Name, age_t AGE, unsigned int ARG1, unsigned int ARG2, double(TTQuantiSH::*getStatNoArg)(void), double(TTQuantiSH::*getStatOneArg)(unsigned int), double(TTQuantiSH::*getStatTwoArg)(unsigned int, unsigned int), void(TTQuantiSH::*setStat)(void))
Adds a StatRecorder to the list, it is also added to the StatHandlerBase::_stats list.
Definition: stathandler.h:144
#define ALL
All ages age class flag.
Definition: types.h:56
void setAdultStats()
Definition: ttquanti.h:280
Metapop * _pop
Link to the current population, set through the link to the StatService.
Definition: stathandler.h:61
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
double getCovarPerPatch(unsigned int p, unsigned int i)
Definition: ttquanti.h:296
void addCovarPerPatch(age_t AGE)
Definition: ttquanti.cc:1581
void TTQuantiSH::addEigen ( age_t  AGE)

References _nb_trait, StatHandler< TTQuantiSH >::add(), ADULTS, ALL, getEigenValue(), getEigenVectorElt(), tstring::int2str(), OFFSPRG, setAdultStats(), setOffsprgStats(), and warning().

Referenced by addEigenValues(), addEigenVect1(), and setStatRecorders().

1397 {
1398  if(_nb_trait < 2) {
1399  warning("not recording G-matrix eigen stats with only one \"quanti\" trait!\n");
1400  return;
1401  }
1402 
1403  if (AGE == ALL) {
1404  addEigen(ADULTS);
1405  addEigen(OFFSPRG);
1406  return;
1407  }
1408 
1409  string suffix = (AGE == ADULTS ? "adlt.":"off.");
1410 
1411  void (TTQuantiSH::* setter) (void) = (AGE == ADULTS ?
1413 
1414  add("", suffix + "q.eval1",AGE,0,0,0,&TTQuantiSH::getEigenValue, 0, setter); //this one calls the setter
1415 
1416  for(unsigned int t = 1; t < _nb_trait; ++t)
1417  add("", suffix + "q.eval" + tstring::int2str(t+1),AGE,t,0,0,&TTQuantiSH::getEigenValue, 0, 0);
1418 
1419  for(unsigned int t = 0; t< _nb_trait; ++t)
1420  for(unsigned int v = 0; v < _nb_trait; ++v)
1421  add("", suffix + "q.evect" + tstring::int2str((t+1)*10+(v+1)),AGE,t,v,0,0,&TTQuantiSH::getEigenVectorElt,0);
1422 
1423 }
double getEigenVectorElt(unsigned int t1, unsigned int t2)
Definition: ttquanti.h:290
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:54
TTQuantiSH.
Definition: ttquanti.h:233
void warning(const char *str,...)
Definition: output.cc:56
void setOffsprgStats()
Definition: ttquanti.h:281
static string int2str(const int i)
Writes an integer value into a string.
Definition: tstring.h:95
unsigned int _nb_trait
Definition: ttquanti.h:238
void addEigen(age_t AGE)
Definition: ttquanti.cc:1396
virtual StatRecorder< TTQuantiSH > * add(std::string Title, std::string Name, age_t AGE, unsigned int ARG1, unsigned int ARG2, double(TTQuantiSH::*getStatNoArg)(void), double(TTQuantiSH::*getStatOneArg)(unsigned int), double(TTQuantiSH::*getStatTwoArg)(unsigned int, unsigned int), void(TTQuantiSH::*setStat)(void))
Adds a StatRecorder to the list, it is also added to the StatHandlerBase::_stats list.
Definition: stathandler.h:144
#define ALL
All ages age class flag.
Definition: types.h:56
void setAdultStats()
Definition: ttquanti.h:280
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
double getEigenValue(unsigned int i)
Definition: ttquanti.h:289
void TTQuantiSH::addEigenPerPatch ( age_t  AGE)

References _nb_trait, StatHandlerBase::_pop, StatHandler< TTQuantiSH >::add(), ADULTS, ALL, getEigenValuePerPatch(), getEigenVectorEltPerPatch(), Metapop::getPatchNbr(), tstring::int2str(), OFFSPRG, setAdultStats(), setOffsprgStats(), and warning().

Referenced by addEigenValuesPerPatch(), addEigenVect1PerPatch(), addQuantiPerPatch(), and setStatRecorders().

1623 {
1624  if(_nb_trait < 2) {
1625  warning("not recording G-matrix eigen stats with only one \"quanti\" trait!\n");
1626  return;
1627  }
1628 
1629  if (AGE == ALL) {
1632  return;
1633  }
1634 
1635  unsigned int patchNbr = _pop->getPatchNbr();
1636  string suffix = (AGE == ADULTS ? "adlt.":"off.");
1637  string patch;
1638  unsigned int pv =0;
1639 
1640  void (TTQuantiSH::* setter) (void) = (AGE == ADULTS ?
1642 
1643 
1644  add("First G-matrix eigenvalue in patch 1", suffix + "qeval1.p1", AGE, 0, 0, 0, 0,
1646 
1647  for(unsigned int p = 0; p < patchNbr; ++p) {
1648  patch = ".p" + tstring::int2str(p+1);
1649  for(unsigned int t = 0; t < _nb_trait; ++t) {
1650  if(p==0 && t==0) continue;
1651  add("", suffix + "qeval" + tstring::int2str(t+1) + patch, AGE, t, p, 0, 0, &TTQuantiSH::getEigenValuePerPatch,0);
1652  }
1653  }
1654  for(unsigned int p = 0; p < patchNbr; ++p) {
1655  patch = ".p" + tstring::int2str(p+1);
1656  pv = 0;
1657  for(unsigned int t = 0; t < _nb_trait; ++t)
1658  for(unsigned int v = 0; v < _nb_trait; ++v)
1659  add("", suffix + "qevect" + tstring::int2str((t+1)*10+v+1) + patch, AGE, p, pv++, 0, 0, &TTQuantiSH::getEigenVectorEltPerPatch,0);
1660  }
1661 
1662 }
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:54
TTQuantiSH.
Definition: ttquanti.h:233
double getEigenVectorEltPerPatch(unsigned int p, unsigned int v)
Definition: ttquanti.h:297
unsigned int getPatchNbr()
Definition: metapop.h:270
void warning(const char *str,...)
Definition: output.cc:56
void setOffsprgStats()
Definition: ttquanti.h:281
static string int2str(const int i)
Writes an integer value into a string.
Definition: tstring.h:95
void addEigenPerPatch(age_t AGE)
Definition: ttquanti.cc:1622
unsigned int _nb_trait
Definition: ttquanti.h:238
virtual StatRecorder< TTQuantiSH > * add(std::string Title, std::string Name, age_t AGE, unsigned int ARG1, unsigned int ARG2, double(TTQuantiSH::*getStatNoArg)(void), double(TTQuantiSH::*getStatOneArg)(unsigned int), double(TTQuantiSH::*getStatTwoArg)(unsigned int, unsigned int), void(TTQuantiSH::*setStat)(void))
Adds a StatRecorder to the list, it is also added to the StatHandlerBase::_stats list.
Definition: stathandler.h:144
#define ALL
All ages age class flag.
Definition: types.h:56
void setAdultStats()
Definition: ttquanti.h:280
Metapop * _pop
Link to the current population, set through the link to the StatService.
Definition: stathandler.h:61
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
double getEigenValuePerPatch(unsigned int i, unsigned int p)
Definition: ttquanti.h:295
void TTQuantiSH::addEigenStatsPerPatcg ( age_t  AGE)
void TTQuantiSH::addEigenValues ( age_t  AGE)

References _nb_trait, StatHandler< TTQuantiSH >::add(), addEigen(), ADULTS, ALL, getEigenValue(), tstring::int2str(), OFFSPRG, setAdultStats(), setOffsprgStats(), and warning().

Referenced by setStatRecorders().

1428 {
1429  if(_nb_trait < 2) {
1430  warning("not recording G-matrix eigen stats with only one \"quanti\" trait!\n");
1431  return;
1432  }
1433 
1434  if (AGE == ALL) {
1435  addEigen(ADULTS);
1436  addEigen(OFFSPRG);
1437  return;
1438  }
1439 
1440  string suffix = (AGE == ADULTS ? "adlt.":"off.");
1441 
1442  void (TTQuantiSH::* setter) (void) = (AGE == ADULTS ?
1444 
1445  add("", suffix + "q.eval1",AGE,0,0,0,&TTQuantiSH::getEigenValue, 0, setter);
1446 
1447  for(unsigned int t = 1; t < _nb_trait; ++t)
1448  add("", suffix + "q.eval" + tstring::int2str(t+1),AGE,t,0,0,&TTQuantiSH::getEigenValue, 0, 0);
1449 
1450 
1451 }
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:54
TTQuantiSH.
Definition: ttquanti.h:233
void warning(const char *str,...)
Definition: output.cc:56
void setOffsprgStats()
Definition: ttquanti.h:281
static string int2str(const int i)
Writes an integer value into a string.
Definition: tstring.h:95
unsigned int _nb_trait
Definition: ttquanti.h:238
void addEigen(age_t AGE)
Definition: ttquanti.cc:1396
virtual StatRecorder< TTQuantiSH > * add(std::string Title, std::string Name, age_t AGE, unsigned int ARG1, unsigned int ARG2, double(TTQuantiSH::*getStatNoArg)(void), double(TTQuantiSH::*getStatOneArg)(unsigned int), double(TTQuantiSH::*getStatTwoArg)(unsigned int, unsigned int), void(TTQuantiSH::*setStat)(void))
Adds a StatRecorder to the list, it is also added to the StatHandlerBase::_stats list.
Definition: stathandler.h:144
#define ALL
All ages age class flag.
Definition: types.h:56
void setAdultStats()
Definition: ttquanti.h:280
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
double getEigenValue(unsigned int i)
Definition: ttquanti.h:289
void TTQuantiSH::addEigenValuesPerPatch ( age_t  AGE)

References _nb_trait, StatHandlerBase::_pop, StatHandler< TTQuantiSH >::add(), addEigenPerPatch(), ADULTS, ALL, getEigenValuePerPatch(), Metapop::getPatchNbr(), tstring::int2str(), OFFSPRG, setAdultStats(), setOffsprgStats(), and warning().

Referenced by setStatRecorders().

1667 {
1668  if(_nb_trait < 2) {
1669  warning("not recording G-matrix eigen stats with only one \"quanti\" trait!\n");
1670  return;
1671  }
1672 
1673  if (AGE == ALL) {
1676  return;
1677  }
1678 
1679  unsigned int patchNbr = _pop->getPatchNbr();
1680  string suffix = (AGE == ADULTS ? "adlt.":"off.");
1681  string patch;
1682 
1683  void (TTQuantiSH::* setter) (void) = (AGE == ADULTS ?
1685 
1686  add("First G-matrix eigenvalue in patch 1", suffix + "qeval1.p1", AGE, 0, 0, 0, 0,
1688 
1689  for(unsigned int p = 0; p < patchNbr; ++p) {
1690  patch = ".p" + tstring::int2str(p+1);
1691  for(unsigned int t = 0; t < _nb_trait; ++t) {
1692  if(p==0 && t==0) continue;
1693  add("", suffix + "qeval" + tstring::int2str(t+1) + patch, AGE, t, p, 0, 0, &TTQuantiSH::getEigenValuePerPatch,0);
1694  }
1695  }
1696 }
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:54
TTQuantiSH.
Definition: ttquanti.h:233
unsigned int getPatchNbr()
Definition: metapop.h:270
void warning(const char *str,...)
Definition: output.cc:56
void setOffsprgStats()
Definition: ttquanti.h:281
static string int2str(const int i)
Writes an integer value into a string.
Definition: tstring.h:95
void addEigenPerPatch(age_t AGE)
Definition: ttquanti.cc:1622
unsigned int _nb_trait
Definition: ttquanti.h:238
virtual StatRecorder< TTQuantiSH > * add(std::string Title, std::string Name, age_t AGE, unsigned int ARG1, unsigned int ARG2, double(TTQuantiSH::*getStatNoArg)(void), double(TTQuantiSH::*getStatOneArg)(unsigned int), double(TTQuantiSH::*getStatTwoArg)(unsigned int, unsigned int), void(TTQuantiSH::*setStat)(void))
Adds a StatRecorder to the list, it is also added to the StatHandlerBase::_stats list.
Definition: stathandler.h:144
#define ALL
All ages age class flag.
Definition: types.h:56
void setAdultStats()
Definition: ttquanti.h:280
Metapop * _pop
Link to the current population, set through the link to the StatService.
Definition: stathandler.h:61
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
double getEigenValuePerPatch(unsigned int i, unsigned int p)
Definition: ttquanti.h:295
void TTQuantiSH::addEigenVect1 ( age_t  AGE)

References _nb_trait, StatHandler< TTQuantiSH >::add(), addEigen(), ADULTS, ALL, getEigenVectorElt(), tstring::int2str(), OFFSPRG, setAdultStats(), setOffsprgStats(), and warning().

Referenced by setStatRecorders().

1456 {
1457  if(_nb_trait < 2) {
1458  warning("not recording G-matrix eigen stats with only one \"quanti\" trait!\n");
1459  return;
1460  }
1461 
1462  if (AGE == ALL) {
1463  addEigen(ADULTS);
1464  addEigen(OFFSPRG);
1465  return;
1466  }
1467 
1468  string suffix = (AGE == ADULTS ? "adlt.":"off.");
1469 
1470  void (TTQuantiSH::* setter) (void) = (AGE == ADULTS ?
1472 
1473  add("", suffix + "q.evect11",AGE,0,0,0,0,&TTQuantiSH::getEigenVectorElt,setter);
1474 
1475  for(unsigned int v = 1; v < _nb_trait; ++v)
1476  add("", suffix + "q.evect1" + tstring::int2str(v+1),AGE,0,v,0,0,&TTQuantiSH::getEigenVectorElt,0);
1477 
1478 }
double getEigenVectorElt(unsigned int t1, unsigned int t2)
Definition: ttquanti.h:290
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:54
TTQuantiSH.
Definition: ttquanti.h:233
void warning(const char *str,...)
Definition: output.cc:56
void setOffsprgStats()
Definition: ttquanti.h:281
static string int2str(const int i)
Writes an integer value into a string.
Definition: tstring.h:95
unsigned int _nb_trait
Definition: ttquanti.h:238
void addEigen(age_t AGE)
Definition: ttquanti.cc:1396
virtual StatRecorder< TTQuantiSH > * add(std::string Title, std::string Name, age_t AGE, unsigned int ARG1, unsigned int ARG2, double(TTQuantiSH::*getStatNoArg)(void), double(TTQuantiSH::*getStatOneArg)(unsigned int), double(TTQuantiSH::*getStatTwoArg)(unsigned int, unsigned int), void(TTQuantiSH::*setStat)(void))
Adds a StatRecorder to the list, it is also added to the StatHandlerBase::_stats list.
Definition: stathandler.h:144
#define ALL
All ages age class flag.
Definition: types.h:56
void setAdultStats()
Definition: ttquanti.h:280
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
void TTQuantiSH::addEigenVect1PerPatch ( age_t  AGE)

References _nb_trait, StatHandlerBase::_pop, StatHandler< TTQuantiSH >::add(), addEigenPerPatch(), ADULTS, ALL, getEigenVectorEltPerPatch(), Metapop::getPatchNbr(), tstring::int2str(), OFFSPRG, setAdultStats(), setOffsprgStats(), and warning().

Referenced by setStatRecorders().

1701 {
1702  if(_nb_trait < 2) {
1703  warning("not recording G-matrix eigen stats with only one \"quanti\" trait!\n");
1704  return;
1705  }
1706 
1707  if (AGE == ALL) {
1710  return;
1711  }
1712 
1713  unsigned int patchNbr = _pop->getPatchNbr();
1714  string suffix = (AGE == ADULTS ? "adlt.":"off.");
1715  string patch;
1716  unsigned int pv =0;
1717 
1718  void (TTQuantiSH::* setter) (void) = (AGE == ADULTS ?
1721 
1722 
1723  add("First G-matrix eigenvector in patch 1", suffix + "qevect11.p1", AGE, 0, 0, 0, 0,
1725 
1726  for(unsigned int p = 0; p < patchNbr; ++p) {
1727  patch = ".p" + tstring::int2str(p+1);
1728  pv = 0;
1729  // for(unsigned int t = 0; t < _nb_trait; ++t)
1730  for(unsigned int v = 0; v < _nb_trait; ++v){
1731  if(p==0 && v==0) {pv++; continue;}
1732  add("", suffix + "qevect1" + tstring::int2str(v+1) + patch, AGE, p, pv++, 0, 0, &TTQuantiSH::getEigenVectorEltPerPatch,0);
1733  }
1734  }
1735 }
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:54
TTQuantiSH.
Definition: ttquanti.h:233
double getEigenVectorEltPerPatch(unsigned int p, unsigned int v)
Definition: ttquanti.h:297
unsigned int getPatchNbr()
Definition: metapop.h:270
void warning(const char *str,...)
Definition: output.cc:56
void setOffsprgStats()
Definition: ttquanti.h:281
static string int2str(const int i)
Writes an integer value into a string.
Definition: tstring.h:95
void addEigenPerPatch(age_t AGE)
Definition: ttquanti.cc:1622
unsigned int _nb_trait
Definition: ttquanti.h:238
virtual StatRecorder< TTQuantiSH > * add(std::string Title, std::string Name, age_t AGE, unsigned int ARG1, unsigned int ARG2, double(TTQuantiSH::*getStatNoArg)(void), double(TTQuantiSH::*getStatOneArg)(unsigned int), double(TTQuantiSH::*getStatTwoArg)(unsigned int, unsigned int), void(TTQuantiSH::*setStat)(void))
Adds a StatRecorder to the list, it is also added to the StatHandlerBase::_stats list.
Definition: stathandler.h:144
#define ALL
All ages age class flag.
Definition: types.h:56
void setAdultStats()
Definition: ttquanti.h:280
Metapop * _pop
Link to the current population, set through the link to the StatService.
Definition: stathandler.h:61
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
void TTQuantiSH::addQuanti ( age_t  AGE)

References _eVar, _nb_trait, StatHandler< TTQuantiSH >::add(), ADULTS, ALL, getCovar(), getMeanPhenot(), getQst(), getVa(), getVb(), getVp(), tstring::int2str(), OFFSPRG, setAdultStats(), and setOffsprgStats().

Referenced by setStatRecorders().

1337 {
1338  if (AGE == ALL) {
1339  addQuanti(ADULTS);
1340  addQuanti(OFFSPRG);
1341  return;
1342  }
1343 
1344  string suffix = (AGE == ADULTS ? "adlt.":"off.");
1345  string name = suffix + "q";
1346  string t1, t2;
1347 
1348  void (TTQuantiSH::* setter) (void) = (AGE == ADULTS ?
1350 
1351  add("",suffix + "q1",AGE,0,0,0,&TTQuantiSH::getMeanPhenot,0,setter);
1352 
1353  for(unsigned int i = 1; i < _nb_trait; i++) {
1354  t1 = tstring::int2str(i+1);
1355  add("", name + t1,AGE,i,0,0,&TTQuantiSH::getMeanPhenot,0,0);
1356  }
1357 
1358  //Va
1359  for(unsigned int i = 0; i < _nb_trait; i++) {
1360  t1 = tstring::int2str(i+1);
1361  add("", name + t1 +".Va",AGE,i,0,0,&TTQuantiSH::getVa,0,0);
1362  }
1363 
1364  //Vb
1365  for(unsigned int i = 0; i < _nb_trait; i++) {
1366  t1 = tstring::int2str(i+1);
1367  add("", name + t1 +".Vb",AGE,i,0,0,&TTQuantiSH::getVb,0,0);
1368  }
1369 
1370  //Vp
1371  if(_eVar) {
1372  for(unsigned int i = 0; i < _nb_trait; i++) {
1373  t1 = tstring::int2str(i+1);
1374  add("", name + t1 +".Vp",AGE,i,0,0,&TTQuantiSH::getVp,0,0);
1375  }
1376  }
1377  //Qst
1378  for(unsigned int i = 0; i < _nb_trait; i++) {
1379  t1 = tstring::int2str(i+1);
1380  add("", name + t1 +".Qst",AGE,i,0,0,&TTQuantiSH::getQst,0,0);
1381  }
1382 
1383  if (_nb_trait > 1) {
1384  unsigned int c = 0;
1385  for(unsigned int t = 0; t < _nb_trait; ++t) {
1386  for(unsigned int v = t + 1, cov = (t+1)*10+(v+1) ; v < _nb_trait; ++v) {
1387  t1 = tstring::int2str(cov);
1388  add("", name + t1 +".cov",AGE,c++,0,0,&TTQuantiSH::getCovar,0,0);
1389  }
1390  }
1391  }
1392 }
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:54
double getCovar(unsigned int i)
Definition: ttquanti.h:288
TTQuantiSH.
Definition: ttquanti.h:233
double getQst(unsigned int i)
Definition: ttquanti.h:287
double getVb(unsigned int i)
Definition: ttquanti.h:285
double getVa(unsigned int i)
Definition: ttquanti.h:284
void setOffsprgStats()
Definition: ttquanti.h:281
double getMeanPhenot(unsigned int i)
Definition: ttquanti.h:283
static string int2str(const int i)
Writes an integer value into a string.
Definition: tstring.h:95
unsigned int _nb_trait
Definition: ttquanti.h:238
virtual StatRecorder< TTQuantiSH > * add(std::string Title, std::string Name, age_t AGE, unsigned int ARG1, unsigned int ARG2, double(TTQuantiSH::*getStatNoArg)(void), double(TTQuantiSH::*getStatOneArg)(unsigned int), double(TTQuantiSH::*getStatTwoArg)(unsigned int, unsigned int), void(TTQuantiSH::*setStat)(void))
Adds a StatRecorder to the list, it is also added to the StatHandlerBase::_stats list.
Definition: stathandler.h:144
#define ALL
All ages age class flag.
Definition: types.h:56
void addQuanti(age_t AGE)
Definition: ttquanti.cc:1336
void setAdultStats()
Definition: ttquanti.h:280
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
double getVp(unsigned int i)
Definition: ttquanti.h:286
bool _eVar
Definition: ttquanti.h:239
void TTQuantiSH::addQuantiPerPatch ( age_t  AGE)

References addAvgPerPatch(), addCovarPerPatch(), addEigenPerPatch(), addVarPerPatch(), ADULTS, ALL, and OFFSPRG.

Referenced by setStatRecorders().

1483 {
1484 
1485  if (AGE == ALL) {
1488  return;
1489  }
1490 
1491  addAvgPerPatch(AGE);
1492  addVarPerPatch(AGE);
1493  addCovarPerPatch(AGE);
1494  addEigenPerPatch(AGE);
1495 
1496 }
void addAvgPerPatch(age_t AGE)
Definition: ttquanti.cc:1500
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:54
void addQuantiPerPatch(age_t AGE)
Definition: ttquanti.cc:1482
void addVarPerPatch(age_t AGE)
Definition: ttquanti.cc:1535
void addEigenPerPatch(age_t AGE)
Definition: ttquanti.cc:1622
#define ALL
All ages age class flag.
Definition: types.h:56
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
void addCovarPerPatch(age_t AGE)
Definition: ttquanti.cc:1581
void TTQuantiSH::addSkewPerPatch ( age_t  AGE)

References _nb_trait, StatHandlerBase::_pop, StatHandler< TTQuantiSH >::add(), ADULTS, ALL, Metapop::getPatchNbr(), getSkewPerPatch(), tstring::int2str(), OFFSPRG, setAdultStats(), and setOffsprgStats().

Referenced by setStatRecorders().

1740 {
1741  if (AGE == ALL) {
1744  return;
1745  }
1746 
1747  unsigned int patchNbr = _pop->getPatchNbr();
1748 
1749  string suffix = (AGE == ADULTS ? "adlt.":"off.");
1750  string name;
1751  string patch;
1752  string t1;
1753 
1754  void (TTQuantiSH::* setter) (void) = (AGE == ADULTS ?
1757 
1758  add("Genetic skew of trait 1 in patch 1", suffix + "Sk.q1.p1", AGE, 0, 0, 0, 0,
1759  &TTQuantiSH::getSkewPerPatch, setter);
1760 
1761  for(unsigned int p = 0; p < patchNbr; p++) {
1762  for(unsigned int i = 0; i < _nb_trait; i++) {
1763  if(p == 0 && i == 0) continue;
1764  name = "Genetic skew of trait " + tstring::int2str(i+1) + " in patch " + tstring::int2str(p+1);
1765  t1 = "q" + tstring::int2str(i+1);
1766  patch = ".p" + tstring::int2str(p+1);
1767  add(name, suffix + "Sk." + t1 + patch, AGE, i, p, 0, 0, &TTQuantiSH::getSkewPerPatch, 0);
1768  }
1769  }
1770 
1771 }
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:54
TTQuantiSH.
Definition: ttquanti.h:233
void addSkewPerPatch(age_t AGE)
Definition: ttquanti.cc:1739
unsigned int getPatchNbr()
Definition: metapop.h:270
void setOffsprgStats()
Definition: ttquanti.h:281
static string int2str(const int i)
Writes an integer value into a string.
Definition: tstring.h:95
unsigned int _nb_trait
Definition: ttquanti.h:238
virtual StatRecorder< TTQuantiSH > * add(std::string Title, std::string Name, age_t AGE, unsigned int ARG1, unsigned int ARG2, double(TTQuantiSH::*getStatNoArg)(void), double(TTQuantiSH::*getStatOneArg)(unsigned int), double(TTQuantiSH::*getStatTwoArg)(unsigned int, unsigned int), void(TTQuantiSH::*setStat)(void))
Adds a StatRecorder to the list, it is also added to the StatHandlerBase::_stats list.
Definition: stathandler.h:144
#define ALL
All ages age class flag.
Definition: types.h:56
void setAdultStats()
Definition: ttquanti.h:280
Metapop * _pop
Link to the current population, set through the link to the StatService.
Definition: stathandler.h:61
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
double getSkewPerPatch(unsigned int i, unsigned int p)
Definition: ttquanti.cc:1775
void TTQuantiSH::addVarPerPatch ( age_t  AGE)

References _eVar, _nb_trait, StatHandlerBase::_pop, StatHandler< TTQuantiSH >::add(), ADULTS, ALL, Metapop::getPatchNbr(), getVaPerPatch(), getVpPerPatch(), tstring::int2str(), OFFSPRG, setAdultStats(), and setOffsprgStats().

Referenced by addQuantiPerPatch(), and setStatRecorders().

1536 {
1537  if (AGE == ALL) {
1540  return;
1541  }
1542 
1543  unsigned int patchNbr = _pop->getPatchNbr();
1544 
1545  string suffix = (AGE == ADULTS ? "adlt.":"off.");
1546  string name;
1547  string patch;
1548  string t1;
1549 
1550  void (TTQuantiSH::* setter) (void) = (AGE == ADULTS ?
1553 
1554  add("Genetic variance of trait 1 in patch 1", suffix + "Va.q1.p1", AGE, 0, 0, 0, 0,
1555  &TTQuantiSH::getVaPerPatch, setter);
1556 
1557  for(unsigned int p = 0; p < patchNbr; p++) {
1558  for(unsigned int i = 0; i < _nb_trait; i++) {
1559  if(p == 0 && i == 0) continue;
1560  name = "Genetic variance of trait " + tstring::int2str(i+1) + " in patch " + tstring::int2str(p+1);
1561  t1 = "q" + tstring::int2str(i+1);
1562  patch = ".p" + tstring::int2str(p+1);
1563  add(name, suffix + "Va." + t1 + patch, AGE, i, p, 0, 0, &TTQuantiSH::getVaPerPatch, 0);
1564  }
1565  }
1566 
1567  if(_eVar) {
1568  for(unsigned int p = 0; p < patchNbr; p++) {
1569  for(unsigned int i = 0; i < _nb_trait; i++) {
1570  name = "Phenotypic variance of trait " + tstring::int2str(i+1) + " in patch " + tstring::int2str(p+1);
1571  t1 = "q" + tstring::int2str(i+1);
1572  patch = ".p" + tstring::int2str(p+1);
1573  add(name, suffix + "Vp." + t1 + patch, AGE, i, p, 0, 0, &TTQuantiSH::getVpPerPatch, 0);
1574  }
1575  }
1576  }
1577 }
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:54
TTQuantiSH.
Definition: ttquanti.h:233
void addVarPerPatch(age_t AGE)
Definition: ttquanti.cc:1535
unsigned int getPatchNbr()
Definition: metapop.h:270
double getVaPerPatch(unsigned int i, unsigned int p)
Definition: ttquanti.h:293
void setOffsprgStats()
Definition: ttquanti.h:281
static string int2str(const int i)
Writes an integer value into a string.
Definition: tstring.h:95
double getVpPerPatch(unsigned int i, unsigned int p)
Definition: ttquanti.h:294
unsigned int _nb_trait
Definition: ttquanti.h:238
virtual StatRecorder< TTQuantiSH > * add(std::string Title, std::string Name, age_t AGE, unsigned int ARG1, unsigned int ARG2, double(TTQuantiSH::*getStatNoArg)(void), double(TTQuantiSH::*getStatOneArg)(unsigned int), double(TTQuantiSH::*getStatTwoArg)(unsigned int, unsigned int), void(TTQuantiSH::*setStat)(void))
Adds a StatRecorder to the list, it is also added to the StatHandlerBase::_stats list.
Definition: stathandler.h:144
#define ALL
All ages age class flag.
Definition: types.h:56
void setAdultStats()
Definition: ttquanti.h:280
Metapop * _pop
Link to the current population, set through the link to the StatService.
Definition: stathandler.h:61
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
bool _eVar
Definition: ttquanti.h:239
double TTQuantiSH::getCovar ( unsigned int  i)
inline

Referenced by addQuanti().

288 {return _covar[i];}
double * _covar
Definition: ttquanti.h:235
double TTQuantiSH::getCovarPerPatch ( unsigned int  p,
unsigned int  i 
)
inline

Referenced by addCovarPerPatch().

296 {return _pcovar[p][i];}
double ** _pcovar
Definition: ttquanti.h:236
double TTQuantiSH::getEigenValue ( unsigned int  i)
inline

Referenced by addEigen(), and addEigenValues().

289 {return _eigval[i];}
double * _eigval
Definition: ttquanti.h:235
double TTQuantiSH::getEigenValuePerPatch ( unsigned int  i,
unsigned int  p 
)
inline

Referenced by addEigenPerPatch(), and addEigenValuesPerPatch().

295 {return _peigval[i][p];}
double ** _peigval
Definition: ttquanti.h:236
double TTQuantiSH::getEigenVectorElt ( unsigned int  t1,
unsigned int  t2 
)
inline

Referenced by addEigen(), and addEigenVect1().

290 {return _eigvect[t2][t1];}//eigenvectors arranged column-wise
double ** _eigvect
Definition: ttquanti.h:235
double TTQuantiSH::getEigenVectorEltPerPatch ( unsigned int  p,
unsigned int  v 
)
inline

Referenced by addEigenPerPatch(), and addEigenVect1PerPatch().

297 {return _peigvect[p][v];}
double ** _peigvect
Definition: ttquanti.h:236
double TTQuantiSH::getMeanPhenot ( unsigned int  i)
inline

Referenced by addQuanti().

283 {return _meanP[i];}
double * _meanP
Definition: ttquanti.h:235
double TTQuantiSH::getMeanPhenotPerPatch ( unsigned int  i,
unsigned int  p 
)
inline

Referenced by addAvgPerPatch().

292 {return _pmeanP[i][p];}
double ** _pmeanP
Definition: ttquanti.h:236
double TTQuantiSH::getQst ( unsigned int  i)
inline

Referenced by addQuanti().

287 {return _Vb[i]/(_Vb[i]+2*_Va[i]);}
double * _Va
Definition: ttquanti.h:235
double * _Vb
Definition: ttquanti.h:235
double TTQuantiSH::getSkewPerPatch ( unsigned int  i,
unsigned int  p 
)

References _phenoTable, _pmeanP, DataTable< T >::getClassWithinGroup(), and DataTable< T >::size().

Referenced by addSkewPerPatch().

1776 {
1777  double skew = 0;
1778 
1779  double *phenot = _phenoTable.getClassWithinGroup(i, p);
1780  unsigned int patch_size = _phenoTable.size(i, p);
1781 
1782  for(unsigned int k = 0; k < patch_size; ++k)
1783  skew += pow( phenot[k] - _pmeanP[i][p], 3); //the mean has been set by setStats()
1784 
1785  return skew / patch_size;
1786 }
unsigned int size(unsigned int i, unsigned int j)
Definition: datatable.h:260
DataTable< double > _phenoTable
Definition: ttquanti.h:245
T * getClassWithinGroup(unsigned int group, unsigned int Class)
Accessor to a class array whithin a group.
Definition: datatable.h:225
double ** _pmeanP
Definition: ttquanti.h:236
double TTQuantiSH::getVa ( unsigned int  i)
inline

Referenced by addQuanti().

284 {return _Va[i];}
double * _Va
Definition: ttquanti.h:235
double TTQuantiSH::getVaPerPatch ( unsigned int  i,
unsigned int  p 
)
inline

Referenced by addVarPerPatch().

293 {return _pVa[i][p];}
double ** _pVa
Definition: ttquanti.h:236
double TTQuantiSH::getVb ( unsigned int  i)
inline

Referenced by addQuanti().

285 {return _Vb[i];}
double * _Vb
Definition: ttquanti.h:235
double TTQuantiSH::getVp ( unsigned int  i)
inline

Referenced by addQuanti().

286 {return _Vp[i];}
double * _Vp
Definition: ttquanti.h:235
double TTQuantiSH::getVpPerPatch ( unsigned int  i,
unsigned int  p 
)
inline

Referenced by addVarPerPatch().

294 {return _pVp[i][p];}
double ** _pVp
Definition: ttquanti.h:236
void TTQuantiSH::init ( )
virtual

Reimplemented from StatHandlerBase.

References _covar, _eigval, _eigvect, _eval, _eVar, _evec, _G, _meanG, _meanP, _nb_trait, _patchNbr, _pcovar, _peigval, _peigvect, _pmeanG, _pmeanP, StatHandlerBase::_pop, _pVa, _pVp, TraitStatHandler< TProtoQuanti, TTQuantiSH >::_SHLinkedTrait, _Va, _Vb, _Vp, _ws, TProtoQuanti::get_env_var(), TProtoQuanti::get_nb_traits(), Metapop::getPatchNbr(), StatHandlerBase::init(), and resetPtrs().

1213 {
1215 
1216  _eVar = (_SHLinkedTrait->get_env_var() != 0);
1217 
1218  resetPtrs(); //deallocate anything that was previously allocated
1219 
1220  if(_patchNbr != _pop->getPatchNbr())
1221  _patchNbr = _pop->getPatchNbr();
1222 
1225 
1226  _G = gsl_matrix_alloc(_nb_trait,_nb_trait);
1227  _eval = gsl_vector_alloc (_nb_trait);
1228  _evec = gsl_matrix_alloc (_nb_trait, _nb_trait);
1229  _ws = gsl_eigen_symmv_alloc (_nb_trait);
1230 
1231  _meanP = new double [_nb_trait];
1232  _meanG = new double [_nb_trait];
1233  _Va = new double [_nb_trait];
1234  _Vb = new double [_nb_trait];
1235  _Vp = new double [_nb_trait];
1236  _eigval = new double [_nb_trait];
1237 
1238  _eigvect = new double* [_nb_trait];
1239  _pVa = new double* [_nb_trait];
1240  _pVp = new double* [_nb_trait];
1241  _pmeanP = new double* [_nb_trait];
1242  _pmeanG = new double* [_nb_trait];
1243  _peigval = new double* [_nb_trait];
1244 
1245  for(unsigned int i=0; i < _nb_trait; ++i) {
1246 
1247  _eigvect[i] = new double [_nb_trait];
1248 
1249  _pVa[i] = new double [_patchNbr];
1250  _pVp[i] = new double [_patchNbr];
1251  _pmeanP[i] = new double [_patchNbr];
1252  _pmeanG[i] = new double [_patchNbr];
1253  _peigval[i] = new double [_patchNbr];
1254 
1255  }
1256 
1257  _peigvect = new double* [_patchNbr];
1258  for(unsigned int i = 0; i < _patchNbr; i++)
1259  _peigvect[i] = new double [_nb_trait*_nb_trait];
1260 
1261 
1262  if(_nb_trait > 1) {
1263 
1264  _covar = new double [_nb_trait*(_nb_trait -1)/2];
1265 
1266  _pcovar = new double* [_patchNbr];
1267 
1268  for(unsigned int i = 0; i < _patchNbr; i++)
1269  _pcovar[i] = new double [_nb_trait*(_nb_trait - 1)/2];
1270 
1271  }
1272 
1273 }
double ** _pVa
Definition: ttquanti.h:236
double ** _pcovar
Definition: ttquanti.h:236
double * _Va
Definition: ttquanti.h:235
void resetPtrs()
Definition: ttquanti.cc:1156
unsigned int get_nb_traits()
Definition: ttquanti.h:155
TProtoQuanti * _SHLinkedTrait
Pointer to a TraitProtoype object.
Definition: stathandler.h:171
double * _Vp
Definition: ttquanti.h:235
gsl_matrix * _G
Definition: ttquanti.h:241
gsl_matrix * _evec
Definition: ttquanti.h:241
double * _meanP
Definition: ttquanti.h:235
unsigned int getPatchNbr()
Definition: metapop.h:270
double get_env_var()
Definition: ttquanti.h:158
double ** _pVp
Definition: ttquanti.h:236
double ** _pmeanG
Definition: ttquanti.h:236
double ** _eigvect
Definition: ttquanti.h:235
double * _meanG
Definition: ttquanti.h:235
double * _eigval
Definition: ttquanti.h:235
virtual void init()
Definition: stathandler.cc:39
unsigned int _nb_trait
Definition: ttquanti.h:238
unsigned int _patchNbr
Definition: ttquanti.h:238
Metapop * _pop
Link to the current population, set through the link to the StatService.
Definition: stathandler.h:61
double * _Vb
Definition: ttquanti.h:235
gsl_vector * _eval
Definition: ttquanti.h:242
double ** _peigval
Definition: ttquanti.h:236
double ** _pmeanP
Definition: ttquanti.h:236
bool _eVar
Definition: ttquanti.h:239
double ** _peigvect
Definition: ttquanti.h:236
gsl_eigen_symmv_workspace * _ws
Definition: ttquanti.h:243
double * _covar
Definition: ttquanti.h:235
void TTQuantiSH::resetPtrs ( )

References _covar, _eigval, _eigvect, _eval, _evec, _G, _meanG, _meanP, _nb_trait, _patchNbr, _pcovar, _peigval, _peigvect, _pmeanG, _pmeanP, _pVa, _pVp, _Va, _Vb, _Vp, and _ws.

Referenced by init(), and ~TTQuantiSH().

1157 {
1158 
1159  if(_G != NULL) gsl_matrix_free(_G);
1160  if(_eval != NULL) gsl_vector_free(_eval);
1161  if(_evec != NULL) gsl_matrix_free(_evec);
1162  if(_ws != NULL) gsl_eigen_symmv_free (_ws);
1163 
1164  if(_meanP != NULL) delete [] _meanP;
1165  if(_meanG != NULL) delete [] _meanG;
1166  if(_Va != NULL) delete [] _Va;
1167  if(_Vb != NULL) delete [] _Vb;
1168  if(_Vp != NULL) delete [] _Vp;
1169  if(_covar != NULL) delete [] _covar;
1170  if(_eigval != NULL) delete [] _eigval;
1171 
1172 
1173  if(_eigvect) {
1174  for(unsigned int i=0; i < _nb_trait; ++i) delete [] _eigvect[i];
1175  delete [] _eigvect;
1176  }
1177  if(_pVa) {
1178  for(unsigned int i=0; i < _nb_trait; ++i) delete [] _pVa[i];
1179  delete [] _pVa;
1180  }
1181  if(_pVp) {
1182  for(unsigned int i=0; i < _nb_trait; ++i) delete [] _pVp[i];
1183  delete [] _pVp;
1184  }
1185  if(_pmeanP) {
1186  for(unsigned int i=0; i < _nb_trait; ++i) delete [] _pmeanP[i];
1187  delete [] _pmeanP;
1188  }
1189  if(_pmeanG) {
1190  for(unsigned int i=0; i < _nb_trait; ++i) delete [] _pmeanG[i];
1191  delete [] _pmeanG;
1192  }
1193  if(_peigval) {
1194  for(unsigned int i=0; i < _nb_trait; ++i) delete [] _peigval[i];
1195  delete [] _peigval;
1196  }
1197 
1198  if(_pcovar != NULL) {
1199  for(unsigned int i = 0; i < _patchNbr; i++) delete [] _pcovar[i];
1200  delete [] _pcovar;
1201  }
1202 
1203  if(_peigvect != NULL) {
1204  for(unsigned int i = 0; i < _patchNbr; i++) delete [] _peigvect[i];
1205  delete [] _peigvect;
1206  }
1207 
1208 }
double ** _pVa
Definition: ttquanti.h:236
double ** _pcovar
Definition: ttquanti.h:236
double * _Va
Definition: ttquanti.h:235
double * _Vp
Definition: ttquanti.h:235
gsl_matrix * _G
Definition: ttquanti.h:241
gsl_matrix * _evec
Definition: ttquanti.h:241
double * _meanP
Definition: ttquanti.h:235
double ** _pVp
Definition: ttquanti.h:236
double ** _pmeanG
Definition: ttquanti.h:236
double ** _eigvect
Definition: ttquanti.h:235
double * _meanG
Definition: ttquanti.h:235
double * _eigval
Definition: ttquanti.h:235
unsigned int _nb_trait
Definition: ttquanti.h:238
unsigned int _patchNbr
Definition: ttquanti.h:238
double * _Vb
Definition: ttquanti.h:235
gsl_vector * _eval
Definition: ttquanti.h:242
double ** _peigval
Definition: ttquanti.h:236
double ** _pmeanP
Definition: ttquanti.h:236
double ** _peigvect
Definition: ttquanti.h:236
gsl_eigen_symmv_workspace * _ws
Definition: ttquanti.h:243
double * _covar
Definition: ttquanti.h:235
void TTQuantiSH::setAdultStats ( )
inline

References ADULTS, and setStats().

Referenced by addAvgPerPatch(), addCovarPerPatch(), addEigen(), addEigenPerPatch(), addEigenValues(), addEigenValuesPerPatch(), addEigenVect1(), addEigenVect1PerPatch(), addQuanti(), addSkewPerPatch(), and addVarPerPatch().

280 {setStats(ADULTS);}
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:54
void setStats(age_t AGE)
Definition: ttquanti.cc:1860
void TTQuantiSH::setDataTables ( age_t  AGE)

References _genoTable, _nb_trait, _phenoTable, StatHandlerBase::_pop, TraitStatHandler< TProtoQuanti, TTQuantiSH >::_SHLinkedTraitIndex, ADLTx, ADULTS, fatal(), FEM, Metapop::getPatch(), Metapop::getPatchNbr(), MAL, OFFSx, DataTable< T >::size(), Metapop::size(), Patch::size(), store_quanti_trait_values(), and DataTable< T >::update().

Referenced by setStats().

1791 {
1792  unsigned int **sizes;
1793  unsigned int nb_patch = _pop->getPatchNbr();
1794 
1795  sizes = new unsigned int * [_nb_trait];
1796 
1797  for(unsigned int i = 0; i < _nb_trait; ++i) {
1798  sizes[i] = new unsigned int [nb_patch];
1799  for(unsigned int j = 0; j < nb_patch; ++j)
1800  sizes[i][j] = _pop->size(AGE, j);
1801  }
1802 
1803  _phenoTable.update(_nb_trait, nb_patch, sizes);
1804  _genoTable.update(_nb_trait, nb_patch, sizes);
1805 
1806  for(unsigned int i = 0; i < _nb_trait; ++i)
1807  delete [] sizes[i];
1808  delete [] sizes;
1809 
1810  Patch* patch;
1811  age_idx age = (AGE == ADULTS ? ADLTx : OFFSx);
1812 
1813  for(unsigned int i = 0, n; i < nb_patch; i++) {
1814 
1815  patch = _pop->getPatch(i);
1816 
1817  n=0;
1818 
1819  if ((patch->size(MAL, age)+patch->size(FEM, age)) != _phenoTable.size(0,i)) {
1820  fatal("problem while recording quanti trait values; table size doesn't match patch size.\n");
1821  }
1822  store_quanti_trait_values(patch, i, patch->size(MAL, age), &n, MAL, age, &_phenoTable, &_genoTable,
1824 
1825  store_quanti_trait_values(patch, i, patch->size(FEM, age), &n, FEM, age, &_phenoTable, &_genoTable,
1827 
1828  if (n != _phenoTable.size(0,i) || n != _genoTable.size(0,i)) {
1829  fatal("problem while recording quanti trait values; size counter doesn't match table size.\n");
1830  }
1831  }
1832 }
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:54
age_idx
Array index of the age classes in the patch sizes and containers arrays.
Definition: types.h:41
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)
Definition: ttquanti.cc:1836
unsigned int size(age_t AGE)
Returns the size of the container of the appropriate age class(es) for both sexes.
Definition: metapop.h:487
DataTable< double > _genoTable
Definition: ttquanti.h:245
void fatal(const char *str,...)
Definition: output.cc:90
Second class in the metapopulation design structure, between the Metapop and Individual classes...
Definition: metapop.h:421
Patch * getPatch(unsigned int i)
Patch accessor, return the ith+1 patch in the metapop.
Definition: metapop.h:251
unsigned int getPatchNbr()
Definition: metapop.h:270
void update(unsigned int nbgroups, unsigned int nbclasses, unsigned int **classSizes)
Updates the group and classe sizes and re-allocates the table according to its new length...
Definition: datatable.h:154
int _SHLinkedTraitIndex
Index of the trait in the Individual::Traits table.
Definition: stathandler.h:173
Definition: types.h:42
unsigned int _nb_trait
Definition: ttquanti.h:238
unsigned int size(unsigned int i, unsigned int j)
Definition: datatable.h:260
Definition: types.h:37
Definition: types.h:42
Metapop * _pop
Link to the current population, set through the link to the StatService.
Definition: stathandler.h:61
DataTable< double > _phenoTable
Definition: ttquanti.h:245
unsigned int size()
Get the total number of individuals present in the population, all sex and age classes together...
Definition: metapop.h:302
Definition: types.h:37
void TTQuantiSH::setOffsprgStats ( )
inline

References OFFSPRG, and setStats().

Referenced by addAvgPerPatch(), addCovarPerPatch(), addEigen(), addEigenPerPatch(), addEigenValues(), addEigenValuesPerPatch(), addEigenVect1(), addEigenVect1PerPatch(), addQuanti(), addSkewPerPatch(), and addVarPerPatch().

281 {setStats(OFFSPRG);}
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
void setStats(age_t AGE)
Definition: ttquanti.cc:1860
bool TTQuantiSH::setStatRecorders ( std::string &  token)
virtual

!! attention, y a un prob ici quand pas de prefix d'age!!!!

Implements StatHandlerBase.

References addAvgPerPatch(), addCovarPerPatch(), addEigen(), addEigenPerPatch(), addEigenValues(), addEigenValuesPerPatch(), addEigenVect1(), addEigenVect1PerPatch(), addQuanti(), addQuantiPerPatch(), addSkewPerPatch(), addVarPerPatch(), ADULTS, ALL, message(), and OFFSPRG.

1278 {
1279 #ifdef _DEBUG_
1280  message("-TTQuantiSH::setStatRecorders ");
1281 #endif
1282  string age_tag = token.substr(0,token.find_first_of("."));
1283  string sub_token;
1284  age_t AGE = ALL;
1285 
1286  if (age_tag.size() != 0 && age_tag.size() != string::npos) {
1287 
1288  if (age_tag == "adlt") AGE = ADULTS;
1289 
1290  else if (age_tag == "off") AGE = OFFSPRG;
1291 
1292  else age_tag = "";
1293 
1294  } else {
1295  age_tag = "";
1296  }
1297 
1298  if (age_tag.size() != 0)
1299  sub_token = token.substr(token.find_first_of(".") + 1, string::npos);
1300  else
1301  sub_token = token;
1302 
1304 
1305  if(sub_token == "quanti") {
1306  addQuanti(AGE);
1307  } else if(sub_token == "quanti.eigen") { //based on Vb; among-patch (D) matrix
1308  addEigen(AGE);
1309  } else if(sub_token == "quanti.eigenvalues") { //based on Vb; among-patch (D) matrix
1310  addEigenValues(AGE);
1311  } else if(sub_token == "quanti.eigenvect1") { //based on Vb; among-patch (D) matrix
1312  addEigenVect1(AGE);
1313  } else if(sub_token == "quanti.patch") {
1314  addQuantiPerPatch(AGE);
1315  } else if(sub_token == "quanti.mean.patch") {
1316  addAvgPerPatch(AGE);
1317  } else if(sub_token == "quanti.var.patch") {
1318  addVarPerPatch(AGE);
1319  } else if(sub_token == "quanti.covar.patch") {
1320  addCovarPerPatch(AGE);
1321  } else if(sub_token == "quanti.eigen.patch") {
1322  addEigenPerPatch(AGE);
1323  } else if(sub_token == "quanti.eigenvalues.patch") {
1325  } else if(sub_token == "quanti.eigenvect1.patch") {
1326  addEigenVect1PerPatch(AGE);
1327  } else if(sub_token == "quanti.skew.patch") {
1328  addSkewPerPatch(AGE);
1329  } else
1330  return false;
1331 
1332  return true;
1333 }// ----------------------------------------------------------------------------------------
void addEigenValuesPerPatch(age_t AGE)
Definition: ttquanti.cc:1666
void addAvgPerPatch(age_t AGE)
Definition: ttquanti.cc:1500
void message(const char *message,...)
Definition: output.cc:40
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:54
void addEigenVect1PerPatch(age_t AGE)
Definition: ttquanti.cc:1700
unsigned int age_t
Age class flags.
Definition: types.h:46
void addSkewPerPatch(age_t AGE)
Definition: ttquanti.cc:1739
void addQuantiPerPatch(age_t AGE)
Definition: ttquanti.cc:1482
void addVarPerPatch(age_t AGE)
Definition: ttquanti.cc:1535
void addEigenPerPatch(age_t AGE)
Definition: ttquanti.cc:1622
void addEigen(age_t AGE)
Definition: ttquanti.cc:1396
#define ALL
All ages age class flag.
Definition: types.h:56
void addQuanti(age_t AGE)
Definition: ttquanti.cc:1336
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
void addEigenVect1(age_t AGE)
Definition: ttquanti.cc:1455
void addEigenValues(age_t AGE)
Definition: ttquanti.cc:1427
void addCovarPerPatch(age_t AGE)
Definition: ttquanti.cc:1581
void TTQuantiSH::setStats ( age_t  AGE)

References _covar, _eigval, _eigvect, _eval, _evec, _G, _genoTable, _meanG, _meanP, _nb_trait, _patchNbr, _pcovar, _peigval, _peigvect, _phenoTable, _pmeanG, _pmeanP, StatHandlerBase::_pop, _pVa, _pVp, _table_set_age, _table_set_gen, _table_set_repl, _Va, _Vb, _Vp, _ws, fatal(), DataTable< T >::getClassWithinGroup(), Metapop::getCurrentGeneration(), Metapop::getCurrentReplicate(), DataTable< T >::getGroup(), Metapop::getPatchNbr(), my_mean(), my_mean_no_nan(), my_variance_with_fixed_mean(), my_variance_with_fixed_mean_no_nan(), setDataTables(), Metapop::size(), and warning().

Referenced by setAdultStats(), and setOffsprgStats().

1861 {
1862  if(_table_set_age == AGE
1865  return;
1866 
1867  unsigned int pop_size = _pop->size(AGE);
1868  unsigned int patch_size;
1869  double *phenot1, *genot1, *genot2;
1870 
1871  unsigned int nb_patch = _pop->getPatchNbr();
1872 
1873  if(nb_patch < _patchNbr) {
1874  warning("increase in patch number detected (in Quanti Stat Handler),");
1875  warning("stats for quanti trait will not be recorded in new patches, patch identity may have changed.\n");
1876  _patchNbr = nb_patch; // record stat only in remaining patches
1877  }
1878 
1879  if(nb_patch > _patchNbr) nb_patch = _patchNbr; //tables have been allocated for _patchNbr patches
1880 
1881  setDataTables(AGE);
1882 
1883 #ifdef HAS_GSL
1884  unsigned int c = 0; //covariance position counter
1885  unsigned int pv = 0; //eigenvector position counter
1886  //within deme stats:
1887  for(unsigned int j = 0; j < nb_patch; j++) {
1888 
1889  patch_size = _pop->size(AGE, j);
1890 
1891  for(unsigned int t=0; t < _nb_trait; t++) {
1892 
1893  phenot1 = _phenoTable.getClassWithinGroup(t,j);
1894  genot1 = _genoTable.getClassWithinGroup(t,j);
1895 
1896  _pmeanP[t][j] = my_mean (phenot1, patch_size );
1897  _pmeanG[t][j] = my_mean (genot1, patch_size );
1898  _pVp[t][j] = my_variance_with_fixed_mean (phenot1, patch_size, _pmeanP[t][j]);
1899  _pVa[t][j] = my_variance_with_fixed_mean (genot1, patch_size, _pmeanG[t][j]);
1900 
1901  }
1902 
1903  if(_nb_trait > 1) {
1904  c = 0;
1905  // calculate the covariances and G, need to adjust dimensions in class declaration
1906  for(unsigned int t1 = 0; t1 < _nb_trait; t1++) {
1907  // set the diagonal elements of G here
1908 
1909  gsl_matrix_set(_G, t1, t1, _pVa[t1][j]);
1910 
1911  for(unsigned int t2 = t1 + 1; t2 < _nb_trait; t2++) {
1912 
1913  genot1 = _genoTable.getClassWithinGroup(t1,j);
1914  genot2 = _genoTable.getClassWithinGroup(t2,j);
1915 
1916  _pcovar[j][c] = gsl_stats_covariance_m (genot1, 1, genot2, 1, patch_size,
1917  _pmeanG[t1][j], _pmeanG[t2][j]);
1918 
1919  gsl_matrix_set(_G, t1, t2, _pcovar[j][c]);
1920  gsl_matrix_set(_G, t2, t1, _pcovar[j][c++]);
1921  }
1922  }
1923 
1924  gsl_eigen_symmv (_G, _eval, _evec, _ws);
1925  gsl_eigen_symmv_sort (_eval, _evec, GSL_EIGEN_SORT_VAL_DESC);
1926 
1927  pv = 0;
1928 
1929  for(unsigned int t = 0; t < _nb_trait; t++) {
1930  _peigval[t][j] = gsl_vector_get (_eval, t);
1931  for(unsigned int v = 0; v < _nb_trait; v++)
1932  _peigvect[j][pv++] = gsl_matrix_get (_evec, v, t); //read eigenvectors column-wise
1933  }
1934  }
1935  }
1936 
1937  double meanGamong1, meanGamong2;
1938  c = 0; //reset covariance positioner
1939  //among demes stats:
1940  for(unsigned int t1 = 0; t1 < _nb_trait; t1++) {
1941 
1942  phenot1 = _phenoTable.getGroup(t1);
1943  genot1 = _genoTable.getGroup(t1);
1944 
1945  _meanP[t1] = my_mean (phenot1, pop_size ); //grand mean, pooling all individuals
1946  _meanG[t1] = my_mean (genot1, pop_size ); //grand mean, pooling all individuals
1947 
1948  _Vp[t1] = my_mean_no_nan (_pVp[t1], nb_patch); //mean within patch variance
1949  _Va[t1] = my_mean_no_nan (_pVa[t1], nb_patch); //mean within patch variance
1950 
1951  meanGamong1 = my_mean_no_nan (_pmeanG[t1], nb_patch); //mean of within patch mean genotypic values
1952 
1953  _Vb[t1] = my_variance_with_fixed_mean_no_nan (_pmeanG[t1], nb_patch, meanGamong1); //variance of patch means
1954 
1955  gsl_matrix_set(_G, t1, t1, _Vb[t1]); //_G here becomes the D-matrix, the among-deme (Difference) covariance matrix
1956 
1957  for(unsigned int t2 = t1 + 1; t2 < _nb_trait; t2++) {
1958 
1959  meanGamong2 = my_mean (_pmeanG[t2], nb_patch);
1960 
1961  _covar[c] = gsl_stats_covariance_m (_pmeanG[t1], 1, _pmeanG[t2], 1, nb_patch, meanGamong1, meanGamong2); //covariance of patch means
1962 
1963  gsl_matrix_set(_G, t1, t2, _covar[c]);
1964  gsl_matrix_set(_G, t2, t1, _covar[c++]);
1965 
1966  }
1967  }
1968 
1969  if(_nb_trait > 1) {
1970  gsl_eigen_symmv (_G, _eval, _evec, _ws);
1971  gsl_eigen_symmv_sort (_eval, _evec, GSL_EIGEN_SORT_VAL_DESC);
1972 
1973  for(unsigned int t1 = 0; t1 < _nb_trait; t1++) {
1974  _eigval[t1] = gsl_vector_get (_eval, t1);
1975  for(unsigned int t2 = 0; t2 < _nb_trait; t2++) {
1976  _eigvect[t2][t1] = gsl_matrix_get (_evec, t2, t1);
1977  }
1978  }
1979  }
1980 
1981 #else
1982  fatal("install the GSL library to get the quanti stats!\n");
1983 #endif
1984 
1985  _table_set_age = AGE;
1988 
1989 }
double ** _pVa
Definition: ttquanti.h:236
double my_mean(double *data, unsigned int size)
Definition: utils.cc:37
double ** _pcovar
Definition: ttquanti.h:236
double * _Va
Definition: ttquanti.h:235
T * getGroup(unsigned int group)
Accessor to a group array.
Definition: datatable.h:223
DataTable< double > _genoTable
Definition: ttquanti.h:245
void setDataTables(age_t AGE)
Definition: ttquanti.cc:1790
unsigned int getCurrentGeneration()
Definition: metapop.h:286
double * _Vp
Definition: ttquanti.h:235
gsl_matrix * _G
Definition: ttquanti.h:241
gsl_matrix * _evec
Definition: ttquanti.h:241
double * _meanP
Definition: ttquanti.h:235
void fatal(const char *str,...)
Definition: output.cc:90
double my_variance_with_fixed_mean_no_nan(double *data, unsigned int size, double mean)
Definition: utils.cc:73
unsigned int getPatchNbr()
Definition: metapop.h:270
unsigned int getCurrentReplicate()
Definition: metapop.h:285
double ** _pVp
Definition: ttquanti.h:236
void warning(const char *str,...)
Definition: output.cc:56
double ** _pmeanG
Definition: ttquanti.h:236
double ** _eigvect
Definition: ttquanti.h:235
double * _meanG
Definition: ttquanti.h:235
double * _eigval
Definition: ttquanti.h:235
unsigned int _nb_trait
Definition: ttquanti.h:238
double my_variance_with_fixed_mean(double *data, unsigned int size, double mean)
Definition: utils.cc:62
unsigned int _patchNbr
Definition: ttquanti.h:238
Metapop * _pop
Link to the current population, set through the link to the StatService.
Definition: stathandler.h:61
unsigned int _table_set_repl
Definition: ttquanti.h:246
DataTable< double > _phenoTable
Definition: ttquanti.h:245
T * getClassWithinGroup(unsigned int group, unsigned int Class)
Accessor to a class array whithin a group.
Definition: datatable.h:225
unsigned int _table_set_age
Definition: ttquanti.h:246
double my_mean_no_nan(double *data, unsigned int size)
Definition: utils.cc:48
unsigned int size()
Get the total number of individuals present in the population, all sex and age classes together...
Definition: metapop.h:302
double * _Vb
Definition: ttquanti.h:235
gsl_vector * _eval
Definition: ttquanti.h:242
unsigned int _table_set_gen
Definition: ttquanti.h:246
double ** _peigval
Definition: ttquanti.h:236
double ** _pmeanP
Definition: ttquanti.h:236
double ** _peigvect
Definition: ttquanti.h:236
gsl_eigen_symmv_workspace * _ws
Definition: ttquanti.h:243
double * _covar
Definition: ttquanti.h:235

Member Data Documentation

double * TTQuantiSH::_covar
private

Referenced by init(), resetPtrs(), and setStats().

double * TTQuantiSH::_eigval
private

Referenced by init(), resetPtrs(), and setStats().

double ** TTQuantiSH::_eigvect
private

Referenced by init(), resetPtrs(), and setStats().

gsl_vector* TTQuantiSH::_eval
private

Referenced by init(), resetPtrs(), and setStats().

bool TTQuantiSH::_eVar
private

Referenced by addQuanti(), addVarPerPatch(), and init().

gsl_matrix * TTQuantiSH::_evec
private

Referenced by init(), resetPtrs(), and setStats().

gsl_matrix* TTQuantiSH::_G
private

Referenced by init(), resetPtrs(), and setStats().

DataTable< double > TTQuantiSH::_genoTable
private

Referenced by setDataTables(), and setStats().

double * TTQuantiSH::_meanG
private

Referenced by init(), resetPtrs(), and setStats().

double* TTQuantiSH::_meanP
private

Referenced by init(), resetPtrs(), and setStats().

unsigned int TTQuantiSH::_patchNbr
private

Referenced by init(), resetPtrs(), and setStats().

double ** TTQuantiSH::_pcovar
private

Referenced by init(), resetPtrs(), and setStats().

double ** TTQuantiSH::_peigval
private

Referenced by init(), resetPtrs(), and setStats().

double ** TTQuantiSH::_peigvect
private

Referenced by init(), resetPtrs(), and setStats().

DataTable< double > TTQuantiSH::_phenoTable
private
double ** TTQuantiSH::_pmeanG
private

Referenced by init(), resetPtrs(), and setStats().

double** TTQuantiSH::_pmeanP
private
double ** TTQuantiSH::_pVa
private

Referenced by init(), resetPtrs(), and setStats().

double ** TTQuantiSH::_pVp
private

Referenced by init(), resetPtrs(), and setStats().

unsigned int TTQuantiSH::_table_set_age
private

Referenced by setStats().

unsigned int TTQuantiSH::_table_set_gen
private

Referenced by setStats().

unsigned int TTQuantiSH::_table_set_repl
private

Referenced by setStats().

double * TTQuantiSH::_Va
private

Referenced by init(), resetPtrs(), and setStats().

double * TTQuantiSH::_Vb
private

Referenced by init(), resetPtrs(), and setStats().

double * TTQuantiSH::_Vp
private

Referenced by init(), resetPtrs(), and setStats().

gsl_eigen_symmv_workspace* TTQuantiSH::_ws
private

Referenced by init(), resetPtrs(), and setStats().


The documentation for this class was generated from the following files:

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