annotate egglib/egglib-2.1.5/include/egglib-cpp/Current.hpp @ 15:31c23d943c29 draft default tip

Uploaded
author dereeper
date Tue, 08 Jan 2019 08:47:56 -0500
parents 420b57c3c185
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
1 /*
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
2 Copyright 2009-2010 Stéphane De Mita, Mathieu Siol
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
3
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
4 This file is part of the EggLib library.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
5
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
6 EggLib is free software: you can redistribute it and/or modify
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
8 the Free Software Foundation, either version 3 of the License, or
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
9 (at your option) any later version.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
10
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
11 EggLib is distributed in the hope that it will be useful,
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
14 GNU General Public License for more details.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
15
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
17 along with EggLib. If not, see <http://www.gnu.org/licenses/>.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
18 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
19
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
20 #ifndef EGGLIB_CURRENT_HPP
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
21 #define EGGLIB_CURRENT_HPP
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
22
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
23
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
24 namespace egglib {
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
25
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
26 class Population;
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
27 class ParamSet;
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
28
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
29 /** \brief Represents the current set of populations
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
30 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
31 * \ingroup coalesce
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
32 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
33 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
34 class Current {
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
35
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
36 public:
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
37
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
38 /** \brief Default constructor
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
39 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
40 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
41 Current();
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
42
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
43 /** \brief Standard constructor
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
44 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
45 * \param paramSet allows to initiate the correct structure
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
46 * of populations.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
47 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
48 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
49 Current(ParamSet* paramSet);
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
50
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
51 /** \brief Rebuilds the object
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
52 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
53 * \param paramSet allows to initiate the correct structure
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
54 * of populations.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
55 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
56 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
57 void reset(ParamSet* paramSet);
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
58
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
59 /** \brief Destructor
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
60 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
61 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
62 virtual ~Current();
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
63
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
64 /** \brief Copy constructor
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
65 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
66 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
67 Current(const Current&);
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
68
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
69 /** \brief Assignment operator
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
70 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
71 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
72 Current& operator=(const Current&);
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
73
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
74 /** \brief Gets the current number of populations
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
75 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
76 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
77 unsigned int numberOfPopulations() const;
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
78
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
79
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
80 /** \brief Adds an empty population to the system
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
81 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
82 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
83 void addPopulation();
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
84
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
85
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
86 /** \brief Gets the number of lineages contained by a given
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
87 * population
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
88 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
89 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
90 unsigned int populationNumberOfLineages(unsigned int populationIndex) const;
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
91
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
92
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
93 /** \brief Provides access to a given population
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
94 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
95 * The returned pointer can be used to modify the object.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
96 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
97 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
98 Population* population(unsigned int populationIndex);
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
99
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
100
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
101 /** \brief Total number of lineages
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
102 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
103 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
104 unsigned int totalNumberOfLineages() const;
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
105
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
106
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
107 /** \brief Efficient number of lineages
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
108 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
109 * This sums the number of covered segments of each lineage.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
110 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
111 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
112 unsigned int efficientNumberOfLineages() const;
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
113
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
114
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
115 private:
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
116
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
117 void setPopulationArray();
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
118 void copy(const Current&);
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
119 void clear();
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
120
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
121 unsigned int _numberOfPopulations;
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
122 unsigned int _numberOfSegments;
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
123 Population** populations;
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
124 };
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
125
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
126 }
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
127
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
128 #endif