bpp-popgen3  3.0.0
MultiAlleleMonolocusGenotype.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 // Secured inclusion of header's file
6 #ifndef _MULTIALLELEMONOLOCUSGENOTYPE_H_
7 #define _MULTIALLELEMONOLOCUSGENOTYPE_H_
8 
9 // From STL
10 #include <vector>
11 
12 #include <Bpp/Exceptions.h>
13 
14 // From local
15 #include "MonolocusGenotype.h"
16 
17 namespace bpp
18 {
29  public virtual MonolocusGenotypeInterface
30 {
31 private:
32  std::vector<size_t> alleleIndex_;
33 
34 public:
38  MultiAlleleMonolocusGenotype(std::vector<size_t> alleleIndex);
39 
44 
49 
50 public:
51  // Other methodes
56 
60  bool operator==(const MultiAlleleMonolocusGenotype& mmg) const;
61 
65  bool isHomozygous() const;
66 
72  std::vector<size_t> getAlleleIndex() const override
73  {
74  return alleleIndex_;
75  }
76 
85  {
86  return new MultiAlleleMonolocusGenotype(*this);
87  }
89 };
90 } // end of namespace bpp;
91 
92 #endif // _MULTIALLELEMONOLOCUSGENOTYPE_H_
The MonolocusGenotype virtual class.
The MultiAlleleMonolocusGenotype class.
bool isHomozygous() const
Test the homozygozity of the locus (i.e. all allele are identical).
MultiAlleleMonolocusGenotype & operator=(const MultiAlleleMonolocusGenotype &mmg)
The affectation operator.
MultiAlleleMonolocusGenotype(std::vector< size_t > alleleIndex)
Build a monolocus genotype containing many alleles.
virtual ~MultiAlleleMonolocusGenotype()
Destroy the MultiAlleleMonolocusGenotype.
std::vector< size_t > getAlleleIndex() const override
Get the alleles' index.
MultiAlleleMonolocusGenotype * clone() const override
bool operator==(const MultiAlleleMonolocusGenotype &mmg) const
The == operator.