bpp-phyl  2.2.0
JCnuc.h
Go to the documentation of this file.
1 //
2 // File: JCnuc.h
3 // Created by: Julien Dutheil
4 // Created on: Tue May 27 16:04:36 2003
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 _JCNUC_H_
41 #define _JCNUC_H_
42 
44 #include "../AbstractSubstitutionModel.h"
45 
46 namespace bpp
47 {
129 class JCnuc :
130  public virtual NucleotideSubstitutionModel,
132 {
133 private:
134  mutable double exp_;
135  mutable RowMatrix<double> p_;
136 
137 public:
138  JCnuc(const NucleicAlphabet* alpha);
139 
140  virtual ~JCnuc() {}
141 
142 #ifndef NO_VIRTUAL_COV
143  JCnuc*
144 #else
145  Clonable*
146 #endif
147  clone() const { return new JCnuc(*this); }
148 
149 public:
150  double Pij_t (size_t i, size_t j, double d) const;
151  double dPij_dt (size_t i, size_t j, double d) const;
152  double d2Pij_dt2(size_t i, size_t j, double d) const;
153  const Matrix<double>& getPij_t (double d) const;
154  const Matrix<double>& getdPij_dt (double d) const;
155  const Matrix<double>& getd2Pij_dt2(double d) const;
156 
157  std::string getName() const { return "JC69"; }
158 
167  void setFreqFromData(const SequenceContainer& data, double pseudoCount = 0) {}
168 
169 protected:
175  void updateMatrices();
176 };
177 } // end of namespace bpp.
178 
179 #endif // _JCNUC_H_
180 
void setFreqFromData(const SequenceContainer &data, double pseudoCount=0)
This method is disabled in this model since frequencies are not free parameters.
Definition: JCnuc.h:167
void updateMatrices()
Definition: JCnuc.cpp:61
JCnuc * clone() const
Definition: JCnuc.h:147
const Matrix< double > & getd2Pij_dt2(double d) const
Definition: JCnuc.cpp:174
Partial implementation of the ReversibleSubstitutionModel interface.
RowMatrix< double > p_
Definition: JCnuc.h:135
double exp_
Definition: JCnuc.h:134
std::string getName() const
Get the name of the model.
Definition: JCnuc.h:157
Specialisation interface for nucleotide substitution model.
virtual ~JCnuc()
Definition: JCnuc.h:140
double d2Pij_dt2(size_t i, size_t j, double d) const
Definition: JCnuc.cpp:138
The Jukes-Cantor substitution model for nucleotides.
Definition: JCnuc.h:129
double dPij_dt(size_t i, size_t j, double d) const
Definition: JCnuc.cpp:128
JCnuc(const NucleicAlphabet *alpha)
Definition: JCnuc.cpp:50
const Matrix< double > & getdPij_dt(double d) const
Definition: JCnuc.cpp:161
const Matrix< double > & getPij_t(double d) const
Definition: JCnuc.cpp:148
double Pij_t(size_t i, size_t j, double d) const
Definition: JCnuc.cpp:118