Program Listing for File LocalCommunityEvaluation.hpp

Return to documentation for file (include/networkit/community/LocalCommunityEvaluation.hpp)

#ifndef NETWORKIT_COMMUNITY_LOCAL_COMMUNITY_EVALUATION_HPP_
#define NETWORKIT_COMMUNITY_LOCAL_COMMUNITY_EVALUATION_HPP_

#include <vector>

#include <networkit/Globals.hpp>
#include <networkit/base/Algorithm.hpp>

namespace NetworKit {

class LocalCommunityEvaluation : public Algorithm {
public:
    ~LocalCommunityEvaluation() override = default;

    double getWeightedAverage() const {
        assureFinished();
        return weightedAverage;
    };

    double getUnweightedAverage() const {
        assureFinished();
        return unweightedAverage;
    };

    double getMaximumValue() const {
        assureFinished();
        return maximumValue;
    };

    double getMinimumValue() const {
        assureFinished();
        return minimumValue;
    };

    double getValue(index i) const {
        assureFinished();
        return values[i];
    };

    std::vector<double> getValues() const {
        assureFinished();
        return values;
    };

    virtual bool isSmallBetter() const = 0;

protected:
    double weightedAverage;
    double unweightedAverage;
    double maximumValue;
    double minimumValue;
    std::vector<double> values;
};

} // namespace NetworKit

#endif // NETWORKIT_COMMUNITY_LOCAL_COMMUNITY_EVALUATION_HPP_