Template Class DegreeDistribution

Inheritance Relationships

Base Type

Class Documentation

template<typename IDType, typename NNZType, typename ValueType, typename FeatureType>
class sparsebase::feature::DegreeDistribution : public sparsebase::feature::FeaturePreprocessType<FeatureType*>

Find the degree distribution of the graph representation of a format object.

tparam FeatureType

the type in which the distribution value are returned should be a floating type

Public Types

typedef DegreeDistributionParams ParamsType

An empty struct used for the parameters of DegreeDistribution.

Public Functions

DegreeDistribution()
DegreeDistribution(DegreeDistributionParams)
DegreeDistribution(const DegreeDistribution&)
DegreeDistribution(std::shared_ptr<DegreeDistributionParams>)
virtual std::unordered_map<std::type_index, std::any> Extract(format::Format *format, std::vector<context::Context*>, bool convert_input)
virtual std::vector<std::type_index> get_sub_ids()
virtual std::vector<utils::Extractable*> get_subs()
FeatureType *GetDistribution(format::Format *format, std::vector<context::Context*> contexts, bool convert_input)

Degree distribution generation executor function that carries out function matching

Parameters
  • format – a single format pointer to any format

  • contexts – vector of contexts that can be used for extracting

  • convert_input – whether or not to convert the input format if that is needed. features.

Returns

an array of size format.get_dimensions()[0] where element i is the degree distribution of the ith vertex in formats

FeatureType *GetDistribution(object::Graph<IDType, NNZType, ValueType> *object, std::vector<context::Context*> contexts, bool convert_input)

Degree distribution generation executor function that carries out function matching on a Graph

Parameters
  • object – a single format pointer to any format

  • contexts – vector of contexts that can be used for extracting

  • convert_input – whether or not to convert the input format if that is needed. features.

Returns

an array of size format.get_dimensions()[0] where element i is the degree distribution of the ith vertex in formats

std::tuple<std::vector<std::vector<format::Format*>>, FeatureType*> GetDistributionCached(format::Format *format, std::vector<context::Context*> contexts, bool convert_input)

Degree distribution generation executor function that carries out function matching with cached outputs

Generates the degree distribution of the passed format. If the input format was converted to other format types, the converting results are also returned with the output

Parameters
  • format – a single format pointer to any format

  • contexts – vector of contexts that can be used for extracting features.

  • convert_input – whether or not to convert the input format if that is needed.

Returns

A tuple with the first element being a vector of Format* where each pointer in the output points at the format that the corresponds Format object from the the input was converted to. If an input Format wasn’t converted, the output pointer will point at nullptr. The second element is an array of size format.get_dimensions()[0] where element i is the degree distribution of the ith vertex in formats

~DegreeDistribution()

Public Static Functions

static std::type_index get_id_static()
static FeatureType *GetDegreeDistributionCSR(std::vector<format::Format*> formats, utils::Parameters *params)

Degree distribution generation implementation function for CSRs.

Parameters

format – a single format pointer to any format

Returns

an array of size formats[0].get_dimensions()[0] where element i is the degree distribution of the ith vertex in formats[0]

Protected Functions

void Register()