bpp-core3  3.0.0
HmmLikelihood.cpp
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #include "HmmLikelihood.h"
6 
7 using namespace bpp;
8 using namespace std;
9 
11  dLogLik_(0),
12  dVariable_(""),
13  d2LogLik_(0),
14  d2Variable_("") {}
15 
17  dLogLik_(adhlik.dLogLik_),
18  dVariable_(adhlik.dVariable_),
19  d2LogLik_(adhlik.d2LogLik_),
20  d2Variable_(adhlik.d2Variable_)
21 {}
22 
24 {
25  dLogLik_ = adhlik.dLogLik_;
26  dVariable_ = adhlik.dVariable_;
27  d2LogLik_ = adhlik.d2LogLik_;
28  d2Variable_ = adhlik.d2Variable_;
29 
30  return *this;
31 }
32 
33 double AbstractHmmLikelihood::getFirstOrderDerivative(const std::string& variable) const
34 {
35  if (variable != dVariable_)
36  {
37  dVariable_ = variable;
38 
41  }
42  return -dLogLik_;
43 }
44 
45 double AbstractHmmLikelihood::getSecondOrderDerivative(const std::string& variable) const
46 {
47  if (variable != d2Variable_)
48  {
49  d2Variable_ = variable;
50 
53  }
54  return -d2LogLik_;
55 }
STL namespace.
virtual void computeDLikelihood_() const =0
virtual void computeDEmissionProbabilities(std::string &variable) const
double getSecondOrderDerivative(const std::string &variable) const
Get the second order derivative of the function at the current point.
partial impmementation of Hmm Likelihoods.
double getFirstOrderDerivative(const std::string &variable) const
Get the derivative of the function at the current point.
AbstractHmmLikelihood & operator=(const AbstractHmmLikelihood &adhlik)
virtual void computeD2Likelihood_() const =0
virtual void computeD2EmissionProbabilities(std::string &variable) const
virtual const HmmEmissionProbabilities & hmmEmissionProbabilities() const =0