~ubuntu-branches/ubuntu/saucy/libbpp-phyl/saucy

« back to all changes in this revision

Viewing changes to src/Bpp/Phyl/Model/YNGKP_M7.h

  • Committer: Package Import Robot
  • Author(s): Julien Dutheil
  • Date: 2013-02-09 16:00:00 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20130209160000-5v65ba68z8032nzj
Tags: 2.0.3-1
* Reorganized model hierarchy
* New pairwise models
* Several bugs fixed

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
#ifndef _YNGKP_M7_H_
41
41
#define _YNGKP_M7_H_
42
42
 
 
43
#include "AbstractBiblioMixedSubstitutionModel.h"
43
44
#include "MixtureOfASubstitutionModel.h"
44
45
#include "FrequenciesSet.h"
45
46
 
67
68
 * 
68
69
 */
69
70
class YNGKP_M7:
70
 
  public AbstractMixedSubstitutionModel
 
71
  public AbstractBiblioMixedSubstitutionModel
71
72
{
72
73
private:
73
74
  MixtureOfASubstitutionModel* pmixmodel_;
80
81
 
81
82
  int synfrom_, synto_;
82
83
  
83
 
private:
84
 
  /**
85
 
   * @brief Tools to make the link between the Parameters of the
86
 
   * object and those of pmixmodel_.
87
 
   *
88
 
   */
89
 
 
90
 
  std::map<std::string,std::string> mapParNamesFromPmodel_;
91
 
  
92
 
  ParameterList lParPmodel_;
93
 
  
94
 
 
95
84
public:
96
85
  /*
97
86
   *@brief Constructor that requires the number of classes of the
99
88
   *
100
89
   */
101
90
  
102
 
  YNGKP_M7(const GeneticCode* gc, FrequenciesSet* codonFreqs, unsigned int nbclass);
 
91
  YNGKP_M7(const GeneticCode* gc, FrequenciesSet* codonFreqs, unsigned int nclass);
103
92
 
104
93
  ~YNGKP_M7();
105
94
  
109
98
 
110
99
  YNGKP_M7& operator=(const YNGKP_M7&);
111
100
 
112
 
  unsigned int getNumberOfStates() const  { return pmixmodel_->getNumberOfStates();  }
113
 
 
114
101
protected:
115
102
  void updateMatrices();
116
103
 
117
104
public:
118
 
  const SubstitutionModel* getNModel(unsigned int i) const {
119
 
    return pmixmodel_->getNModel(i);
120
 
  }
121
 
 
122
 
  SubstitutionModel* getNModel(unsigned int i) {
123
 
    return pmixmodel_->getNModel(i);
124
 
  }
125
 
 
126
 
  /**
127
 
   * @brief Returns the  probability of a specific model from the mixture
128
 
   */
129
 
  
130
 
  double getNProbability(unsigned int i) const {
131
 
    return pmixmodel_->getNProbability(i);
132
 
  }
133
 
 
134
 
  const std::vector<double>& getProbabilities() const {
135
 
    return pmixmodel_->getProbabilities();
136
 
  }
137
 
    
138
 
  unsigned int getNumberOfModels() const {
139
 
    return pmixmodel_->getNumberOfModels();
 
105
  const AbstractSubstitutionModel* getModel() const {
 
106
    return pmixmodel_;
 
107
  }
 
108
 
 
109
  AbstractSubstitutionModel* getModel() {
 
110
    return pmixmodel_;
 
111
  }
 
112
 
 
113
 
 
114
  const MixedSubstitutionModel* getMixedModel() const {
 
115
    return pmixmodel_;
 
116
  }
 
117
 
 
118
  MixedSubstitutionModel* getMixedModel() {
 
119
    return pmixmodel_;
140
120
  }
141
121
 
142
122
  std::string getName() const { return "YNGKP_M7"; }
143
123
 
144
 
  /**
145
 
   * @brief inactivated method to prevent out of model manipulations
146
 
   *
147
 
   **/
148
 
  
149
 
  void setVRates(Vdouble & vd){};
150
 
 
151
 
  double Pij_t(unsigned int i, unsigned int j, double t) const {
152
 
    return pmixmodel_->Pij_t(i,j,t);
153
 
  }
154
 
  double dPij_dt(unsigned int i, unsigned int j, double t) const {
155
 
    return pmixmodel_->dPij_dt(i,j,t);
156
 
  };
157
 
  double d2Pij_dt2(unsigned int i, unsigned int j, double t) const {
158
 
    return pmixmodel_->dPij_dt(i,j,t);
159
 
  };
160
 
  const Matrix<double>& getPij_t(double t) const {
161
 
    return pmixmodel_->getPij_t(t);
162
 
  };
163
 
  const Matrix<double>& getdPij_dt(double t) const {
164
 
    return pmixmodel_->getdPij_dt(t);
165
 
  };
166
 
  const Matrix<double>& getd2Pij_dt2(double t) const {
167
 
    return pmixmodel_->getd2Pij_dt2(t);
168
 
  };
169
 
  
170
 
  const Vdouble& getFrequencies() const {
171
 
    return pmixmodel_->getFrequencies();
172
 
  };
173
 
  
174
 
  double freq(unsigned int i) const {
175
 
    return pmixmodel_->freq(i);
176
 
  };
177
 
 
178
 
  void setFreq(std::map<int,double>& m);
179
 
 
180
 
  double getRate() const { return pmixmodel_->getRate();}
181
 
  
182
 
  void setRate(double rate) { pmixmodel_->setRate(rate);}
183
124
};
184
125
 
185
126
} //end of namespace bpp.