1
|
1 /*
|
|
2 Copyright 2009 Stéphane De Mita, Mathieu Siol
|
|
3
|
|
4 This file is part of the EggLib library.
|
|
5
|
|
6 EggLib is free software: you can redistribute it and/or modify
|
|
7 it under the terms of the GNU General Public License as published by
|
|
8 the Free Software Foundation, either version 3 of the License, or
|
|
9 (at your option) any later version.
|
|
10
|
|
11 EggLib is distributed in the hope that it will be useful,
|
|
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14 GNU General Public License for more details.
|
|
15
|
|
16 You should have received a copy of the GNU General Public License
|
|
17 along with EggLib. If not, see <http://www.gnu.org/licenses/>.
|
|
18 */
|
|
19
|
|
20 #ifndef EGGLIB_CHARMATRIX_HPP
|
|
21 #define EGGLIB_CHARMATRIX_HPP
|
|
22
|
|
23
|
|
24 namespace egglib {
|
|
25
|
|
26 /** \brief Interface for classes usable as a square matrix of characters
|
|
27 *
|
|
28 * \ingroup core
|
|
29 *
|
|
30 */
|
|
31 class CharMatrix {
|
|
32
|
|
33 public:
|
|
34
|
|
35 /** \brief Gets number of rows or sequences
|
|
36 *
|
|
37 */
|
|
38 virtual unsigned int numberOfSequences() const = 0;
|
|
39
|
|
40
|
|
41 /** \brief Gets number of columns or sites
|
|
42 *
|
|
43 */
|
|
44 virtual unsigned int numberOfSites() const = 0;
|
|
45
|
|
46
|
|
47 /** \brief Gets the character at a given position
|
|
48 *
|
|
49 * The accessor should be "fast" and does not guarantee to
|
|
50 * perform out-of-bounds checks
|
|
51 *
|
|
52 */
|
|
53 virtual char character(unsigned int sequence, unsigned int site) const = 0;
|
|
54
|
|
55
|
|
56 /** \brief Gets population index
|
|
57 *
|
|
58 */
|
|
59 virtual unsigned int populationLabel(unsigned int row) const = 0;
|
|
60
|
|
61
|
|
62 /** \brief Get site position
|
|
63 *
|
|
64 */
|
|
65 virtual double sitePosition(unsigned int column) const = 0;
|
|
66
|
|
67 };
|
|
68 }
|
|
69
|
|
70 #endif
|