Bridges-C++  3.4.2
Bridges(C++ API)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
bridges::benchmark::GraphBenchmark Class Reference

#include <GraphBenchmark.h>

Inheritance diagram for bridges::benchmark::GraphBenchmark:
bridges::benchmark::BFSBenchmark bridges::benchmark::PageRankBenchmark bridges::benchmark::ShortestPathBenchmark

Detailed Description

Base class for a variety of graph based benchmark.

This class is not meant to be used directly by students.

Public Member Functions

void setTimeCap (double cap_in_s)
 sets an upper bound to the time of a run. More...
 
double getTimeCap () const
 Return time limit of a run. More...
 

Protected Member Functions

 GraphBenchmark ()
 
std::tuple< long, long > generateWikidataMovieActor (int yearmin, int yearmax, GraphAdjList< std::string > &moviegraph)
 
std::string highestDegreeVertex (GraphAdjList< std::string > &gr)
 
template<typename GraphType >
long countVertices (const GraphType &gr)
 
template<typename GraphType >
long countEdges (const GraphType &gr)
 

Protected Attributes

double time_cap
 

Constructor & Destructor Documentation

◆ GraphBenchmark()

bridges::benchmark::GraphBenchmark::GraphBenchmark ( )
inlineprotected

Member Function Documentation

◆ countEdges()

template<typename GraphType >
long bridges::benchmark::GraphBenchmark::countEdges ( const GraphType &  gr)
inlineprotected

◆ countVertices()

template<typename GraphType >
long bridges::benchmark::GraphBenchmark::countVertices ( const GraphType &  gr)
inlineprotected

◆ generateWikidataMovieActor()

std::tuple<long, long> bridges::benchmark::GraphBenchmark::generateWikidataMovieActor ( int  yearmin,
int  yearmax,
GraphAdjList< std::string > &  moviegraph 
)
inlineprotected
Returns
a triplet: the graph, the number of vertices, and the number of edges

◆ getTimeCap()

double bridges::benchmark::GraphBenchmark::getTimeCap ( ) const
inline

Return time limit of a run.

The benchmark will end after a run if it takes more than the given amount of time. So it is possible a particular run takes more than the alloted time, but that will be the last run.

Returns
the time upper bound (in seconds) of a particular run.

◆ highestDegreeVertex()

std::string bridges::benchmark::GraphBenchmark::highestDegreeVertex ( GraphAdjList< std::string > &  gr)
inlineprotected

◆ setTimeCap()

void bridges::benchmark::GraphBenchmark::setTimeCap ( double  cap_in_s)
inline

sets an upper bound to the time of a run.

The benchmark will end after a run if it takes more than the given amount of time. So it is possible a particular run takes more than the alloted time, but that will be the last run.

Parameters
cap_in_stime limit in seconds

Member Data Documentation

◆ time_cap

double bridges::benchmark::GraphBenchmark::time_cap
protected

The documentation for this class was generated from the following file: