Class ExperimentType

Inheritance Relationships

Derived Type

Class Documentation

class sparsebase::experiment::ExperimentType

Abstract class that defines a common interface for experiments.

Subclassed by sparsebase::experiment::ConcreteExperiment

Public Functions

virtual void Run(unsigned int times, bool store_auxiliary) = 0

Start the experiment. Each target will be preprocessed by all the preprocessing functions. Then every kernel will be applied to all of the newly created data. The cartesian product of the number of _targets, _preprocesses and _kernels iterations will be carried out.

Parameters
  • times – Specifies the number of samples.

  • store_auxiliary – determines if the auxiliary data created as a by product of the experiments is going to be stored or not.

virtual void AddDataLoader(LoadDataFunction func, std::vector<std::pair<std::vector<std::string>, std::any>> targets) = 0

Adds a dataLoader to the experiment. Each target data needs to be loaded to experiment via a LoadDataFunction.

Parameters
  • func – The function which follows the LoadDataFunction definition.

  • targets – File paths and file specific parameters.

virtual void AddPreprocess(std::string id, PreprocessFunction func, std::any params) = 0

Adds a preprocessing to the experiment. Each preprocessing operation is added to experiment via a PreprocessFunction.

Parameters
  • id – Preprocessing ID is used to store results, runtimes and auxiliary data.

  • func – The function which follows the PreprocessFunction definition.

  • params – Parameters to be passed to the respective function.

virtual void AddKernel(std::string id, KernelFunction func, std::any params) = 0

Adds a kernel to the experiment. Each kernel is added to experiment via a KernelFunction.

Parameters
  • id – Kernel ID is used to store results, runtimes and auxiliary data.

  • func – The function which follows the KernelFunction definition.

virtual std::map<std::string, std::vector<double>> GetRunTimes() = 0
Returns

Returns the runtimes of each kernel call.

virtual std::map<std::string, std::vector<std::any>> GetResults() = 0
Returns

Returns the results of each kernel call.

virtual std::map<std::string, std::any> GetAuxiliary() = 0
Returns

Returns the auxiliary data stored during the experiment.