All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LocalCommunityEvaluation.h
Go to the documentation of this file.
1 #ifndef LOCALCOMMUNITYEVALUATION_H
2 #define LOCALCOMMUNITYEVALUATION_H
3 
4 #include "../base/Algorithm.h"
5 #include <vector>
6 #include "../Globals.h"
7 
8 namespace NetworKit {
9 
15 public:
19  virtual ~LocalCommunityEvaluation() = default;
20 
26  double getWeightedAverage() const { assureFinished(); return weightedAverage; };
27 
33  double getUnweightedAverage() const { assureFinished(); return unweightedAverage; };
34 
40  double getMaximumValue() const { assureFinished(); return maximumValue; };
41 
47  double getMinimumValue() const { assureFinished(); return minimumValue; };
48 
55  double getValue(index i) const { assureFinished(); return values[i]; };
56 
62  std::vector<double> getValues() const { assureFinished(); return values; };
63 
69  virtual bool isSmallBetter() const = 0;
70 protected:
73  double maximumValue;
74  double minimumValue;
75  std::vector<double> values;
76 };
77 
78 }
79 
80 #endif // LOCALCOMMUNITYEVALUATION_H
double getValue(index i) const
Get the value of the specified cluster.
Definition: LocalCommunityEvaluation.h:55
std::vector< double > getValues() const
Get the values of all clusters.
Definition: LocalCommunityEvaluation.h:62
double getMinimumValue() const
Get the minimum value of all clusters.
Definition: LocalCommunityEvaluation.h:47
double maximumValue
Definition: LocalCommunityEvaluation.h:73
double getWeightedAverage() const
Get the average value weighted by cluster size.
Definition: LocalCommunityEvaluation.h:26
double minimumValue
Definition: LocalCommunityEvaluation.h:74
virtual ~LocalCommunityEvaluation()=default
Default destructor for the virtual base class.
uint64_t index
Typedefs.
Definition: Globals.h:20
double unweightedAverage
Definition: LocalCommunityEvaluation.h:72
double weightedAverage
Definition: LocalCommunityEvaluation.h:71
double getMaximumValue() const
Get the maximum value of all clusters.
Definition: LocalCommunityEvaluation.h:40
std::vector< double > values
Definition: LocalCommunityEvaluation.h:75
void assureFinished() const
Assure that the algorithm has been run, throws a std::runtime_error otherwise.
Definition: Algorithm.h:42
Definition: Algorithm.h:9
double getUnweightedAverage() const
Get the (unweighted) average value of all clusters.
Definition: LocalCommunityEvaluation.h:33
virtual bool isSmallBetter() const =0
If small values are better (otherwise large values are better).
Virtual base class of all evaluation methods for a single clustering which is based on the evaluation...
Definition: LocalCommunityEvaluation.h:14