libsequence  1.9.5
WeightingSchemes.hpp
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2003-2009 Kevin Thornton, krthornt[]@[]uci.edu
4 
5 Remove the brackets to email me.
6 
7 This file is part of libsequence.
8 
9 libsequence is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 libsequence is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 long with libsequence. If not, see <http://www.gnu.org/licenses/>.
21 
22 */
23 
24 #ifndef __WEIGHTING_SCHEMES_H__
25 #define __WEIGHTING_SCHEMES_H__
26 
27 #include <string>
28 #include <array>
29 #include <Sequence/SeqEnums.hpp>
78 namespace Sequence
79  {
81  {
82  using weights2_t = std::array<double,2>;
83  explicit WeightingScheme2(void)
84  {}
85  virtual ~WeightingScheme2(void)
86  {}
87  virtual weights2_t operator()(const std::string &codon1, const std::string &codon2,Sequence::GeneticCodes genetic_code) const =0;
88  };
89 
91  {
92  using weights3_t = std::array<double,6>;
93  explicit WeightingScheme3(void)
94  {}
95  virtual ~WeightingScheme3(void)
96  {}
97  virtual weights3_t operator()(const std::string &codon1, const std::string &codon2,Sequence::GeneticCodes genetic_code) const =0;
98  };
99 }
100 #endif
bool operator()(const std::pair< key, value > &l, const std::pair< key, value > &r) const
abstract interface to weighting schemes when codons differ at 2 positions
The namespace in which this library resides.
abstract interface to weighting schemes when codons differ at 3 positions
Definition of enumeration types.