10
10
/*
11
11
Copyright (c) 2003-2015 Tommi Junttila
12
12
Released under the GNU Lesser General Public License version 3.
13
-
13
+
14
14
This file is part of bliss.
15
-
15
+
16
16
bliss is free software: you can redistribute it and/or modify
17
17
it under the terms of the GNU Lesser General Public License as published by
18
18
the Free Software Foundation, version 3 of the License.
@@ -52,13 +52,14 @@ static void
52
52
usage (FILE* const fp, const char * argv0)
53
53
{
54
54
const char * program_name;
55
-
55
+
56
56
program_name = rindex (argv0, ' /' );
57
-
57
+
58
58
if (program_name) program_name++;
59
- else program_name = argv0;
59
+ else program_name = argv0;
60
60
if (!program_name or *program_name == 0 ) program_name = " bliss" ;
61
61
62
+ fprintf (fp, " bliss version %s (compiled " __DATE__" )\n " , bliss_digraphs::version);
62
63
fprintf (fp, " Copyright 2003-2015 Tommi Junttila\n " );
63
64
fprintf (fp,
64
65
" \n "
@@ -119,7 +120,7 @@ parse_options(const int argc, const char** argv)
119
120
}
120
121
else if (strcmp (argv[i], " -version" ) == 0 )
121
122
{
122
- fprintf (stdout, " bliss version %s\n " , bliss ::version);
123
+ fprintf (stdout, " bliss version %s\n " , bliss_digraphs ::version);
123
124
exit (0 );
124
125
}
125
126
else if (strcmp (argv[i], " -help" ) == 0 )
@@ -160,7 +161,7 @@ report_aut(void* param, const unsigned int n, const unsigned int* aut)
160
161
{
161
162
assert (param);
162
163
fprintf ((FILE*)param, " Generator: " );
163
- bliss ::print_permutation ((FILE*)param, n, aut, 1 );
164
+ bliss_digraphs ::print_permutation ((FILE*)param, n, aut, 1 );
164
165
fprintf ((FILE*)param, " \n " );
165
166
}
166
167
@@ -182,45 +183,45 @@ _fatal(const char* fmt, ...)
182
183
int
183
184
main (const int argc, const char ** argv)
184
185
{
185
- bliss ::Timer timer;
186
- bliss ::AbstractGraph* g = 0 ;
186
+ bliss_digraphs ::Timer timer;
187
+ bliss_digraphs ::AbstractGraph* g = 0 ;
187
188
188
189
parse_options (argc, argv);
189
-
190
+
190
191
/* Parse splitting heuristics */
191
- bliss ::Digraph::SplittingHeuristic shs_directed = bliss ::Digraph::shs_fsm;
192
- bliss ::Graph::SplittingHeuristic shs_undirected = bliss ::Graph::shs_fsm;
192
+ bliss_digraphs ::Digraph::SplittingHeuristic shs_directed = bliss_digraphs ::Digraph::shs_fsm;
193
+ bliss_digraphs ::Graph::SplittingHeuristic shs_undirected = bliss_digraphs ::Graph::shs_fsm;
193
194
if (opt_directed)
194
195
{
195
196
if (strcmp (opt_splitting_heuristics, " f" ) == 0 )
196
- shs_directed = bliss ::Digraph::shs_f;
197
+ shs_directed = bliss_digraphs ::Digraph::shs_f;
197
198
else if (strcmp (opt_splitting_heuristics, " fs" ) == 0 )
198
- shs_directed = bliss ::Digraph::shs_fs;
199
+ shs_directed = bliss_digraphs ::Digraph::shs_fs;
199
200
else if (strcmp (opt_splitting_heuristics, " fl" ) == 0 )
200
- shs_directed = bliss ::Digraph::shs_fl;
201
+ shs_directed = bliss_digraphs ::Digraph::shs_fl;
201
202
else if (strcmp (opt_splitting_heuristics, " fm" ) == 0 )
202
- shs_directed = bliss ::Digraph::shs_fm;
203
+ shs_directed = bliss_digraphs ::Digraph::shs_fm;
203
204
else if (strcmp (opt_splitting_heuristics, " fsm" ) == 0 )
204
- shs_directed = bliss ::Digraph::shs_fsm;
205
+ shs_directed = bliss_digraphs ::Digraph::shs_fsm;
205
206
else if (strcmp (opt_splitting_heuristics, " flm" ) == 0 )
206
- shs_directed = bliss ::Digraph::shs_flm;
207
+ shs_directed = bliss_digraphs ::Digraph::shs_flm;
207
208
else
208
209
_fatal (" Illegal option -sh=%s, aborting" , opt_splitting_heuristics);
209
210
}
210
211
else
211
212
{
212
213
if (strcmp (opt_splitting_heuristics, " f" ) == 0 )
213
- shs_undirected = bliss ::Graph::shs_f;
214
+ shs_undirected = bliss_digraphs ::Graph::shs_f;
214
215
else if (strcmp (opt_splitting_heuristics, " fs" ) == 0 )
215
- shs_undirected = bliss ::Graph::shs_fs;
216
+ shs_undirected = bliss_digraphs ::Graph::shs_fs;
216
217
else if (strcmp (opt_splitting_heuristics, " fl" ) == 0 )
217
- shs_undirected = bliss ::Graph::shs_fl;
218
+ shs_undirected = bliss_digraphs ::Graph::shs_fl;
218
219
else if (strcmp (opt_splitting_heuristics, " fm" ) == 0 )
219
- shs_undirected = bliss ::Graph::shs_fm;
220
+ shs_undirected = bliss_digraphs ::Graph::shs_fm;
220
221
else if (strcmp (opt_splitting_heuristics, " fsm" ) == 0 )
221
- shs_undirected = bliss ::Graph::shs_fsm;
222
+ shs_undirected = bliss_digraphs ::Graph::shs_fsm;
222
223
else if (strcmp (opt_splitting_heuristics, " flm" ) == 0 )
223
- shs_undirected = bliss ::Graph::shs_flm;
224
+ shs_undirected = bliss_digraphs ::Graph::shs_flm;
224
225
else
225
226
_fatal (" Illegal option -sh=%s, aborting" , opt_splitting_heuristics);
226
227
}
@@ -238,34 +239,34 @@ main(const int argc, const char** argv)
238
239
if (opt_directed)
239
240
{
240
241
/* Read directed graph in the DIMACS format */
241
- g = bliss ::Digraph::read_dimacs (infile);
242
+ g = bliss_digraphs ::Digraph::read_dimacs (infile);
242
243
}
243
244
else
244
245
{
245
246
/* Read undirected graph in the DIMACS format */
246
- g = bliss ::Graph::read_dimacs (infile);
247
+ g = bliss_digraphs ::Graph::read_dimacs (infile);
247
248
}
248
-
249
+
249
250
if (infile != stdin)
250
251
fclose (infile);
251
252
252
253
if (!g)
253
254
_fatal (" Failed to read the graph, aborting" );
254
-
255
+
255
256
if (verbose_level >= 2 )
256
257
{
257
258
fprintf (verbstr, " Graph read in %.2f seconds\n " , timer.get_duration ());
258
259
fflush (verbstr);
259
260
}
260
261
261
262
262
- bliss ::Stats stats;
263
+ bliss_digraphs ::Stats stats;
263
264
264
265
/* Set splitting heuristics and verbose level */
265
266
if (opt_directed)
266
- ((bliss ::Digraph*)g)->set_splitting_heuristic (shs_directed);
267
+ ((bliss_digraphs ::Digraph*)g)->set_splitting_heuristic (shs_directed);
267
268
else
268
- ((bliss ::Graph*)g)->set_splitting_heuristic (shs_undirected);
269
+ ((bliss_digraphs ::Graph*)g)->set_splitting_heuristic (shs_undirected);
269
270
g->set_verbose_level (verbose_level);
270
271
g->set_verbose_file (verbstr);
271
272
g->set_failure_recording (opt_use_failure_recording);
@@ -283,12 +284,12 @@ main(const int argc, const char** argv)
283
284
const unsigned int * cl = g->canonical_form (stats, &report_aut, stdout);
284
285
285
286
fprintf (stdout, " Canonical labeling: " );
286
- bliss ::print_permutation (stdout, g->get_nof_vertices (), cl, 1 );
287
+ bliss_digraphs ::print_permutation (stdout, g->get_nof_vertices (), cl, 1 );
287
288
fprintf (stdout, " \n " );
288
289
289
290
if (opt_output_can_file)
290
291
{
291
- bliss ::AbstractGraph* cf = g->permute (cl);
292
+ bliss_digraphs ::AbstractGraph* cf = g->permute (cl);
292
293
FILE* const fp = fopen (opt_output_can_file, " w" );
293
294
if (!fp)
294
295
_fatal (" Cannot open '%s' for outputting the canonical form, aborting" , opt_output_can_file);
0 commit comments