bpp-phyl3  3.0.0
SitePartition.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_SITEPARTITION_H
6 #define BPP_PHYL_LIKELIHOOD_SITEPARTITION_H
7 
8 
9 namespace bpp
10 {
21  public virtual Clonable
22 {
23 public:
24  SitePartition* clone() const = 0;
25 
26 public:
27  virtual size_t getNumberOfPartitions() const = 0;
28  virtual size_t getNumberOfPatternsForPartition(size_t partitionIndex) const = 0;
29 };
30 
35  public virtual SitePartition
36 {
37 private:
39 
40 public:
41  TrivialSitePartition(size_t nbDistinctSites) : nbDistinctSites_(nbDistinctSites) {}
42 
43  TrivialSitePartition* clone() const { return new TrivialSitePartition(*this); }
44 
45 public:
46  size_t getNumberOfPartitions() const { return 1; }
47  size_t getNumberOfPatternsForPartition(size_t partitionIndex) const { return nbDistinctSites_; }
48 };
49 } // end of namespace bpp
50 #endif // BPP_PHYL_LIKELIHOOD_SITEPARTITION_H
This is the interface for classes describing a site partition, each partition being intended to have ...
Definition: SitePartition.h:22
virtual size_t getNumberOfPatternsForPartition(size_t partitionIndex) const =0
virtual size_t getNumberOfPartitions() const =0
SitePartition * clone() const =0
Trivial site partition: all sites belong to the same, unique partition.
Definition: SitePartition.h:36
TrivialSitePartition * clone() const
Definition: SitePartition.h:43
size_t getNumberOfPartitions() const
Definition: SitePartition.h:46
TrivialSitePartition(size_t nbDistinctSites)
Definition: SitePartition.h:41
size_t getNumberOfPatternsForPartition(size_t partitionIndex) const
Definition: SitePartition.h:47
Defines the basic types of data flow nodes.