bpp-seq3  3.0.0
MiyataAAChemicalDistance.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_MIYATAAACHEMICALDISTANCE_H
6 #define BPP_SEQ_ALPHABETINDEX_MIYATAAACHEMICALDISTANCE_H
7 
8 
9 // from the STL:
10 #include <string>
11 
12 #include "AlphabetIndex2.h"
13 #include "../Alphabet/AlphabetExceptions.h"
14 #include <Bpp/Exceptions.h>
16 
17 namespace bpp
18 {
35 {
36 private:
39  bool sym_;
40 
41 public:
43 
48  sym_(md.sym_)
49  {}
50 
52  {
54 
57  sym_ = md.sym_;
58  return *this;
59  }
60 
62 
63  MiyataAAChemicalDistance* clone() const override { return new MiyataAAChemicalDistance(); }
64 
65 public:
71  double getIndex(int state1, int state2) const override;
72  double getIndex(const std::string& state1, const std::string& state2) const override;
73  const Matrix<double>& getIndexMatrix() const override { return indexMatrix_; }
76 protected:
77  void computeIndexMatrix_();
78 
79 public:
80  void setSymmetric(bool yn)
81  {
82  sym_ = yn;
84  }
85  bool isSymmetric() const override { return sym_; }
86 };
87 } // end of namespace bpp.
88 #endif // BPP_SEQ_ALPHABETINDEX_MIYATAAACHEMICALDISTANCE_H
Miyata et al. (1979) Amino-Acid chemical distance.
double getIndex(int state1, int state2) const override
Get the index associated to a pair of states.
MiyataAAChemicalDistance * clone() const override
MiyataAAChemicalDistance & operator=(const MiyataAAChemicalDistance &md)
LinearMatrix< double > distanceMatrix_
const Matrix< double > & getIndexMatrix() const override
MiyataAAChemicalDistance(const MiyataAAChemicalDistance &md)
Virtual AlphabetIndex2 for proteic alphabet.
ProteicAlphabetIndex2 & operator=(const ProteicAlphabetIndex2 &pt)
This alphabet is used to deal NumericAlphabet.