175# include <sys/resource.h>
181# include <tclap/CmdLine.h>
185using namespace Aleph;
194 TCLAP::CmdLine
cmd(
"Generate random euclidian graph",
' ',
"1.0");
196 TCLAP::ValueArg<size_t>
nArg(
"n",
"nodes",
"Number of nodes",
false, 100,
"size_t");
197 TCLAP::ValueArg<size_t>
mArg(
"m",
"edges",
"Number of edges",
false, 1000,
"size_t");
198 TCLAP::ValueArg<int>
wArg(
"W",
"width",
"Width",
false, 1000,
"int");
199 TCLAP::ValueArg<int>
hArg(
"H",
"height",
"Height",
false, 1000,
"int");
200 TCLAP::ValueArg<unsigned int>
seedArg(
"s",
"seed",
"Random seed",
false, 0,
"unsigned int");
201 TCLAP::UnlabeledValueArg<string>
fileArg(
"file",
"Output file name",
false,
"",
"string");
212 }
catch (TCLAP::ArgException &e) {
213 cerr <<
"error: " << e.error() <<
" for arg " << e.argId() <<
endl;
217 size_t n =
nArg.getValue();
218 size_t m =
mArg.getValue();
219 int w =
wArg.getValue();
220 int h =
hArg.getValue();
221 unsigned int seed =
seedArg.getValue();
225 seed =
time(
nullptr);
227 cout <<
argv[0] <<
" " << n <<
" " << m <<
" " <<
w <<
" " <<
h <<
" "
230 cout <<
"Preparing system stack size to 256 Mb ... " <<
endl
250 cout <<
"Generating graph ... " <<
endl;
258 (g).save_in_text_mode(
out);
262 (g).save_in_text_mode(
cout);
Graph serialization and deserialization class.
Common utilities for Euclidean graphs.
Array_Graph< Graph_Anode< My_P >, Graph_Aarc< int > > Graph
Graph serialization and deserialization utilities.
Main namespace for Aleph-w library functions.
bool verbose
Flag enabling verbose output.
DynList< T > maps(const C &c, Op op)
Classic map operation.
Random graph generation utilities.
Array-based graph implementation.
Simple graph implementation with adjacency lists.