Frobby
0.10.0
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Partition.h
1
/* Frobby: Software for monomial ideal computations.
2
Copyright (C) 2007 Bjarke Hammersholt Roune (www.broune.com)
3
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or
7
(at your option) any later version.
8
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
13
14
You should have received a copy of the GNU General Public License
15
along with this program. If not, see http://www.gnu.org/licenses/.
16
*/
17
#ifndef PARTITION_GUARD
18
#define PARTITION_GUARD
19
20
class
Partition {
21
public
:
22
Partition();
23
Partition(
const
Partition& partition);
24
~Partition();
25
26
void
reset(
size_t
size);
27
28
bool
join(
size_t
i,
size_t
j);
29
30
size_t
getSize()
const
;
31
32
size_t
getSetCount()
const
;
33
34
size_t
getSetSize(
size_t
set)
const
;
35
36
size_t
getRoot(
size_t
i)
const
;
37
38
void
addToSet(
size_t
i);
39
40
size_t
getSizeOfClassOf(
size_t
i)
const
;
41
42
void
print(FILE* file)
const
;
43
44
private
:
45
// Made private since it is not implemented.
46
Partition& operator=(
const
Partition&);
47
48
int
* _partitions;
49
size_t
_size;
50
size_t
_capacity;
51
52
size_t
_setCount;
53
};
54
55
#endif
Generated by
1.17.0