MinLCA algorithms
Public Member Functions | Protected Attributes | List of all members
minlca::utils::RandomGraph< Graph > Class Template Referenceabstract

Base class for random graph generators. More...

#include <random-graph.hh>

Inheritance diagram for minlca::utils::RandomGraph< Graph >:
[legend]
Collaboration diagram for minlca::utils::RandomGraph< Graph >:
[legend]

Public Member Functions

template<typename Number = int>
 RandomGraph (Number seed=0)
 Constructor with seed. More...
 
 RandomGraph (lemon::Random &r)
 Constructor with custom random number generator. More...
 
 ~RandomGraph ()
 Destructor. More...
 
template<typename Number >
void seed (Number seed)
 Change the random number generator seed. More...
 
void changeRandom (lemon::Random &r)
 Change the random number generator. More...
 
virtual void generate ()=0
 Generate graph.
 

Protected Attributes

lemon::Random * _r
 Random number generator.
 
bool _delete_random
 Delete the random number generator in destructor.
 

Detailed Description

template<typename Graph = lemon::SmartGraph>
class minlca::utils::RandomGraph< Graph >

Base class for random graph generators.

Definition at line 16 of file random-graph.hh.

Constructor & Destructor Documentation

template<typename Graph = lemon::SmartGraph>
template<typename Number = int>
minlca::utils::RandomGraph< Graph >::RandomGraph ( Number  seed = 0)
inline

Constructor with seed.

Parameters
seedSeed for the random number generator

Definition at line 25 of file random-graph.hh.

template<typename Graph = lemon::SmartGraph>
minlca::utils::RandomGraph< Graph >::RandomGraph ( lemon::Random &  r)
inline

Constructor with custom random number generator.

Parameters
rRandom number generator

Definition at line 33 of file random-graph.hh.

template<typename Graph = lemon::SmartGraph>
minlca::utils::RandomGraph< Graph >::~RandomGraph ( )
inline

Destructor.

Takes care of removing the random number generator if it was initialised with a seed.

Definition at line 43 of file random-graph.hh.

Member Function Documentation

template<typename Graph = lemon::SmartGraph>
void minlca::utils::RandomGraph< Graph >::changeRandom ( lemon::Random &  r)
inline

Change the random number generator.

Parameters
rRandom number generator

Definition at line 70 of file random-graph.hh.

template<typename Graph = lemon::SmartGraph>
template<typename Number >
void minlca::utils::RandomGraph< Graph >::seed ( Number  seed)
inline

Change the random number generator seed.

Sets a new seed for the random number generator. If the generator was given explicitly before (instead of a seed), the original generator is not modified and a new generator is used.

Parameters
seedSeed for the random number generator

Definition at line 56 of file random-graph.hh.


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