MinLCA algorithms
Public Member Functions | Protected Types | Protected Attributes | List of all members
minlca::utils::BinomialRandom< BaseGraph > Class Template Reference

Class defining binomial random graphs. More...

#include <binomial.hh>

Inheritance diagram for minlca::utils::BinomialRandom< BaseGraph >:
[legend]
Collaboration diagram for minlca::utils::BinomialRandom< BaseGraph >:
[legend]

Public Member Functions

 TEMPLATE_GRAPH_TYPEDEFS (Graph)
 
template<typename Number = int>
 BinomialRandom (Number seed=0)
 Constructor with seed. More...
 
 BinomialRandom (lemon::Random &r)
 Constructor with custom random number generator. More...
 
Graphinit (int n, double p)
 Initialise the generator. More...
 
double p () const
 Retrieve the edge probability.
 
virtual void generate ()
 Generate graph.
 
- Public Member Functions inherited from minlca::utils::RandomGraph< BaseGraph >
 RandomGraph (Number seed=0)
 Constructor with seed. More...
 
 RandomGraph (lemon::Random &r)
 Constructor with custom random number generator. More...
 
 ~RandomGraph ()
 Destructor. More...
 
void seed (Number seed)
 Change the random number generator seed. More...
 
void changeRandom (lemon::Random &r)
 Change the random number generator. More...
 

Protected Types

typedef BinomialRandom< BaseGraph > Graph
 
typedef RandomGraph< BaseGraph > Base
 

Protected Attributes

int _n
 Number of vertices.
 
double _p
 Edge probability.
 
- Protected Attributes inherited from minlca::utils::RandomGraph< BaseGraph >
lemon::Random * _r
 Random number generator.
 
bool _delete_random
 Delete the random number generator in destructor.
 

Detailed Description

template<typename BaseGraph = lemon::SmartGraph>
class minlca::utils::BinomialRandom< BaseGraph >

Class defining binomial random graphs.

Definition at line 19 of file binomial.hh.

Constructor & Destructor Documentation

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

Constructor with seed.

See also
RandomGraph::RandomGraph(Number)

Definition at line 37 of file binomial.hh.

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

Constructor with custom random number generator.

See also
RandomGraph::RandomGraph(lemon::Random &)

Definition at line 44 of file binomial.hh.

Member Function Documentation

template<typename BaseGraph = lemon::SmartGraph>
Graph& minlca::utils::BinomialRandom< BaseGraph >::init ( int  n,
double  p 
)
inline

Initialise the generator.

The edge probability is set to 0 if \(p < 0\) and to 1 if \(p > 1\)

Parameters
nNumber of vertices
pEdge probability

Definition at line 52 of file binomial.hh.


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