1 #ifndef DISCRETEDOUBLESOLUTION_H
2 #define DISCRETEDOUBLESOLUTION_H
4 #include "../base/solutionprovider.h"
5 #include "../base/discreteproxyprovider.h"
6 #include "../base/partitionprovider.h"
39 virtual unsigned int clustersize(
unsigned int,
unsigned int)
const;
40 virtual T*
element(
unsigned int,
unsigned int,
unsigned int)
const;
41 virtual std::vector<T*>
cluster(
unsigned int,
unsigned int)
const;
42 virtual std::vector<std::vector<T*> >
clustering(
unsigned int)
const;
60 unsigned int proxynum = this->proxysets.size();
61 unsigned int partitionnum = this->partitions.size();
62 return proxynum<partitionnum?proxynum:partitionnum;
67 if (i<this->number_of_solutions())
69 unsigned int proxysize = this->proxysets[i].size();
70 unsigned int partitionsize = this->partitions[i].size();
71 return proxysize<partitionsize?proxysize:partitionsize;
78 if (n<this->proxysets.size())
79 if (c<this->proxysets[n].size())
80 return this->proxysets[n][c];
86 if (n<this->proxysets.size())
87 return this->proxysets[n];
88 return std::vector<T*>();
93 if (g<this->partitions.size())
94 if (c<this->partitions[g].size())
95 return this->partitions[g][c].size();
101 if (g<this->partitions.size())
102 if (c<this->partitions[g].size())
103 if (n<this->partitions[g][c].size())
104 return this->partitions[g][c][n];
110 if (g<this->partitions.size())
111 if (c<this->partitions[g].size())
112 return this->partitions[g][c];
113 return std::vector<T*>();
118 if (g<this->partitions.size())
119 return this->partitions[g];
120 return std::vector<std::vector<T*> >();
virtual double computationtime() const
returns the time needed for the last computation
Abstract base class to access the results of proxy / center based clustering algorithms.
std::vector< std::vector< T * > > proxysets
std::vector< std::vector< std::vector< T * > > > partitions
virtual unsigned int number_of_solutions() const
returns the number of available solutions
virtual ~DiscreteDoubleSolution()
Data structure for partitions and discrete proxies.
virtual std::vector< T * > discrete_proxies(unsigned int n) const
Returns a vector of pointers to the proxies for the specified 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 T * element(unsigned int, unsigned int, unsigned int) const
Returns a pointer to a particular element from the specified cluster and clustering.
Abstract base class to access results of partition based clustering algorithms.
virtual T * discrete_proxy(unsigned int n, unsigned int c) const
Returns a pointer to the proxy for the specified clustering and cluster.
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 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.
virtual unsigned int size_of_solution(unsigned int) const
returns the size of a particular solution