bpp-phyl  2.2.0
RN95.h
Go to the documentation of this file.
1 //
2 // File: RN95.h
3 // Created by: Laurent Guéguen
4 // Created on: jeudi 24 février 2011, à 20h 43
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 _RN95_H_
41 #define _RN95_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 {
130 class RN95 :
131  public virtual NucleotideSubstitutionModel,
133 {
134 private:
136  double r_;
140  double c1_, c2_, c3_, c4_, c5_, c6_, c7_, c8_, c9_;
141  mutable RowMatrix<double> p_;
142  mutable double exp1_, exp3_, exp6_, l_;
143 
144 public:
145  RN95(
146  const NucleicAlphabet* alphabet,
147  double alpha = 1,
148  double beta = 1,
149  double gamma = 1,
150  double delta = 1,
151  double epsilon = 1,
152  double kappa = 1,
153  double lambda = 1,
154  double sigma = 1);
155 
156  virtual ~RN95() {}
157 
158 #ifndef NO_VIRTUAL_COV
159  RN95*
160 #else
161  Clonable*
162 #endif
163  clone() const { return new RN95(*this); }
164 
165 public:
166  double Pij_t (size_t i, size_t j, double d) const;
167  double dPij_dt (size_t i, size_t j, double d) const;
168  double d2Pij_dt2(size_t i, size_t j, double d) const;
169  const Matrix<double>& getPij_t (double d) const;
170  const Matrix<double>& getdPij_dt (double d) const;
171  const Matrix<double>& getd2Pij_dt2(double d) const;
172  std::string getName() const { return "RN95"; }
173 
174  void updateMatrices();
175 
176  void setFreq(std::map<int, double>&);
177 };
178 } // end of namespace bpp.
179 
180 #endif // _RN95_H_
181 
double exp6_
Definition: RN95.h:142
double kappa_
Definition: RN95.h:135
RowMatrix< double > p_
Definition: RN95.h:141
double c9_
Definition: RN95.h:140
double c7_
Definition: RN95.h:140
double lambda_
Definition: RN95.h:135
const Matrix< double > & getdPij_dt(double d) const
Definition: RN95.cpp:457
double d2Pij_dt2(size_t i, size_t j, double d) const
Definition: RN95.cpp:367
double beta_
Definition: RN95.h:135
double c1_
Definition: RN95.h:140
Partial implementation of the SubstitutionModel interface.
double c2_
Definition: RN95.h:140
double epsilon_
Definition: RN95.h:135
double delta_
Definition: RN95.h:135
double gamma_
Definition: RN95.h:135
double c6_
Definition: RN95.h:140
RN95 * clone() const
Definition: RN95.h:163
double c5_
Definition: RN95.h:140
double Pij_t(size_t i, size_t j, double d) const
Definition: RN95.cpp:255
const Matrix< double > & getd2Pij_dt2(double d) const
Definition: RN95.cpp:489
double alpha_
Definition: RN95.h:135
double sigma_
Definition: RN95.h:135
std::string getName() const
Get the name of the model.
Definition: RN95.h:172
RN95(const NucleicAlphabet *alphabet, double alpha=1, double beta=1, double gamma=1, double delta=1, double epsilon=1, double kappa=1, double lambda=1, double sigma=1)
Definition: RN95.cpp:55
Specialisation interface for nucleotide substitution model.
void updateMatrices()
Diagonalize the matrix, and fill the eigenValues_, iEigenValues_, leftEigenVectors_ and rightEigenVe...
Definition: RN95.cpp:121
double c4_
Definition: RN95.h:140
double c8_
Definition: RN95.h:140
double exp1_
Definition: RN95.h:142
double r_
Definition: RN95.h:136
const Matrix< double > & getPij_t(double d) const
Definition: RN95.cpp:424
double c3_
Definition: RN95.h:140
The model described by Rhetsky & Nei, where the only hypothesis is that the transversion rates are on...
Definition: RN95.h:130
double dPij_dt(size_t i, size_t j, double d) const
Definition: RN95.cpp:311
virtual ~RN95()
Definition: RN95.h:156
double exp3_
Definition: RN95.h:142
double l_
Definition: RN95.h:142
void setFreq(std::map< int, double > &)
Set equilibrium frequencies.
Definition: RN95.cpp:521