bpp-seq3  3.0.0
DefaultNucleotideScore.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_SEQ_ALPHABETINDEX_DEFAULTNUCLEOTIDESCORE_H
6 #define BPP_SEQ_ALPHABETINDEX_DEFAULTNUCLEOTIDESCORE_H
7 
8 
9 // from the STL:
10 #include <string>
11 
12 #include "AlphabetIndex2.h"
13 #include "../Alphabet/NucleicAlphabet.h"
14 #include "../Alphabet/AlphabetExceptions.h"
15 #include <Bpp/Exceptions.h>
17 
18 namespace bpp
19 {
24  public virtual AlphabetIndex2
25 {
26 private:
28  std::shared_ptr<const NucleicAlphabet> alpha_;
29 
30 public:
37 
40  alpha_(dns.alpha_) {}
41 
43  {
45  alpha_ = dns.alpha_;
46  return *this;
47  }
48 
50 
51 public:
64  double getIndex(int state1, int state2) const override;
65  double getIndex(const std::string& state1, const std::string& state2) const override;
66  std::shared_ptr<const Alphabet> getAlphabet() const override { return alpha_; }
67  const Alphabet& alphabet() const override { return *alpha_; }
68  DefaultNucleotideScore* clone() const override { return new DefaultNucleotideScore(*this); }
69  const Matrix<double>& getIndexMatrix() const override;
70  bool isSymmetric() const override { return true; }
72 };
73 } // end of namespace bpp.
74 #endif // BPP_SEQ_ALPHABETINDEX_DEFAULTNUCLEOTIDESCORE_H
Two dimensionnal alphabet index interface.
The Alphabet interface.
Definition: Alphabet.h:99
Default Substitution Matrix for nucleotide alignments.
bool isSymmetric() const override
double getIndex(int state1, int state2) const override
Get the index associated to a pair of states.
std::shared_ptr< const Alphabet > getAlphabet() const override
Get the alphabet associated to this index.
LinearMatrix< double > distanceMatrix_
DefaultNucleotideScore * clone() const override
std::shared_ptr< const NucleicAlphabet > alpha_
const Alphabet & alphabet() const override
Get the alphabet associated to this index.
DefaultNucleotideScore(const DefaultNucleotideScore &dns)
DefaultNucleotideScore(const NucleicAlphabet *alphabet)
Build a new DefaultNucleotideScore object.
const Matrix< double > & getIndexMatrix() const override
DefaultNucleotideScore & operator=(const DefaultNucleotideScore &dns)
The abstract base class for nucleic alphabets.
This alphabet is used to deal NumericAlphabet.