Partition.h
Go to the documentation of this file.
/* Frobby: Software for monomial ideal computations.
Copyright (C) 2007 Bjarke Hammersholt Roune (www.broune.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
*/
#ifndef PARTITION_GUARD
#define PARTITION_GUARD
class Partition {
public:
Partition();
Partition(const Partition& partition);
~Partition();
void reset(size_t size);
bool join(size_t i, size_t j);
size_t getSize() const;
size_t getSetCount() const;
size_t getSetSize(size_t set) const;
size_t getRoot(size_t i) const;
void addToSet(size_t i);
size_t getSizeOfClassOf(size_t i) const;
void print(FILE* file) const;
private:
// Made private since it is not implemented.
Partition& operator=(const Partition&);
int* _partitions;
size_t _size;
size_t _capacity;
size_t _setCount;
};
#endif
Partition::_partitions
int * _partitions
Definition Partition.h:48
Partition::getSetCount
size_t getSetCount() const
Definition Partition.cpp:72
Partition::_setCount
size_t _setCount
Definition Partition.h:52
Partition::~Partition
~Partition()
Definition Partition.cpp:35
Partition::_size
size_t _size
Definition Partition.h:49
Partition::getSetSize
size_t getSetSize(size_t set) const
Definition Partition.cpp:88
Partition::print
void print(FILE *file) const
Definition Partition.cpp:121
Partition::getSizeOfClassOf
size_t getSizeOfClassOf(size_t i) const
Definition Partition.cpp:84
Partition::join
bool join(size_t i, size_t j)
Definition Partition.cpp:51
Partition::reset
void reset(size_t size)
Definition Partition.cpp:39
Partition::getSize
size_t getSize() const
Definition Partition.cpp:117
Partition::addToSet
void addToSet(size_t i)
Definition Partition.cpp:111
Partition::_capacity
size_t _capacity
Definition Partition.h:50
Partition::Partition
Partition()
Definition Partition.cpp:20
Partition::getRoot
size_t getRoot(size_t i) const
Definition Partition.cpp:102
Partition::operator=
Partition & operator=(const Partition &)