diff -r ee5959aa4410 -r c280de819a73 src/work/jacint/graph_gen.h --- a/src/work/jacint/graph_gen.h Sun Apr 17 18:57:22 2005 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,120 +0,0 @@ -// -*- c++ -*- -#include -#include - -// ///\ingroup gwrappers -///\file -///\brief Graph generator functions. -/// -///This file contains several graph generator functions. -/// -// ///\author Marton Makai - -namespace lemon { - - - /** - * Inicializalja a veletlenszamgeneratort. - * Figyelem, ez nem jo igazi random szamokhoz, - * erre ne bizzad a titkaidat! - */ - void random_init() - { - unsigned int seed = getpid(); - seed |= seed << 15; - seed ^= time(0); - - srand(seed); - } - - - /** - * Egy veletlen int-et ad vissza 0 es m-1 kozott. - */ - int random(int m) - { - return int( double(m) * rand() / (RAND_MAX + 1.0) ); - } - - - /// Generates a random graph with n nodes and m edges. - /// Before generating the random graph, \c g.clear() is called. - template - void randomGraph(Graph& g, int n, int m) { - g.clear(); - std::vector nodes; - for (int i=0; i - void randomBipartiteGraph(Graph& g, int a, int b, int m) { - g.clear(); - std::vector s_nodes; - std::vector t_nodes; - for (int i=0; i - void completeGraph(Graph& g, int n) { - g.clear(); - std::vector nodes; - for (int i=0; i - void completeBidirectedGraph(Graph& g, int n) { - g.clear(); - std::vector nodes; - for (int i=0; i - void completeBipartiteGraph(Graph& g, int a, int b) { - g.clear(); - std::vector s_nodes; - std::vector t_nodes; - for (int i=0; i