bpp-phyl  2.2.0
RN95s.h
Go to the documentation of this file.
1 //
2 // File: RN95s.h
3 // Created by: Laurent Guéguen
4 // Created on: samedi 12 mars 2011, à 06h 49
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 _RN95s_H_
41 #define _RN95s_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 {
110 class RN95s :
111  public virtual NucleotideSubstitutionModel,
113 {
114 private:
116  double r_;
120  double c3_, c4_, c8_;
121  mutable RowMatrix<double> p_;
122  mutable double exp1_, exp3_, l_;
123 
124 public:
125  RN95s(const NucleicAlphabet* alphabet,
126  double alpha = 1,
127  double beta = 1,
128  double gamma = 1,
129  double delta = 1);
130 
131  virtual ~RN95s() {}
132 
133 #ifndef NO_VIRTUAL_COV
134  RN95s*
135 #else
136  Clonable*
137 #endif
138  clone() const { return new RN95s(*this); }
139 
140 public:
141  double Pij_t (size_t i, size_t j, double d) const;
142  double dPij_dt (size_t i, size_t j, double d) const;
143  double d2Pij_dt2(size_t i, size_t j, double d) const;
144  const Matrix<double>& getPij_t (double d) const;
145  const Matrix<double>& getdPij_dt (double d) const;
146  const Matrix<double>& getd2Pij_dt2(double d) const;
147 
148  std::string getName() const { return "RN95s"; }
149 
150  void updateMatrices();
151 
156  void setFreq(std::map<int, double>&);
157 };
158 } // end of namespace bpp.
159 
160 #endif // _RN95s_H_
161 
const Matrix< double > & getdPij_dt(double d) const
Definition: RN95s.cpp:409
const Matrix< double > & getPij_t(double d) const
Definition: RN95s.cpp:377
double alpha_
Definition: RN95s.h:115
double dPij_dt(size_t i, size_t j, double d) const
Definition: RN95s.cpp:266
double c8_
Definition: RN95s.h:120
double delta_
Definition: RN95s.h:115
virtual ~RN95s()
Definition: RN95s.h:131
double l_
Definition: RN95s.h:122
double exp1_
Definition: RN95s.h:122
Partial implementation of the SubstitutionModel interface.
double d2Pij_dt2(size_t i, size_t j, double d) const
Definition: RN95s.cpp:321
void updateMatrices()
Diagonalize the matrix, and fill the eigenValues_, iEigenValues_, leftEigenVectors_ and rightEigenVe...
Definition: RN95s.cpp:92
RN95s * clone() const
Definition: RN95s.h:138
double c4_
Definition: RN95s.h:120
double r_
Definition: RN95s.h:116
std::string getName() const
Get the name of the model.
Definition: RN95s.h:148
Intersection of models RN95 and L95.
Definition: RN95s.h:110
double Pij_t(size_t i, size_t j, double d) const
Definition: RN95s.cpp:211
RN95s(const NucleicAlphabet *alphabet, double alpha=1, double beta=1, double gamma=1, double delta=1)
Definition: RN95s.cpp:55
Specialisation interface for nucleotide substitution model.
double exp3_
Definition: RN95s.h:122
const Matrix< double > & getd2Pij_dt2(double d) const
Definition: RN95s.cpp:440
void setFreq(std::map< int, double > &)
This method takes the average value between observed and .
Definition: RN95s.cpp:471
double gamma_
Definition: RN95s.h:115
double beta_
Definition: RN95s.h:115
RowMatrix< double > p_
Definition: RN95s.h:121
double c3_
Definition: RN95s.h:120