1 #ifndef PARTITIONSOLUTION_H
2 #define PARTITIONSOLUTION_H
4 #include "../base/solutionprovider.h"
5 #include "../base/partitionprovider.h"
34 virtual unsigned int clustersize(
unsigned int,
unsigned int)
const;
35 virtual T*
element(
unsigned int,
unsigned int,
unsigned int)
const;
36 virtual std::vector<T*>
cluster(
unsigned int,
unsigned int)
const;
37 virtual std::vector<std::vector<T*> >
clustering(
unsigned int)
const;
54 return this->partitions.size();
59 if (i<this->partitions.size())
60 return this->partitions[i].size();
66 if (g<this->partitions.size())
67 if (c<this->partitions[g].size())
68 return this->partitions[g][c].size();
74 if (g<this->partitions.size())
75 if (c<this->partitions[g].size())
76 if (n<this->partitions[g][c].size())
77 return this->partitions[g][c][n];
83 if (g<this->partitions.size())
84 if (c<this->partitions[g].size())
85 return this->partitions[g][c];
86 return std::vector<T*>();
91 if (g<this->partitions.size())
92 return this->partitions[g];
93 return std::vector<std::vector<T*> >();
std::vector< std::vector< std::vector< T * > > > partitions
virtual unsigned int size_of_solution(unsigned int) const
returns the size of a particular solution
virtual T * element(unsigned int, unsigned int, unsigned int) const
Returns a pointer to a particular element from the specified cluster and clustering.
virtual std::vector< std::vector< T * > > clustering(unsigned int) const
Returns the specified clustering as a vector of vector of pointers to the elements.
virtual ~PartitionSolution()
virtual unsigned int number_of_solutions() const
returns the number of available solutions
Abstract base class to access results of partition based clustering algorithms.
virtual unsigned int clustersize(unsigned int, unsigned int) const
Returns the cardinality of the specified cluster from the computed clustering.
Abstract base class for algorithm solutions.
Data structure for partitions.
virtual std::vector< T * > cluster(unsigned int, unsigned int) const
Returns a vector of pointers to the elements of a particular cluster from the specified clustering...
virtual double computationtime() const
returns the time needed for the last computation