bpp-phyl3  3.0.0
AlignedPhyloLikelihood.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #ifndef BPP_PHYL_LIKELIHOOD_PHYLOLIKELIHOODS_ALIGNEDPHYLOLIKELIHOOD_H
6 #define BPP_PHYL_LIKELIHOOD_PHYLOLIKELIHOODS_ALIGNEDPHYLOLIKELIHOOD_H
7 
8 
9 // From bpp-seq:
11 
12 // from bpp-core
13 
15 
16 #include "PhyloLikelihood.h"
18 
19 namespace bpp
20 {
31  public virtual PhyloLikelihoodInterface
32 {
33 public:
36 
37  virtual AlignedPhyloLikelihoodInterface* clone() const = 0;
38 
39 public:
52  virtual size_t getNumberOfSites() const = 0;
53 
68 
72  virtual std::shared_ptr<AlignedLikelihoodCalculation> getAlignedLikelihoodCalculation() const = 0;
73 
81  virtual DataLik getLikelihoodForASite(size_t site) const = 0;
82 
90  virtual double getLogLikelihoodForASite(size_t site) const = 0;
91 
98  virtual VDataLik getLikelihoodPerSite() const = 0;
99 
103 };
104 
105 
107  public virtual AlignedPhyloLikelihoodInterface,
108  public virtual AbstractPhyloLikelihood
109 {
110 protected:
111  size_t nbSites_;
112 
113 public:
116  nbSites_(nbSites)
117  {}
118 
119 protected:
122  nbSites_(aasd.nbSites_)
123  {}
124 
126  {
128  nbSites_ = aasd.nbSites_;
129  return *this;
130  }
131 
132 public:
134 
135  size_t getNumberOfSites() const { return nbSites_; }
136 
143  DataLik getLikelihoodForASite(size_t site) const
144  {
146  }
147 
154  double getLogLikelihoodForASite(size_t site) const
155  {
156  using namespace numeric;
157 
159  }
160 
168  {
169  return getAlignedLikelihoodCalculation()->getLikelihoodPerSite();
170  }
171 
172 protected:
173  void setNumberOfSites(size_t nbSites)
174  {
175  nbSites_ = nbSites;
176  }
177 };
178 } // end of namespace bpp.
179 #endif // BPP_PHYL_LIKELIHOOD_PHYLOLIKELIHOODS_ALIGNEDPHYLOLIKELIHOOD_H
DataLik getLikelihoodForASite(size_t site) const
Get the likelihood for a site (on uncompressed data)
AbstractAlignedPhyloLikelihood(const AbstractAlignedPhyloLikelihood &aasd)
VDataLik getLikelihoodPerSite() const
Get the likelihood for each site.
AbstractAlignedPhyloLikelihood & operator=(const AbstractAlignedPhyloLikelihood &aasd)
size_t getNumberOfSites() const
Get the number of sites in the dataset.
double getLogLikelihoodForASite(size_t site) const
Get the log likelihood for a site, and its derivatives.
AbstractAlignedPhyloLikelihood(Context &context, size_t nbSites)
const Context & context() const override
AbstractPhyloLikelihood & operator=(const AbstractPhyloLikelihood &apl)
DataLik getLikelihoodForASite(size_t pos, bool shrunk=false)
The AlignedPhyloLikelihood interface, for phylogenetic likelihood.
virtual AlignedLikelihoodCalculation & alignedLikelihoodCalculation() const =0
virtual std::shared_ptr< AlignedLikelihoodCalculation > getAlignedLikelihoodCalculation() const =0
virtual AlignedPhyloLikelihoodInterface * clone() const =0
virtual double getLogLikelihoodForASite(size_t site) const =0
Get the log likelihood for a site, and its derivatives.
virtual VDataLik getLikelihoodPerSite() const =0
Get the likelihood for each site.
virtual DataLik getLikelihoodForASite(size_t site) const =0
Get the likelihood for a site.
virtual size_t getNumberOfSites() const =0
Get the number of sites in the dataset.
Context for dataflow node construction.
Definition: DataFlow.h:527
The PhyloLikelihood interface, for phylogenetic likelihood.
Defines the basic types of data flow nodes.
std::vector< DataLik > VDataLik
Definition: Definitions.h:23
double convert(const bpp::ExtendedFloat &ef)