bpp-phyl  2.2.0
F84.h
Go to the documentation of this file.
1 //
2 // File: F84.h
3 // Created by: Julien Dutheil
4 // Created on: Tue May 23 11:13 2005
5 //
6 
7 /*
8 Copyright or © or Copr. Bio++ Development Team, (November 16, 2004)
9 
10 This software is a computer program whose purpose is to provide classes
11 for phylogenetic data analysis.
12 
13 This software is governed by the CeCILL license under French law and
14 abiding by the rules of distribution of free software. You can use,
15 modify and/ or redistribute the software under the terms of the CeCILL
16 license as circulated by CEA, CNRS and INRIA at the following URL
17 "http://www.cecill.info".
18 
19 As a counterpart to the access to the source code and rights to copy,
20 modify and redistribute granted by the license, users are provided only
21 with a limited warranty and the software's author, the holder of the
22 economic rights, and the successive licensors have only limited
23 liability.
24 
25 In this respect, the user's attention is drawn to the risks associated
26 with loading, using, modifying and/or developing or reproducing the
27 software by the user in light of its specific status of free software,
28 that may mean that it is complicated to manipulate, and that also
29 therefore means that it is reserved for developers and experienced
30 professionals having in-depth computer knowledge. Users are therefore
31 encouraged to load and test the software's suitability as regards their
32 requirements in conditions enabling the security of their systems and/or
33 data to be ensured and, more generally, to use and operate it in the
34 same conditions as regards security.
35 
36 The fact that you are presently reading this means that you have had
37 knowledge of the CeCILL license and that you accept its terms.
38 */
39 
40 #ifndef _F84_H_
41 #define _F84_H_
42 
44 #include "../AbstractSubstitutionModel.h"
45 
46 #include <Bpp/Numeric/Constraints.h>
47 
48 // From SeqLib:
49 #include <Bpp/Seq/Alphabet/NucleicAlphabet.h>
50 
51 namespace bpp
52 {
53 
178 class F84:
179  public virtual NucleotideSubstitutionModel,
181 {
182  private:
184  mutable double l_, exp1_, exp2_;
185  mutable RowMatrix<double> p_;
186 
187  public:
188  F84(
189  const NucleicAlphabet * alpha,
190  double kappa = 1.,
191  double piA = 0.25,
192  double piC = 0.25,
193  double piG = 0.25,
194  double piT = 0.25);
195 
196  virtual ~F84() {}
197 
198 #ifndef NO_VIRTUAL_COV
199  F84*
200 #else
201  Clonable*
202 #endif
203  clone() const { return new F84(*this); }
204 
205  public:
206 
207  double Pij_t (size_t i, size_t j, double d) const;
208  double dPij_dt (size_t i, size_t j, double d) const;
209  double d2Pij_dt2(size_t i, size_t j, double d) const;
210  const Matrix<double>& getPij_t (double d) const;
211  const Matrix<double>& getdPij_dt (double d) const;
212  const Matrix<double>& getd2Pij_dt2(double d) const;
213 
214  std::string getName() const { return "F84"; }
215 
219  void setFreq(std::map<int, double>&);
220 
221  protected:
222  void updateMatrices();
223 };
224 
225 } //end of namespace bpp.
226 
227 #endif //_F84_H_
228 
double k2_
Definition: F84.h:183
virtual ~F84()
Definition: F84.h:196
const Matrix< double > & getPij_t(double d) const
Definition: F84.cpp:343
double d2Pij_dt2(size_t i, size_t j, double d) const
Definition: F84.cpp:292
double kappa_
Definition: F84.h:183
const Matrix< double > & getd2Pij_dt2(double d) const
Definition: F84.cpp:409
double dPij_dt(size_t i, size_t j, double d) const
Definition: F84.cpp:243
Partial implementation of the ReversibleSubstitutionModel interface.
double theta1_
Definition: F84.h:183
double theta_
Definition: F84.h:183
double piC_
Definition: F84.h:183
RowMatrix< double > p_
Definition: F84.h:185
double Pij_t(size_t i, size_t j, double d) const
Definition: F84.cpp:194
double r_
Definition: F84.h:183
double l_
Definition: F84.h:184
double k1_
Definition: F84.h:183
const Matrix< double > & getdPij_dt(double d) const
Definition: F84.cpp:376
double piA_
Definition: F84.h:183
std::string getName() const
Get the name of the model.
Definition: F84.h:214
double piY_
Definition: F84.h:183
double theta2_
Definition: F84.h:183
double exp2_
Definition: F84.h:184
Specialisation interface for nucleotide substitution model.
void setFreq(std::map< int, double > &)
This method is redefined to actualize the corresponding parameters piA, piT, piG and piC too...
Definition: F84.cpp:446
double piR_
Definition: F84.h:183
F84 * clone() const
Definition: F84.h:203
void updateMatrices()
Compute and diagonalize the matrix, and fill the eigenValues_, leftEigenVectors_ and rightEigenVecto...
Definition: F84.cpp:78
double piG_
Definition: F84.h:183
The Felsenstein (1984) substitution model for nucleotides.
Definition: F84.h:178
double exp1_
Definition: F84.h:184
double piT_
Definition: F84.h:183
F84(const NucleicAlphabet *alpha, double kappa=1., double piA=0.25, double piC=0.25, double piG=0.25, double piT=0.25)
Definition: F84.cpp:56