↑ Collapse diff ↑
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -66,3 +66,3 @@
66 66
    .other("...");
67
  
67

	
68 68
  // Perform the parsing process
... ...
@@ -86,3 +86,3 @@
86 86
  if(ap.given("grc")) std::cout << "  -grc is given\n";
87
  
87

	
88 88
  switch(ap.files().size()) {
... ...
@@ -96,3 +96,3 @@
96 96
    std::cout << "  "
97
	      << ap.files().size() << " file arguments were given. They are:\n";
97
              << ap.files().size() << " file arguments were given. They are:\n";
98 98
  }
... ...
@@ -100,3 +100,3 @@
100 100
    std::cout << "    '" << ap.files()[i] << "'\n";
101
  
101

	
102 102
  return 0;
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -51,3 +51,3 @@
51 51
  typedef dim2::Point<int> Point;
52
  
52

	
53 53
  Node n1=g.addNode();
... ...
@@ -64,3 +64,3 @@
64 64
  ListDigraph::ArcMap<int> widths(g);
65
  
65

	
66 66
  coords[n1]=Point(50,50);  sizes[n1]=1; colors[n1]=1; shapes[n1]=0;
... ...
@@ -70,3 +70,3 @@
70 70
  coords[n5]=Point(85,60);  sizes[n5]=3; colors[n5]=5; shapes[n5]=2;
71
  
71

	
72 72
  Arc a;
... ...
@@ -80,3 +80,3 @@
80 80
  a=g.addArc(n3,n4); acolors[a]=2; widths[a]=1;
81
  
81

	
82 82
  IdMap<ListDigraph,Node> id(g);
... ...
@@ -184,3 +184,3 @@
184 184
  ListDigraph::NodeMap<Point> hcoords(h);
185
  
185

	
186 186
  int cols=int(sqrt(double(palette.size())));
... ...
@@ -191,3 +191,3 @@
191 191
  }
192
  
192

	
193 193
  cout << "Create 'graph_to_eps_demo_out_6_colors.eps'" << endl;
... ...
@@ -204,3 +204,3 @@
204 204
    run();
205
    
205

	
206 206
  return 0;
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -23,3 +23,3 @@
23 23
/// This program gives an example of how to read and write a digraph
24
/// and additional maps from/to a stream or a file using the 
24
/// and additional maps from/to a stream or a file using the
25 25
/// \ref lgf-format "LGF" format.
... ...
@@ -44,3 +44,3 @@
44 44
  SmartDigraph::Node s, t;
45
  
45

	
46 46
  try {
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -20,3 +20,3 @@
20 20

	
21
\page coding_style LEMON Coding Style 
21
\page coding_style LEMON Coding Style
22 22

	
... ...
@@ -70,3 +70,3 @@
70 70
\code
71
AllWordsCapitalizedWithoutUnderscores 
71
AllWordsCapitalizedWithoutUnderscores
72 72
\endcode
... ...
@@ -78,3 +78,3 @@
78 78
\code
79
firstWordLowerCaseRestCapitalizedWithoutUnderscores 
79
firstWordLowerCaseRestCapitalizedWithoutUnderscores
80 80
\endcode
... ...
@@ -86,6 +86,6 @@
86 86
\code
87
ALL_UPPER_CASE_WITH_UNDERSCORES 
87
ALL_UPPER_CASE_WITH_UNDERSCORES
88 88
\endcode
89 89

	
90
\subsection cs-loc-var Class and instance member variables, auto variables 
90
\subsection cs-loc-var Class and instance member variables, auto variables
91 91

	
... ...
@@ -94,3 +94,3 @@
94 94
\code
95
all_lower_case_with_underscores 
95
all_lower_case_with_underscores
96 96
\endcode
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -76,3 +76,3 @@
76 76
This directory contains some helper classes to implement graphs, maps and
77
some other classes. As a user you typically don't have to deal with these 
77
some other classes. As a user you typically don't have to deal with these
78 78
files.
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -28,6 +28,6 @@
28 28

	
29
The implementation of combinatorial algorithms heavily relies on 
30
efficient graph implementations. LEMON offers data structures which are 
31
planned to be easily used in an experimental phase of implementation studies, 
32
and thereafter the program code can be made efficient by small modifications. 
29
The implementation of combinatorial algorithms heavily relies on
30
efficient graph implementations. LEMON offers data structures which are
31
planned to be easily used in an experimental phase of implementation studies,
32
and thereafter the program code can be made efficient by small modifications.
33 33

	
... ...
@@ -42,13 +42,13 @@
42 42

	
43
Alteration of standard containers need a very limited number of 
44
operations, these together satisfy the everyday requirements. 
45
In the case of graph structures, different operations are needed which do 
46
not alter the physical graph, but gives another view. If some nodes or 
43
Alteration of standard containers need a very limited number of
44
operations, these together satisfy the everyday requirements.
45
In the case of graph structures, different operations are needed which do
46
not alter the physical graph, but gives another view. If some nodes or
47 47
arcs have to be hidden or the reverse oriented graph have to be used, then
48
this is the case. It also may happen that in a flow implementation 
49
the residual graph can be accessed by another algorithm, or a node-set 
50
is to be shrunk for another algorithm. 
51
LEMON also provides a variety of graphs for these requirements called 
52
\ref graph_adaptors "graph adaptors". Adaptors cannot be used alone but only 
53
in conjunction with other graph representations. 
48
this is the case. It also may happen that in a flow implementation
49
the residual graph can be accessed by another algorithm, or a node-set
50
is to be shrunk for another algorithm.
51
LEMON also provides a variety of graphs for these requirements called
52
\ref graph_adaptors "graph adaptors". Adaptors cannot be used alone but only
53
in conjunction with other graph representations.
54 54

	
... ...
@@ -56,3 +56,3 @@
56 56
the best, most graph algorithms and auxiliary data structures can be used
57
with any graph structures. 
57
with any graph structures.
58 58
*/
... ...
@@ -65,3 +65,3 @@
65 65
This group describes some graph types between real graphs and graph adaptors.
66
These classes wrap graphs to give new functionality as the adaptors do it. 
66
These classes wrap graphs to give new functionality as the adaptors do it.
67 67
On the other hand they are not light-weight structures as the adaptors.
... ...
@@ -70,3 +70,3 @@
70 70
/**
71
@defgroup maps Maps 
71
@defgroup maps Maps
72 72
@ingroup datas
... ...
@@ -81,3 +81,3 @@
81 81
/**
82
@defgroup graph_maps Graph Maps 
82
@defgroup graph_maps Graph Maps
83 83
@ingroup maps
... ...
@@ -117,5 +117,5 @@
117 117
  }
118
  
118

	
119 119
  Digraph::NodeMap<int> degree_map(graph);
120
  
120

	
121 121
  digraphToEps(graph, "graph.eps")
... ...
@@ -124,3 +124,3 @@
124 124
    .run();
125
\endcode 
125
\endcode
126 126
The \c functorToMap() function makes an \c int to \c Color map from the
... ...
@@ -142,3 +142,3 @@
142 142
  TimeMap time(length, speed);
143
  
143

	
144 144
  Dijkstra<Digraph, TimeMap> dijkstra(graph, time);
... ...
@@ -154,3 +154,3 @@
154 154
/**
155
@defgroup matrices Matrices 
155
@defgroup matrices Matrices
156 156
@ingroup datas
... ...
@@ -202,3 +202,3 @@
202 202

	
203
This group describes the common graph search algorithms like 
203
This group describes the common graph search algorithms like
204 204
Breadth-first search (Bfs) and Depth-first search (Dfs).
... ...
@@ -214,5 +214,5 @@
214 214

	
215
/** 
216
@defgroup max_flow Maximum Flow algorithms 
217
@ingroup algs 
215
/**
216
@defgroup max_flow Maximum Flow algorithms
217
@ingroup algs
218 218
\brief Algorithms for finding maximum flows.
... ...
@@ -233,3 +233,3 @@
233 233
LEMON contains several algorithms for solving maximum flow problems:
234
- \ref lemon::EdmondsKarp "Edmonds-Karp" 
234
- \ref lemon::EdmondsKarp "Edmonds-Karp"
235 235
- \ref lemon::Preflow "Goldberg's Preflow algorithm"
... ...
@@ -252,3 +252,3 @@
252 252
This group describes the algorithms for finding minimum cost flows and
253
circulations.  
253
circulations.
254 254
*/
... ...
@@ -256,4 +256,4 @@
256 256
/**
257
@defgroup min_cut Minimum Cut algorithms 
258
@ingroup algs 
257
@defgroup min_cut Minimum Cut algorithms
258
@ingroup algs
259 259

	
... ...
@@ -274,3 +274,3 @@
274 274
- \ref lemon::HaoOrlin "Hao-Orlin algorithm" to calculate minimum cut
275
  in directed graphs  
275
  in directed graphs
276 276
- \ref lemon::NagamochiIbaraki "Nagamochi-Ibaraki algorithm" to
... ...
@@ -309,3 +309,3 @@
309 309
/**
310
@defgroup matching Matching algorithms 
310
@defgroup matching Matching algorithms
311 311
@ingroup algs
... ...
@@ -316,3 +316,3 @@
316 316
finding a subset of the arcs which does not shares common endpoints.
317
 
317

	
318 318
There are several different algorithms for calculate matchings in
... ...
@@ -325,12 +325,12 @@
325 325
Lemon contains the next algorithms:
326
- \ref lemon::MaxBipartiteMatching "MaxBipartiteMatching" Hopcroft-Karp 
327
  augmenting path algorithm for calculate maximum cardinality matching in 
326
- \ref lemon::MaxBipartiteMatching "MaxBipartiteMatching" Hopcroft-Karp
327
  augmenting path algorithm for calculate maximum cardinality matching in
328 328
  bipartite graphs
329
- \ref lemon::PrBipartiteMatching "PrBipartiteMatching" Push-Relabel 
330
  algorithm for calculate maximum cardinality matching in bipartite graphs 
331
- \ref lemon::MaxWeightedBipartiteMatching "MaxWeightedBipartiteMatching" 
332
  Successive shortest path algorithm for calculate maximum weighted matching 
329
- \ref lemon::PrBipartiteMatching "PrBipartiteMatching" Push-Relabel
330
  algorithm for calculate maximum cardinality matching in bipartite graphs
331
- \ref lemon::MaxWeightedBipartiteMatching "MaxWeightedBipartiteMatching"
332
  Successive shortest path algorithm for calculate maximum weighted matching
333 333
  and maximum weighted bipartite matching in bipartite graph
334
- \ref lemon::MinCostMaxBipartiteMatching "MinCostMaxBipartiteMatching" 
335
  Successive shortest path algorithm for calculate minimum cost maximum 
334
- \ref lemon::MinCostMaxBipartiteMatching "MinCostMaxBipartiteMatching"
335
  Successive shortest path algorithm for calculate minimum cost maximum
336 336
  matching in bipartite graph
... ...
@@ -398,4 +398,4 @@
398 398

	
399
/** 
400
@defgroup lp_utils Tools for Lp and Mip solvers 
399
/**
400
@defgroup lp_utils Tools for Lp and Mip solvers
401 401
@ingroup lp_group
... ...
@@ -416,3 +416,3 @@
416 416
/**
417
@defgroup utils Tools and Utilities 
417
@defgroup utils Tools and Utilities
418 418
\brief Tools and utilities for programming in LEMON
... ...
@@ -469,3 +469,3 @@
469 469

	
470
This group describes the tools for importing and exporting graphs 
470
This group describes the tools for importing and exporting graphs
471 471
and graph related data. Now it supports the LEMON format, the
... ...
@@ -488,3 +488,3 @@
488 488
This group describes general \c EPS drawing methods and special
489
graph exporting tools. 
489
graph exporting tools.
490 490
*/
... ...
@@ -500,3 +500,3 @@
500 500
The purpose of the classes in this group is fourfold.
501
 
501

	
502 502
- These classes contain the documentations of the concepts. In order
... ...
@@ -553,6 +553,6 @@
553 553

	
554
Some utility applications are listed here. 
554
Some utility applications are listed here.
555 555

	
556 556
The standard compilation procedure (<tt>./configure;make</tt>) will compile
557
them, as well. 
557
them, as well.
558 558
*/
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -45,3 +45,3 @@
45 45
character sequence surrounded by double quotes, and it can also
46
contain whitespaces and escape sequences. 
46
contain whitespaces and escape sequences.
47 47

	
... ...
@@ -74,3 +74,3 @@
74 74
 @arcs
75
 	      capacity
75
               capacity
76 76
 1   2   16
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -43,3 +43,3 @@
43 43

	
44
If you want to get a quick start and see the most important features then 
44
If you want to get a quick start and see the most important features then
45 45
take a look at our \ref quicktour
... ...
@@ -47,7 +47,7 @@
47 47

	
48
If you already feel like using our library, see the page that tells you 
48
If you already feel like using our library, see the page that tells you
49 49
\ref getstart "How to start using LEMON".
50 50

	
51
If you 
52
want to see how LEMON works, see 
51
If you
52
want to see how LEMON works, see
53 53
some \ref demoprograms "demo programs"!
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -40,26 +40,26 @@
40 40
      if(i->second.self_delete)
41
	switch(i->second.type) {
42
	case BOOL:
43
	  delete i->second.bool_p;
44
	  break;
45
	case STRING:
46
	  delete i->second.string_p;
47
	  break;
48
	case DOUBLE:
49
	  delete i->second.double_p;
50
	  break;
51
	case INTEGER:
52
	  delete i->second.int_p;
53
	  break;
54
	case UNKNOWN:
55
	  break;
56
	case FUNC:
57
	  break;
58
	}
41
        switch(i->second.type) {
42
        case BOOL:
43
          delete i->second.bool_p;
44
          break;
45
        case STRING:
46
          delete i->second.string_p;
47
          break;
48
        case DOUBLE:
49
          delete i->second.double_p;
50
          break;
51
        case INTEGER:
52
          delete i->second.int_p;
53
          break;
54
        case UNKNOWN:
55
          break;
56
        case FUNC:
57
          break;
58
        }
59 59
  }
60
  
60

	
61 61

	
62 62
  ArgParser &ArgParser::intOption(const std::string &name,
63
			       const std::string &help,
64
			       int value, bool obl)
63
                               const std::string &help,
64
                               int value, bool obl)
65 65
  {
... ...
@@ -76,4 +76,4 @@
76 76
  ArgParser &ArgParser::doubleOption(const std::string &name,
77
			       const std::string &help,
78
			       double value, bool obl)
77
                               const std::string &help,
78
                               double value, bool obl)
79 79
  {
... ...
@@ -90,4 +90,4 @@
90 90
  ArgParser &ArgParser::boolOption(const std::string &name,
91
			       const std::string &help,
92
			       bool value, bool obl)
91
                               const std::string &help,
92
                               bool value, bool obl)
93 93
  {
... ...
@@ -104,4 +104,4 @@
104 104
  ArgParser &ArgParser::stringOption(const std::string &name,
105
			       const std::string &help,
106
			       std::string value, bool obl)
105
                               const std::string &help,
106
                               std::string value, bool obl)
107 107
  {
... ...
@@ -118,4 +118,4 @@
118 118
  ArgParser &ArgParser::refOption(const std::string &name,
119
			       const std::string &help,
120
			       int &ref, bool obl)
119
                               const std::string &help,
120
                               int &ref, bool obl)
121 121
  {
... ...
@@ -163,4 +163,4 @@
163 163
  ArgParser &ArgParser::refOption(const std::string &name,
164
			       const std::string &help,
165
			       std::string &ref, bool obl)
164
                               const std::string &help,
165
                               std::string &ref, bool obl)
166 166
  {
... ...
@@ -177,4 +177,4 @@
177 177
  ArgParser &ArgParser::funcOption(const std::string &name,
178
			       const std::string &help,
179
			       void (*func)(void *),void *data)
178
                               const std::string &help,
179
                               void (*func)(void *),void *data)
180 180
  {
... ...
@@ -192,3 +192,3 @@
192 192
  ArgParser &ArgParser::optionGroup(const std::string &group,
193
				    const std::string &opt)
193
                                    const std::string &opt)
194 194
  {
... ...
@@ -196,3 +196,3 @@
196 196
    LEMON_ASSERT(i!=_opts.end(), "Unknown option: '"+opt+"'");
197
    LEMON_ASSERT(!(i->second.ingroup), 
197
    LEMON_ASSERT(!(i->second.ingroup),
198 198
                 "Option already in option group: '"+opt+"'");
... ...
@@ -212,3 +212,3 @@
212 212
  ArgParser &ArgParser::synonym(const std::string &syn,
213
				const std::string &opt)
213
                                const std::string &opt)
214 214
  {
... ...
@@ -235,3 +235,3 @@
235 235
  ArgParser &ArgParser::other(const std::string &name,
236
			      const std::string &help)
236
                              const std::string &help)
237 237
  {
... ...
@@ -246,4 +246,4 @@
246 246
      for(Opts::iterator j=_opts.begin();j!=_opts.end();++j)
247
	if(j->second.syn&&j->second.help==i->first)
248
	  os << "|-" << j->first;
247
        if(j->second.syn&&j->second.help==i->first)
248
          os << "|-" << j->first;
249 249
    switch(i->second.type) {
... ...
@@ -272,3 +272,3 @@
272 272
  }
273
    
273

	
274 274
  void ArgParser::showHelp(Opts::iterator i)
... ...
@@ -285,5 +285,5 @@
285 285
    std::cerr << "  " << i->name << std::endl
286
	      << "     " << i->help << std::endl;
286
              << "     " << i->help << std::endl;
287 287
  }
288
    
288

	
289 289
  void ArgParser::shortHelp()
... ...
@@ -301,4 +301,4 @@
301 301
      if(pos+cstr.str().size()>LINE_LEN) {
302
	std::cerr << std::endl << indent;
303
	pos=indent.size();
302
        std::cerr << std::endl << indent;
303
        pos=indent.size();
304 304
      }
... ...
@@ -309,26 +309,26 @@
309 309
      if(!i->second.ingroup&&!i->second.syn) {
310
	std::ostringstream cstr;
311
	cstr << ' ';
312
	if(!i->second.mandatory) cstr << '[';
313
	show(cstr,i);
314
	if(!i->second.mandatory) cstr << ']';
315
	if(pos+cstr.str().size()>LINE_LEN) {
316
	  std::cerr << std::endl << indent;
317
	  pos=indent.size();
318
	}
319
	std::cerr << cstr.str();
320
	pos+=cstr.str().size();
310
        std::ostringstream cstr;
311
        cstr << ' ';
312
        if(!i->second.mandatory) cstr << '[';
313
        show(cstr,i);
314
        if(!i->second.mandatory) cstr << ']';
315
        if(pos+cstr.str().size()>LINE_LEN) {
316
          std::cerr << std::endl << indent;
317
          pos=indent.size();
318
        }
319
        std::cerr << cstr.str();
320
        pos+=cstr.str().size();
321 321
      }
322 322
    for(std::vector<OtherArg>::iterator i=_others_help.begin();
323
	i!=_others_help.end();++i)
323
        i!=_others_help.end();++i)
324 324
      {
325
	std::ostringstream cstr;
326
	cstr << ' ' << i->name;
327
      
328
	if(pos+cstr.str().size()>LINE_LEN) {
329
	  std::cerr << std::endl << indent;
330
	  pos=indent.size();
331
	}
332
	std::cerr << cstr.str();
333
	pos+=cstr.str().size();
325
        std::ostringstream cstr;
326
        cstr << ' ' << i->name;
327

	
328
        if(pos+cstr.str().size()>LINE_LEN) {
329
          std::cerr << std::endl << indent;
330
          pos=indent.size();
331
        }
332
        std::cerr << cstr.str();
333
        pos+=cstr.str().size();
334 334
      }
... ...
@@ -336,3 +336,3 @@
336 336
  }
337
    
337

	
338 338
  void ArgParser::showHelp()
... ...
@@ -342,3 +342,3 @@
342 342
    for(std::vector<OtherArg>::iterator i=_others_help.begin();
343
	i!=_others_help.end();++i) showHelp(i);
343
        i!=_others_help.end();++i) showHelp(i);
344 344
    for(Opts::iterator i=_opts.begin();i!=_opts.end();++i) showHelp(i);
... ...
@@ -346,5 +346,5 @@
346 346
  }
347
    
348
      
349
  void ArgParser::unknownOpt(std::string arg) 
347

	
348

	
349
  void ArgParser::unknownOpt(std::string arg)
350 350
  {
... ...
@@ -355,4 +355,4 @@
355 355
  }
356
    
357
  void ArgParser::requiresValue(std::string arg, OptType t) 
356

	
357
  void ArgParser::requiresValue(std::string arg, OptType t)
358 358
  {
... ...
@@ -375,3 +375,3 @@
375 375
  }
376
    
376

	
377 377

	
... ...
@@ -381,37 +381,37 @@
381 381
    for(Opts::iterator i=_opts.begin();i!=_opts.end();++i)
382
      if(i->second.mandatory&&!i->second.set) 
383
	{
384
	  if(ok)
385
	    std::cerr << _command_name 
386
		      << ": The following mandatory arguments are missing.\n";
387
	  ok=false;
388
	  showHelp(i);
389
	}
382
      if(i->second.mandatory&&!i->second.set)
383
        {
384
          if(ok)
385
            std::cerr << _command_name
386
                      << ": The following mandatory arguments are missing.\n";
387
          ok=false;
388
          showHelp(i);
389
        }
390 390
    for(Groups::iterator i=_groups.begin();i!=_groups.end();++i)
391 391
      if(i->second.mandatory||i->second.only_one)
392
	{
393
	  int set=0;
394
	  for(GroupData::Opts::iterator o=i->second.opts.begin();
395
	      o!=i->second.opts.end();++o)
396
	    if(_opts.find(*o)->second.set) ++set;
397
	  if(i->second.mandatory&&!set) {
398
	    std::cerr << _command_name 
399
		      << ": At least one of the following arguments is mandatory.\n";
400
	    ok=false;
401
	    for(GroupData::Opts::iterator o=i->second.opts.begin();
402
		o!=i->second.opts.end();++o)
403
	      showHelp(_opts.find(*o));
404
	  }
405
	  if(i->second.only_one&&set>1) {
406
	    std::cerr << _command_name 
407
		      << ": At most one of the following arguments can be given.\n";
408
	    ok=false;
409
	    for(GroupData::Opts::iterator o=i->second.opts.begin();
410
		o!=i->second.opts.end();++o)
411
	      showHelp(_opts.find(*o));
412
	  }
413
	}
392
        {
393
          int set=0;
394
          for(GroupData::Opts::iterator o=i->second.opts.begin();
395
              o!=i->second.opts.end();++o)
396
            if(_opts.find(*o)->second.set) ++set;
397
          if(i->second.mandatory&&!set) {
398
            std::cerr << _command_name
399
                      << ": At least one of the following arguments is mandatory.\n";
400
            ok=false;
401
            for(GroupData::Opts::iterator o=i->second.opts.begin();
402
                o!=i->second.opts.end();++o)
403
              showHelp(_opts.find(*o));
404
          }
405
          if(i->second.only_one&&set>1) {
406
            std::cerr << _command_name
407
                      << ": At most one of the following arguments can be given.\n";
408
            ok=false;
409
            for(GroupData::Opts::iterator o=i->second.opts.begin();
410
                o!=i->second.opts.end();++o)
411
              showHelp(_opts.find(*o));
412
          }
413
        }
414 414
    if(!ok) {
415 415
      std::cerr << "\nType '" << _command_name <<
416
	" --help' to obtain a short summary on the usage.\n\n";
416
        " --help' to obtain a short summary on the usage.\n\n";
417 417
      exit(1);
... ...
@@ -425,34 +425,34 @@
425 425
      if (arg[0] != '-' || arg.size() == 1) {
426
	_file_args.push_back(arg);
426
        _file_args.push_back(arg);
427 427
      }
428 428
      else {
429
	Opts::iterator i = _opts.find(arg.substr(1));
430
	if(i==_opts.end()) unknownOpt(arg);
431
	else {
432
	  if(i->second.syn) i=_opts.find(i->second.help);
433
	  ParData &p(i->second);
434
	  if (p.type==BOOL) *p.bool_p=true;
435
	  else if (p.type==FUNC) p.func_p.p(p.func_p.data);
436
	  else if(++ar==_argc) requiresValue(arg, p.type);
437
	  else {
438
	    std::string val(_argv[ar]);
439
	    std::istringstream vals(val);
440
	    switch(p.type) {
441
	    case STRING:
442
	      *p.string_p=val;
443
	      break;
444
	    case INTEGER:
445
	      vals >> *p.int_p;
446
	      break;
447
	    case DOUBLE:
448
	      vals >> *p.double_p;
449
	      break;
450
	    default:
451
	      break;
452
	    }
453
	    if(p.type!=STRING&&(!vals||!vals.eof()))
454
	      requiresValue(arg, p.type);
455
	  }
456
	  p.set = true;
457
	}
429
        Opts::iterator i = _opts.find(arg.substr(1));
430
        if(i==_opts.end()) unknownOpt(arg);
431
        else {
432
          if(i->second.syn) i=_opts.find(i->second.help);
433
          ParData &p(i->second);
434
          if (p.type==BOOL) *p.bool_p=true;
435
          else if (p.type==FUNC) p.func_p.p(p.func_p.data);
436
          else if(++ar==_argc) requiresValue(arg, p.type);
437
          else {
438
            std::string val(_argv[ar]);
439
            std::istringstream vals(val);
440
            switch(p.type) {
441
            case STRING:
442
              *p.string_p=val;
443
              break;
444
            case INTEGER:
445
              vals >> *p.int_p;
446
              break;
447
            case DOUBLE:
448
              vals >> *p.double_p;
449
              break;
450
            default:
451
              break;
452
            }
453
            if(p.type!=STRING&&(!vals||!vals.eof()))
454
              requiresValue(arg, p.type);
455
          }
456
          p.set = true;
457
        }
458 458
      }
... ...
@@ -462,3 +462,3 @@
462 462
    return *this;
463
  }  
463
  }
464 464

	
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -43,11 +43,11 @@
43 43
  class ArgParser {
44
    
44

	
45 45
    static void _showHelp(void *p);
46 46
  protected:
47
    
47

	
48 48
    int _argc;
49 49
    const char **_argv;
50
    
50

	
51 51
    enum OptType { UNKNOWN=0, BOOL=1, STRING=2, DOUBLE=3, INTEGER=4, FUNC=5 };
52
    
52

	
53 53
    class ParData {
... ...
@@ -55,11 +55,11 @@
55 55
      union {
56
	bool *bool_p;
57
	int *int_p;
58
	double *double_p;
59
	std::string *string_p;
60
	struct {
61
	  void (*p)(void *);
62
	  void *data;
63
	} func_p;
64
	  
56
        bool *bool_p;
57
        int *int_p;
58
        double *double_p;
59
        std::string *string_p;
60
        struct {
61
          void (*p)(void *);
62
          void *data;
63
        } func_p;
64

	
65 65
      };
... ...
@@ -74,3 +74,3 @@
74 74
      ParData() : mandatory(false), type(UNKNOWN), set(false), ingroup(false),
75
		  has_syn(false), syn(false), self_delete(false) {}
75
                  has_syn(false), syn(false), self_delete(false) {}
76 76
    };
... ...
@@ -80,3 +80,3 @@
80 80

	
81
    class GroupData 
81
    class GroupData
82 82
    {
... ...
@@ -89,3 +89,3 @@
89 89
    };
90
      
90

	
91 91
    typedef std::map<std::string,GroupData> Groups;
... ...
@@ -100,3 +100,3 @@
100 100
    };
101
      
101

	
102 102
    std::vector<OtherArg> _others_help;
... ...
@@ -105,3 +105,3 @@
105 105

	
106
    
106

	
107 107
  private:
... ...
@@ -115,5 +115,5 @@
115 115
    ArgParser &funcOption(const std::string &name,
116
		    const std::string &help,
117
		    void (*func)(void *),void *data);
118
    
116
                    const std::string &help,
117
                    void (*func)(void *),void *data);
118

	
119 119
  public:
... ...
@@ -138,4 +138,4 @@
138 138
    ArgParser &intOption(const std::string &name,
139
		    const std::string &help,
140
		    int value=0, bool obl=false);
139
                    const std::string &help,
140
                    int value=0, bool obl=false);
141 141

	
... ...
@@ -149,4 +149,4 @@
149 149
    ArgParser &doubleOption(const std::string &name,
150
		      const std::string &help,
151
		      double value=0, bool obl=false);
150
                      const std::string &help,
151
                      double value=0, bool obl=false);
152 152

	
... ...
@@ -161,4 +161,4 @@
161 161
    ArgParser &boolOption(const std::string &name,
162
		      const std::string &help,
163
		      bool value=false, bool obl=false);
162
                      const std::string &help,
163
                      bool value=false, bool obl=false);
164 164

	
... ...
@@ -172,4 +172,4 @@
172 172
    ArgParser &stringOption(const std::string &name,
173
		      const std::string &help,
174
		      std::string value="", bool obl=false);
173
                      const std::string &help,
174
                      std::string value="", bool obl=false);
175 175

	
... ...
@@ -181,4 +181,4 @@
181 181
    ArgParser &other(const std::string &name,
182
		     const std::string &help="");
183
    
182
                     const std::string &help="");
183

	
184 184
    ///@}
... ...
@@ -199,4 +199,4 @@
199 199
    ArgParser &refOption(const std::string &name,
200
		    const std::string &help,
201
		    int &ref, bool obl=false);
200
                    const std::string &help,
201
                    int &ref, bool obl=false);
202 202

	
... ...
@@ -210,4 +210,4 @@
210 210
    ArgParser &refOption(const std::string &name,
211
		      const std::string &help,
212
		      double &ref, bool obl=false);
211
                      const std::string &help,
212
                      double &ref, bool obl=false);
213 213

	
... ...
@@ -222,4 +222,4 @@
222 222
    ArgParser &refOption(const std::string &name,
223
		      const std::string &help,
224
		      bool &ref, bool obl=false);
223
                      const std::string &help,
224
                      bool &ref, bool obl=false);
225 225

	
... ...
@@ -233,5 +233,5 @@
233 233
    ArgParser &refOption(const std::string &name,
234
		      const std::string &help,
235
		      std::string &ref, bool obl=false);
236
    
234
                      const std::string &help,
235
                      std::string &ref, bool obl=false);
236

	
237 237
    ///@}
... ...
@@ -240,3 +240,3 @@
240 240
    ///
241
    
241

	
242 242
    ///@{
... ...
@@ -250,3 +250,3 @@
250 250
    ArgParser &optionGroup(const std::string &group,
251
			   const std::string &opt);
251
                           const std::string &opt);
252 252

	
... ...
@@ -257,3 +257,3 @@
257 257
    ArgParser &onlyOneGroup(const std::string &group);
258
  
258

	
259 259
    ///Make a group mandatory
... ...
@@ -263,3 +263,3 @@
263 263
    ArgParser &mandatoryGroup(const std::string &group);
264
    
264

	
265 265
    ///Create synonym to an option
... ...
@@ -269,4 +269,4 @@
269 269
    ArgParser &synonym(const std::string &syn,
270
			   const std::string &opt);
271
    
270
                           const std::string &opt);
271

	
272 272
    ///@}
... ...
@@ -284,3 +284,3 @@
284 284
    void checkMandatories();
285
    
285

	
286 286
    ///Start the parsing process
... ...
@@ -289,3 +289,3 @@
289 289
    /// Synonym for parse()
290
    ArgParser &run() 
290
    ArgParser &run()
291 291
    {
... ...
@@ -293,3 +293,3 @@
293 293
    }
294
    
294

	
295 295
    ///Give back the command name (the 0th argument)
... ...
@@ -298,3 +298,3 @@
298 298
    ///Check if an opion has been given to the command.
299
    bool given(std::string op) 
299
    bool given(std::string op)
300 300
    {
... ...
@@ -306,3 +306,3 @@
306 306
    ///Magic type for operator[]
307
    
307

	
308 308
    ///This is the type of the return value of ArgParser::operator[]().
... ...
@@ -311,3 +311,3 @@
311 311
    ///throws an exception (i.e. it performs runtime type checking).
312
    class RefType 
312
    class RefType
313 313
    {
... ...
@@ -319,10 +319,10 @@
319 319
      ///\e
320
      operator bool() 
320
      operator bool()
321 321
      {
322
	Opts::iterator i = _parser._opts.find(_name);
323
	LEMON_ASSERT(i!=_parser._opts.end(),
324
		     std::string()+"Unkown option: '"+_name+"'");
325
	LEMON_ASSERT(i->second.type==ArgParser::BOOL,
326
		     std::string()+"'"+_name+"' is a bool option");
327
	return *(i->second.bool_p);
322
        Opts::iterator i = _parser._opts.find(_name);
323
        LEMON_ASSERT(i!=_parser._opts.end(),
324
                     std::string()+"Unkown option: '"+_name+"'");
325
        LEMON_ASSERT(i->second.type==ArgParser::BOOL,
326
                     std::string()+"'"+_name+"' is a bool option");
327
        return *(i->second.bool_p);
328 328
      }
... ...
@@ -331,30 +331,30 @@
331 331
      {
332
	Opts::iterator i = _parser._opts.find(_name);
333
	LEMON_ASSERT(i!=_parser._opts.end(),
334
		     std::string()+"Unkown option: '"+_name+"'");
335
	LEMON_ASSERT(i->second.type==ArgParser::STRING,
336
		     std::string()+"'"+_name+"' is a string option");
337
	return *(i->second.string_p);
332
        Opts::iterator i = _parser._opts.find(_name);
333
        LEMON_ASSERT(i!=_parser._opts.end(),
334
                     std::string()+"Unkown option: '"+_name+"'");
335
        LEMON_ASSERT(i->second.type==ArgParser::STRING,
336
                     std::string()+"'"+_name+"' is a string option");
337
        return *(i->second.string_p);
338 338
      }
339 339
      ///\e
340
      operator double() 
340
      operator double()
341 341
      {
342
	Opts::iterator i = _parser._opts.find(_name);
343
	LEMON_ASSERT(i!=_parser._opts.end(),
344
		     std::string()+"Unkown option: '"+_name+"'");
345
	LEMON_ASSERT(i->second.type==ArgParser::DOUBLE ||
346
		     i->second.type==ArgParser::INTEGER,
347
		     std::string()+"'"+_name+"' is a floating point option");
348
	return i->second.type==ArgParser::DOUBLE ?
349
	  *(i->second.double_p) : *(i->second.int_p);
342
        Opts::iterator i = _parser._opts.find(_name);
343
        LEMON_ASSERT(i!=_parser._opts.end(),
344
                     std::string()+"Unkown option: '"+_name+"'");
345
        LEMON_ASSERT(i->second.type==ArgParser::DOUBLE ||
346
                     i->second.type==ArgParser::INTEGER,
347
                     std::string()+"'"+_name+"' is a floating point option");
348
        return i->second.type==ArgParser::DOUBLE ?
349
          *(i->second.double_p) : *(i->second.int_p);
350 350
      }
351 351
      ///\e
352
      operator int() 
352
      operator int()
353 353
      {
354
	Opts::iterator i = _parser._opts.find(_name);
355
	LEMON_ASSERT(i!=_parser._opts.end(),
356
		     std::string()+"Unkown option: '"+_name+"'");
357
	LEMON_ASSERT(i->second.type==ArgParser::INTEGER,
358
		     std::string()+"'"+_name+"' is an integer option");
359
	return *(i->second.int_p);
354
        Opts::iterator i = _parser._opts.find(_name);
355
        LEMON_ASSERT(i!=_parser._opts.end(),
356
                     std::string()+"Unkown option: '"+_name+"'");
357
        LEMON_ASSERT(i->second.type==ArgParser::INTEGER,
358
                     std::string()+"'"+_name+"' is an integer option");
359
        return *(i->second.int_p);
360 360
      }
... ...
@@ -364,3 +364,3 @@
364 364
    ///Give back the value of an option
365
    
365

	
366 366
    ///Give back the value of an option.
... ...
@@ -370,3 +370,3 @@
370 370
      return RefType(*this, n);
371
    }    
371
    }
372 372

	
... ...
@@ -377,3 +377,3 @@
377 377
    std::vector<std::string> &files() { return _file_args; }
378
 
378

	
379 379
  };
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -30,3 +30,3 @@
30 30
  inline void assert_fail_log(const char *file, int line, const char *function,
31
			      const char *message, const char *assertion)
31
                              const char *message, const char *assertion)
32 32
  {
... ...
@@ -42,4 +42,4 @@
42 42
  inline void assert_fail_abort(const char *file, int line,
43
				const char *function, const char* message,
44
				const char *assertion)
43
                                const char *function, const char* message,
44
                                const char *assertion)
45 45
  {
... ...
@@ -50,4 +50,4 @@
50 50
  namespace _assert_bits {
51
    
52
    
51

	
52

	
53 53
    inline const char* cstringify(const std::string& str) {
... ...
@@ -58,3 +58,3 @@
58 58
      return str;
59
    }    
59
    }
60 60
  }
... ...
@@ -68,4 +68,4 @@
68 68

	
69
#if (defined(LEMON_ASSERT_LOG) ? 1 : 0) +		\
70
  (defined(LEMON_ASSERT_ABORT) ? 1 : 0) +		\
69
#if (defined(LEMON_ASSERT_LOG) ? 1 : 0) +                \
70
  (defined(LEMON_ASSERT_ABORT) ? 1 : 0) +                \
71 71
  (defined(LEMON_ASSERT_CUSTOM) ? 1 : 0) > 1
... ...
@@ -74,7 +74,7 @@
74 74

	
75
#if ((defined(LEMON_ASSERT_LOG) ? 1 : 0) +		\
76
     (defined(LEMON_ASSERT_ABORT) ? 1 : 0) +		\
77
     (defined(LEMON_ASSERT_CUSTOM) ? 1 : 0) == 1 ||	\
78
     defined(LEMON_ENABLE_ASSERTS)) &&			\
79
  (defined(LEMON_DISABLE_ASSERTS) ||			\
75
#if ((defined(LEMON_ASSERT_LOG) ? 1 : 0) +                \
76
     (defined(LEMON_ASSERT_ABORT) ? 1 : 0) +                \
77
     (defined(LEMON_ASSERT_CUSTOM) ? 1 : 0) == 1 ||        \
78
     defined(LEMON_ENABLE_ASSERTS)) &&                        \
79
  (defined(LEMON_DISABLE_ASSERTS) ||                        \
80 80
   defined(NDEBUG))
... ...
@@ -138,3 +138,3 @@
138 138
/// The checking is also disabled when the standard macro \c NDEBUG is defined.
139
/// 
139
///
140 140
/// The LEMON assertion system has a wide range of customization
... ...
@@ -143,3 +143,3 @@
143 143
///
144
/// The following modes can be used in the assertion system: 
144
/// The following modes can be used in the assertion system:
145 145
///
... ...
@@ -157,3 +157,3 @@
157 157
///   The name of the function should be defined as the \c
158
///   LEMON_CUSTOM_ASSERT_HANDLER macro name. 
158
///   LEMON_CUSTOM_ASSERT_HANDLER macro name.
159 159
///   \code
... ...
@@ -168,7 +168,7 @@
168 168
/// behaviour is changed appropiately to the new settings.
169
#  define LEMON_ASSERT(exp, msg)					\
170
  (static_cast<void> (!!(exp) ? 0 : (					\
171
    LEMON_ASSERT_HANDLER(__FILE__, __LINE__,				\
172
			 LEMON_FUNCTION_NAME,				\
173
			 ::lemon::_assert_bits::cstringify(msg), #exp), 0)))
169
#  define LEMON_ASSERT(exp, msg)                                        \
170
  (static_cast<void> (!!(exp) ? 0 : (                                        \
171
    LEMON_ASSERT_HANDLER(__FILE__, __LINE__,                                \
172
                         LEMON_FUNCTION_NAME,                                \
173
                         ::lemon::_assert_bits::cstringify(msg), #exp), 0)))
174 174

	
... ...
@@ -184,7 +184,7 @@
184 184
///
185
/// \see LEMON_ASSERT 
186
#  define LEMON_FIXME(msg)						\
187
  (LEMON_ASSERT_HANDLER(__FILE__, __LINE__, LEMON_FUNCTION_NAME,	\
188
			::lemon::_assert_bits::cstringify(msg),		\
189
			static_cast<const char*>(0)))
185
/// \see LEMON_ASSERT
186
#  define LEMON_FIXME(msg)                                                \
187
  (LEMON_ASSERT_HANDLER(__FILE__, __LINE__, LEMON_FUNCTION_NAME,        \
188
                        ::lemon::_assert_bits::cstringify(msg),                \
189
                        static_cast<const char*>(0)))
190 190

	
... ...
@@ -212,8 +212,8 @@
212 212
///
213
/// \see LEMON_ASSERT 
214
#  define LEMON_DEBUG(exp, msg)						\
215
  (static_cast<void> (!!(exp) ? 0 : (					\
213
/// \see LEMON_ASSERT
214
#  define LEMON_DEBUG(exp, msg)                                                \
215
  (static_cast<void> (!!(exp) ? 0 : (                                        \
216 216
    LEMON_ASSERT_HANDLER(__FILE__, __LINE__,                            \
217
			 LEMON_FUNCTION_NAME,				\
218
			 ::lemon::_assert_bits::cstringify(msg), #exp), 0)))
217
                         LEMON_FUNCTION_NAME,                                \
218
                         ::lemon::_assert_bits::cstringify(msg), #exp), 0)))
219 219

	
... ...
@@ -226,12 +226,12 @@
226 226
#  else
227
#    define LEMON_ASSERT(exp, msg)					\
228
       (static_cast<void> (!!(exp) ? 0 : (				\
227
#    define LEMON_ASSERT(exp, msg)                                        \
228
       (static_cast<void> (!!(exp) ? 0 : (                                \
229 229
        LEMON_ASSERT_HANDLER(__FILE__, __LINE__,                        \
230
			     LEMON_FUNCTION_NAME,			\
231
			     ::lemon::_assert_bits::cstringify(msg),	\
232
			     #exp), 0)))
233
#    define LEMON_FIXME(msg)						\
234
       (LEMON_ASSERT_HANDLER(__FILE__, __LINE__, LEMON_FUNCTION_NAME,	\
235
			     ::lemon::_assert_bits::cstringify(msg),	\
236
			     static_cast<const char*>(0)))
230
                             LEMON_FUNCTION_NAME,                        \
231
                             ::lemon::_assert_bits::cstringify(msg),        \
232
                             #exp), 0)))
233
#    define LEMON_FIXME(msg)                                                \
234
       (LEMON_ASSERT_HANDLER(__FILE__, __LINE__, LEMON_FUNCTION_NAME,        \
235
                             ::lemon::_assert_bits::cstringify(msg),        \
236
                             static_cast<const char*>(0)))
237 237

	
... ...
@@ -242,4 +242,4 @@
242 242
                                LEMON_FUNCTION_NAME, \
243
				::lemon::_assert_bits::cstringify(msg),	\
244
				#exp), 0)))
243
                                ::lemon::_assert_bits::cstringify(msg),        \
244
                                #exp), 0)))
245 245
#    else
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -35,3 +35,3 @@
35 35

	
36
  
36

	
37 37
  ///Default traits class of Bfs class.
... ...
@@ -43,3 +43,3 @@
43 43
  {
44
    ///The digraph type the algorithm runs on. 
44
    ///The digraph type the algorithm runs on.
45 45
    typedef GR Digraph;
... ...
@@ -47,3 +47,3 @@
47 47
    ///arcs of the shortest paths.
48
    /// 
48
    ///
49 49
    ///The type of the map that stores the last
... ...
@@ -54,7 +54,7 @@
54 54
    ///Instantiates a PredMap.
55
 
56
    ///This function instantiates a \ref PredMap. 
55

	
56
    ///This function instantiates a \ref PredMap.
57 57
    ///\param G is the digraph, to which we would like to define the PredMap.
58 58
    ///\todo The digraph alone may be insufficient to initialize
59
    static PredMap *createPredMap(const GR &G) 
59
    static PredMap *createPredMap(const GR &G)
60 60
    {
... ...
@@ -63,3 +63,3 @@
63 63
    ///The type of the map that indicates which nodes are processed.
64
 
64

	
65 65
    ///The type of the map that indicates which nodes are processed.
... ...
@@ -69,4 +69,4 @@
69 69
    ///Instantiates a ProcessedMap.
70
 
71
    ///This function instantiates a \ref ProcessedMap. 
70

	
71
    ///This function instantiates a \ref ProcessedMap.
72 72
    ///\param g is the digraph, to which
... ...
@@ -82,3 +82,3 @@
82 82
    ///The type of the map that indicates which nodes are reached.
83
 
83

	
84 84
    ///The type of the map that indicates which nodes are reached.
... ...
@@ -88,4 +88,4 @@
88 88
    ///Instantiates a ReachedMap.
89
 
90
    ///This function instantiates a \ref ReachedMap. 
89

	
90
    ///This function instantiates a \ref ReachedMap.
91 91
    ///\param G is the digraph, to which
... ...
@@ -97,3 +97,3 @@
97 97
    ///The type of the map that stores the dists of the nodes.
98
 
98

	
99 99
    ///The type of the map that stores the dists of the nodes.
... ...
@@ -103,4 +103,4 @@
103 103
    ///Instantiates a DistMap.
104
 
105
    ///This function instantiates a \ref DistMap. 
104

	
105
    ///This function instantiates a \ref DistMap.
106 106
    ///\param G is the digraph, to which we would like to define the \ref DistMap
... ...
@@ -111,5 +111,5 @@
111 111
  };
112
  
112

	
113 113
  ///%BFS algorithm class.
114
  
114

	
115 115
  ///\ingroup search
... ...
@@ -128,6 +128,6 @@
128 128
  template <typename GR,
129
	    typename TR>
129
            typename TR>
130 130
#else
131 131
  template <typename GR=ListDigraph,
132
	    typename TR=BfsDefaultTraits<GR> >
132
            typename TR=BfsDefaultTraits<GR> >
133 133
#endif
... ...
@@ -144,3 +144,3 @@
144 144
      virtual const char* what() const throw() {
145
	return "lemon::Bfs::UninitializedParameter";
145
        return "lemon::Bfs::UninitializedParameter";
146 146
      }
... ...
@@ -151,3 +151,3 @@
151 151
    typedef typename TR::Digraph Digraph;
152
    
152

	
153 153
    ///\brief The type of the map that stores the last
... ...
@@ -192,21 +192,21 @@
192 192
    ///Creates the maps if necessary.
193
    
193

	
194 194
    ///\todo Better memory allocation (instead of new).
195
    void create_maps() 
195
    void create_maps()
196 196
    {
197 197
      if(!_pred) {
198
	local_pred = true;
199
	_pred = Traits::createPredMap(*G);
198
        local_pred = true;
199
        _pred = Traits::createPredMap(*G);
200 200
      }
201 201
      if(!_dist) {
202
	local_dist = true;
203
	_dist = Traits::createDistMap(*G);
202
        local_dist = true;
203
        _dist = Traits::createDistMap(*G);
204 204
      }
205 205
      if(!_reached) {
206
	local_reached = true;
207
	_reached = Traits::createReachedMap(*G);
206
        local_reached = true;
207
        _reached = Traits::createReachedMap(*G);
208 208
      }
209 209
      if(!_processed) {
210
	local_processed = true;
211
	_processed = Traits::createProcessedMap(*G);
210
        local_processed = true;
211
        _processed = Traits::createProcessedMap(*G);
212 212
      }
... ...
@@ -215,7 +215,7 @@
215 215
  protected:
216
    
216

	
217 217
    Bfs() {}
218
    
218

	
219 219
  public:
220
 
220

	
221 221
    typedef Bfs Create;
... ...
@@ -229,5 +229,5 @@
229 229
      typedef T PredMap;
230
      static PredMap *createPredMap(const Digraph &) 
230
      static PredMap *createPredMap(const Digraph &)
231 231
      {
232
	throw UninitializedParameter();
232
        throw UninitializedParameter();
233 233
      }
... ...
@@ -240,6 +240,6 @@
240 240
    template <class T>
241
    struct DefPredMap : public Bfs< Digraph, DefPredMapTraits<T> > { 
241
    struct DefPredMap : public Bfs< Digraph, DefPredMapTraits<T> > {
242 242
      typedef Bfs< Digraph, DefPredMapTraits<T> > Create;
243 243
    };
244
    
244

	
245 245
    template <class T>
... ...
@@ -247,5 +247,5 @@
247 247
      typedef T DistMap;
248
      static DistMap *createDistMap(const Digraph &) 
248
      static DistMap *createDistMap(const Digraph &)
249 249
      {
250
	throw UninitializedParameter();
250
        throw UninitializedParameter();
251 251
      }
... ...
@@ -258,6 +258,6 @@
258 258
    template <class T>
259
    struct DefDistMap : public Bfs< Digraph, DefDistMapTraits<T> > { 
259
    struct DefDistMap : public Bfs< Digraph, DefDistMapTraits<T> > {
260 260
      typedef Bfs< Digraph, DefDistMapTraits<T> > Create;
261 261
    };
262
    
262

	
263 263
    template <class T>
... ...
@@ -265,5 +265,5 @@
265 265
      typedef T ReachedMap;
266
      static ReachedMap *createReachedMap(const Digraph &) 
266
      static ReachedMap *createReachedMap(const Digraph &)
267 267
      {
268
	throw UninitializedParameter();
268
        throw UninitializedParameter();
269 269
      }
... ...
@@ -276,6 +276,6 @@
276 276
    template <class T>
277
    struct DefReachedMap : public Bfs< Digraph, DefReachedMapTraits<T> > { 
277
    struct DefReachedMap : public Bfs< Digraph, DefReachedMapTraits<T> > {
278 278
      typedef Bfs< Digraph, DefReachedMapTraits<T> > Create;
279 279
    };
280
    
280

	
281 281
    template <class T>
... ...
@@ -283,5 +283,5 @@
283 283
      typedef T ProcessedMap;
284
      static ProcessedMap *createProcessedMap(const Digraph &) 
284
      static ProcessedMap *createProcessedMap(const Digraph &)
285 285
      {
286
	throw UninitializedParameter();
286
        throw UninitializedParameter();
287 287
      }
... ...
@@ -297,8 +297,8 @@
297 297
    };
298
    
298

	
299 299
    struct DefDigraphProcessedMapTraits : public Traits {
300 300
      typedef typename Digraph::template NodeMap<bool> ProcessedMap;
301
      static ProcessedMap *createProcessedMap(const Digraph &G) 
301
      static ProcessedMap *createProcessedMap(const Digraph &G)
302 302
      {
303
	return new ProcessedMap(G);
303
        return new ProcessedMap(G);
304 304
      }
... ...
@@ -313,12 +313,12 @@
313 313
    struct DefProcessedMapToBeDefaultMap :
314
      public Bfs< Digraph, DefDigraphProcessedMapTraits> { 
314
      public Bfs< Digraph, DefDigraphProcessedMapTraits> {
315 315
      typedef Bfs< Digraph, DefDigraphProcessedMapTraits> Create;
316 316
    };
317
    
317

	
318 318
    ///@}
319 319

	
320
  public:      
321
    
320
  public:
321

	
322 322
    ///Constructor.
323
    
323

	
324 324
    ///\param _G the digraph the algorithm will run on.
... ...
@@ -332,5 +332,5 @@
332 332
    { }
333
    
333

	
334 334
    ///Destructor.
335
    ~Bfs() 
335
    ~Bfs()
336 336
    {
... ...
@@ -349,7 +349,7 @@
349 349
    ///\return <tt> (*this) </tt>
350
    Bfs &predMap(PredMap &m) 
350
    Bfs &predMap(PredMap &m)
351 351
    {
352 352
      if(local_pred) {
353
	delete _pred;
354
	local_pred=false;
353
        delete _pred;
354
        local_pred=false;
355 355
      }
... ...
@@ -366,7 +366,7 @@
366 366
    ///\return <tt> (*this) </tt>
367
    Bfs &reachedMap(ReachedMap &m) 
367
    Bfs &reachedMap(ReachedMap &m)
368 368
    {
369 369
      if(local_reached) {
370
	delete _reached;
371
	local_reached=false;
370
        delete _reached;
371
        local_reached=false;
372 372
      }
... ...
@@ -383,7 +383,7 @@
383 383
    ///\return <tt> (*this) </tt>
384
    Bfs &processedMap(ProcessedMap &m) 
384
    Bfs &processedMap(ProcessedMap &m)
385 385
    {
386 386
      if(local_processed) {
387
	delete _processed;
388
	local_processed=false;
387
        delete _processed;
388
        local_processed=false;
389 389
      }
... ...
@@ -400,7 +400,7 @@
400 400
    ///\return <tt> (*this) </tt>
401
    Bfs &distMap(DistMap &m) 
401
    Bfs &distMap(DistMap &m)
402 402
    {
403 403
      if(local_dist) {
404
	delete _dist;
405
	local_dist=false;
404
        delete _dist;
405
        local_dist=false;
406 406
      }
... ...
@@ -434,8 +434,8 @@
434 434
      for ( NodeIt u(*G) ; u!=INVALID ; ++u ) {
435
	_pred->set(u,INVALID);
436
	_reached->set(u,false);
437
	_processed->set(u,false);
435
        _pred->set(u,INVALID);
436
        _reached->set(u,false);
437
        _processed->set(u,false);
438 438
      }
439 439
    }
440
    
440

	
441 441
    ///Adds a new source node.
... ...
@@ -447,11 +447,11 @@
447 447
      if(!(*_reached)[s])
448
	{
449
	  _reached->set(s,true);
450
	  _pred->set(s,INVALID);
451
	  _dist->set(s,0);
452
	  _queue[_queue_head++]=s;
453
	  _queue_next_dist=_queue_head;
454
	}
448
        {
449
          _reached->set(s,true);
450
          _pred->set(s,INVALID);
451
          _dist->set(s,0);
452
          _queue[_queue_head++]=s;
453
          _queue_next_dist=_queue_head;
454
        }
455 455
    }
456
    
456

	
457 457
    ///Processes the next node.
... ...
@@ -466,4 +466,4 @@
466 466
      if(_queue_tail==_queue_next_dist) {
467
	_curr_dist++;
468
	_queue_next_dist=_queue_head;
467
        _curr_dist++;
468
        _queue_next_dist=_queue_head;
469 469
      }
... ...
@@ -473,8 +473,8 @@
473 473
      for(OutArcIt e(*G,n);e!=INVALID;++e)
474
	if(!(*_reached)[m=G->target(e)]) {
475
	  _queue[_queue_head++]=m;
476
	  _reached->set(m,true);
477
	  _pred->set(m,e);
478
	  _dist->set(m,_curr_dist);
479
	}
474
        if(!(*_reached)[m=G->target(e)]) {
475
          _queue[_queue_head++]=m;
476
          _reached->set(m,true);
477
          _pred->set(m,e);
478
          _dist->set(m,_curr_dist);
479
        }
480 480
      return n;
... ...
@@ -497,4 +497,4 @@
497 497
      if(_queue_tail==_queue_next_dist) {
498
	_curr_dist++;
499
	_queue_next_dist=_queue_head;
498
        _curr_dist++;
499
        _queue_next_dist=_queue_head;
500 500
      }
... ...
@@ -504,9 +504,9 @@
504 504
      for(OutArcIt e(*G,n);e!=INVALID;++e)
505
	if(!(*_reached)[m=G->target(e)]) {
506
	  _queue[_queue_head++]=m;
507
	  _reached->set(m,true);
508
	  _pred->set(m,e);
509
	  _dist->set(m,_curr_dist);
505
        if(!(*_reached)[m=G->target(e)]) {
506
          _queue[_queue_head++]=m;
507
          _reached->set(m,true);
508
          _pred->set(m,e);
509
          _dist->set(m,_curr_dist);
510 510
          reach = reach || (target == m);
511
	}
511
        }
512 512
      return n;
... ...
@@ -530,4 +530,4 @@
530 530
      if(_queue_tail==_queue_next_dist) {
531
	_curr_dist++;
532
	_queue_next_dist=_queue_head;
531
        _curr_dist++;
532
        _queue_next_dist=_queue_head;
533 533
      }
... ...
@@ -537,12 +537,12 @@
537 537
      for(OutArcIt e(*G,n);e!=INVALID;++e)
538
	if(!(*_reached)[m=G->target(e)]) {
539
	  _queue[_queue_head++]=m;
540
	  _reached->set(m,true);
541
	  _pred->set(m,e);
542
	  _dist->set(m,_curr_dist);
543
	  if (nm[m] && rnode == INVALID) rnode = m;
544
	}
538
        if(!(*_reached)[m=G->target(e)]) {
539
          _queue[_queue_head++]=m;
540
          _reached->set(m,true);
541
          _pred->set(m,e);
542
          _dist->set(m,_curr_dist);
543
          if (nm[m] && rnode == INVALID) rnode = m;
544
        }
545 545
      return n;
546 546
    }
547
      
547

	
548 548
    ///Next node to be processed.
... ...
@@ -554,6 +554,6 @@
554 554
    Node nextNode()
555
    { 
555
    {
556 556
      return _queue_tail<_queue_head?_queue[_queue_tail]:INVALID;
557 557
    }
558
 
558

	
559 559
    ///\brief Returns \c false if there are nodes
... ...
@@ -565,6 +565,6 @@
565 565
    ///Returns the number of the nodes to be processed.
566
    
566

	
567 567
    ///Returns the number of the nodes to be processed in the queue.
568 568
    int queueSize() { return _queue_head-_queue_tail; }
569
    
569

	
570 570
    ///Executes the algorithm.
... ...
@@ -586,3 +586,3 @@
586 586
    }
587
    
587

	
588 588
    ///Executes the algorithm until \c dest is reached.
... ...
@@ -604,3 +604,3 @@
604 604
    }
605
    
605

	
606 606
    ///Executes the algorithm until a condition is met.
... ...
@@ -623,3 +623,3 @@
623 623
      while ( !emptyQueue() && rnode == INVALID ) {
624
	processNextNode(nm, rnode);
624
        processNextNode(nm, rnode);
625 625
      }
... ...
@@ -627,5 +627,5 @@
627 627
    }
628
    
628

	
629 629
    ///Runs %BFS algorithm from node \c s.
630
    
630

	
631 631
    ///This method runs the %BFS algorithm from a root node \c s
... ...
@@ -648,5 +648,5 @@
648 648
    }
649
    
649

	
650 650
    ///Finds the shortest path between \c s and \c t.
651
    
651

	
652 652
    ///Finds the shortest path between \c s and \c t.
... ...
@@ -668,3 +668,3 @@
668 668
    }
669
    
669

	
670 670
    ///@}
... ...
@@ -676,3 +676,3 @@
676 676
    ///either run() or start() must be calleb.
677
    
677

	
678 678
    ///@{
... ...
@@ -682,6 +682,6 @@
682 682
    ///Gives back the shortest path.
683
    
683

	
684 684
    ///Gives back the shortest path.
685 685
    ///\pre The \c t should be reachable from the source.
686
    Path path(Node t) 
686
    Path path(Node t)
687 687
    {
... ...
@@ -724,4 +724,4 @@
724 724
    Node predNode(Node v) const { return (*_pred)[v]==INVALID ? INVALID:
725
				  G->source((*_pred)[v]); }
726
    
725
                                  G->source((*_pred)[v]); }
726

	
727 727
    ///Returns a reference to the NodeMap of distances.
... ...
@@ -732,3 +732,3 @@
732 732
    const DistMap &distMap() const { return *_dist;}
733
 
733

	
734 734
    ///Returns a reference to the shortest path tree map.
... ...
@@ -740,3 +740,3 @@
740 740
    const PredMap &predMap() const { return *_pred;}
741
 
741

	
742 742
    ///Checks if a node is reachable from the root.
... ...
@@ -749,3 +749,3 @@
749 749
    bool reached(Node v) { return (*_reached)[v]; }
750
    
750

	
751 751
    ///@}
... ...
@@ -760,3 +760,3 @@
760 760
  {
761
    ///The digraph type the algorithm runs on. 
761
    ///The digraph type the algorithm runs on.
762 762
    typedef GR Digraph;
... ...
@@ -764,3 +764,3 @@
764 764
    ///arcs of the shortest paths.
765
    /// 
765
    ///
766 766
    ///The type of the map that stores the last
... ...
@@ -771,4 +771,4 @@
771 771
    ///Instantiates a PredMap.
772
 
773
    ///This function instantiates a \ref PredMap. 
772

	
773
    ///This function instantiates a \ref PredMap.
774 774
    ///\param g is the digraph, to which we would like to define the PredMap.
... ...
@@ -776,5 +776,5 @@
776 776
#ifdef DOXYGEN
777
    static PredMap *createPredMap(const GR &g) 
777
    static PredMap *createPredMap(const GR &g)
778 778
#else
779
    static PredMap *createPredMap(const GR &) 
779
    static PredMap *createPredMap(const GR &)
780 780
#endif
... ...
@@ -785,3 +785,3 @@
785 785
    ///The type of the map that indicates which nodes are processed.
786
 
786

	
787 787
    ///The type of the map that indicates which nodes are processed.
... ...
@@ -791,4 +791,4 @@
791 791
    ///Instantiates a ProcessedMap.
792
 
793
    ///This function instantiates a \ref ProcessedMap. 
792

	
793
    ///This function instantiates a \ref ProcessedMap.
794 794
    ///\param g is the digraph, to which
... ...
@@ -804,3 +804,3 @@
804 804
    ///The type of the map that indicates which nodes are reached.
805
 
805

	
806 806
    ///The type of the map that indicates which nodes are reached.
... ...
@@ -810,4 +810,4 @@
810 810
    ///Instantiates a ReachedMap.
811
 
812
    ///This function instantiates a \ref ReachedMap. 
811

	
812
    ///This function instantiates a \ref ReachedMap.
813 813
    ///\param G is the digraph, to which
... ...
@@ -819,3 +819,3 @@
819 819
    ///The type of the map that stores the dists of the nodes.
820
 
820

	
821 821
    ///The type of the map that stores the dists of the nodes.
... ...
@@ -825,4 +825,4 @@
825 825
    ///Instantiates a DistMap.
826
 
827
    ///This function instantiates a \ref DistMap. 
826

	
827
    ///This function instantiates a \ref DistMap.
828 828
    ///\param g is the digraph, to which we would like to define the \ref DistMap
... ...
@@ -837,3 +837,3 @@
837 837
  };
838
  
838

	
839 839
  /// Default traits used by \ref BfsWizard
... ...
@@ -867,6 +867,6 @@
867 867
    Node _source;
868
    
868

	
869 869
    public:
870 870
    /// Constructor.
871
    
871

	
872 872
    /// This constructor does not require parameters, therefore it initiates
... ...
@@ -874,6 +874,6 @@
874 874
    BfsWizardBase() : _g(0), _reached(0), _processed(0), _pred(0),
875
			   _dist(0), _source(INVALID) {}
875
                           _dist(0), _source(INVALID) {}
876 876

	
877 877
    /// Constructor.
878
    
878

	
879 879
    /// This constructor requires some parameters,
... ...
@@ -884,3 +884,3 @@
884 884
    BfsWizardBase(const GR &g, Node s=INVALID) :
885
      _g(reinterpret_cast<void*>(const_cast<GR*>(&g))), 
885
      _g(reinterpret_cast<void*>(const_cast<GR*>(&g))),
886 886
      _reached(0), _processed(0), _pred(0), _dist(0), _source(s) {}
... ...
@@ -888,3 +888,3 @@
888 888
  };
889
  
889

	
890 890
  /// A class to make the usage of Bfs algorithm easier
... ...
@@ -923,3 +923,3 @@
923 923
    typedef typename Digraph::OutArcIt OutArcIt;
924
    
924

	
925 925
    ///\brief The type of the map that stores
... ...
@@ -953,3 +953,3 @@
953 953
    ///Runs Bfs algorithm from a given node.
954
    
954

	
955 955
    ///Runs Bfs algorithm from a given node.
... ...
@@ -961,8 +961,8 @@
961 961
      if(Base::_reached)
962
	alg.reachedMap(*reinterpret_cast<ReachedMap*>(Base::_reached));
963
      if(Base::_processed) 
962
        alg.reachedMap(*reinterpret_cast<ReachedMap*>(Base::_reached));
963
      if(Base::_processed)
964 964
        alg.processedMap(*reinterpret_cast<ProcessedMap*>(Base::_processed));
965
      if(Base::_pred) 
965
      if(Base::_pred)
966 966
        alg.predMap(*reinterpret_cast<PredMap*>(Base::_pred));
967
      if(Base::_dist) 
967
      if(Base::_dist)
968 968
        alg.distMap(*reinterpret_cast<DistMap*>(Base::_dist));
... ...
@@ -987,3 +987,3 @@
987 987
    };
988
    
988

	
989 989
    ///\brief \ref named-templ-param "Named parameter"
... ...
@@ -995,3 +995,3 @@
995 995
    template<class T>
996
    BfsWizard<DefPredMapBase<T> > predMap(const T &t) 
996
    BfsWizard<DefPredMapBase<T> > predMap(const T &t)
997 997
    {
... ...
@@ -1000,4 +1000,4 @@
1000 1000
    }
1001
    
1002
 
1001

	
1002

	
1003 1003
    template<class T>
... ...
@@ -1008,3 +1008,3 @@
1008 1008
    };
1009
    
1009

	
1010 1010
    ///\brief \ref named-templ-param "Named parameter"
... ...
@@ -1016,3 +1016,3 @@
1016 1016
    template<class T>
1017
    BfsWizard<DefReachedMapBase<T> > reachedMap(const T &t) 
1017
    BfsWizard<DefReachedMapBase<T> > reachedMap(const T &t)
1018 1018
    {
... ...
@@ -1021,3 +1021,3 @@
1021 1021
    }
1022
    
1022

	
1023 1023

	
... ...
@@ -1029,3 +1029,3 @@
1029 1029
    };
1030
    
1030

	
1031 1031
    ///\brief \ref named-templ-param "Named parameter"
... ...
@@ -1037,3 +1037,3 @@
1037 1037
    template<class T>
1038
    BfsWizard<DefProcessedMapBase<T> > processedMap(const T &t) 
1038
    BfsWizard<DefProcessedMapBase<T> > processedMap(const T &t)
1039 1039
    {
... ...
@@ -1042,4 +1042,4 @@
1042 1042
    }
1043
    
1044
   
1043

	
1044

	
1045 1045
    template<class T>
... ...
@@ -1050,3 +1050,3 @@
1050 1050
    };
1051
    
1051

	
1052 1052
    ///\brief \ref named-templ-param "Named parameter"
... ...
@@ -1058,3 +1058,3 @@
1058 1058
    template<class T>
1059
    BfsWizard<DefDistMapBase<T> > distMap(const T &t) 
1059
    BfsWizard<DefDistMapBase<T> > distMap(const T &t)
1060 1060
    {
... ...
@@ -1063,3 +1063,3 @@
1063 1063
    }
1064
    
1064

	
1065 1065
    /// Sets the source node, from which the Bfs algorithm runs.
... ...
@@ -1068,3 +1068,3 @@
1068 1068
    /// \param s is the source node.
1069
    BfsWizard<TR> &source(Node s) 
1069
    BfsWizard<TR> &source(Node s)
1070 1070
    {
... ...
@@ -1073,5 +1073,5 @@
1073 1073
    }
1074
    
1074

	
1075 1075
  };
1076
  
1076

	
1077 1077
  ///Function type interface for Bfs algorithm.
... ...
@@ -1102,3 +1102,3 @@
1102 1102
  /// \brief Visitor class for bfs.
1103
  ///  
1103
  ///
1104 1104
  /// This class defines the interface of the BfsVisit events, and
... ...
@@ -1111,3 +1111,3 @@
1111 1111
    /// \brief Called when the arc reach a node.
1112
    /// 
1112
    ///
1113 1113
    /// It is called when the bfs find an arc which target is not
... ...
@@ -1116,9 +1116,9 @@
1116 1116
    /// \brief Called when the node reached first time.
1117
    /// 
1117
    ///
1118 1118
    /// It is Called when the node reached first time.
1119 1119
    void reach(const Node& node) {}
1120
    /// \brief Called when the arc examined but target of the arc 
1120
    /// \brief Called when the arc examined but target of the arc
1121 1121
    /// already discovered.
1122
    /// 
1123
    /// It called when the arc examined but the target of the arc 
1122
    ///
1123
    /// It called when the arc examined but the target of the arc
1124 1124
    /// already discovered.
... ...
@@ -1126,3 +1126,3 @@
1126 1126
    /// \brief Called for the source node of the bfs.
1127
    /// 
1127
    ///
1128 1128
    /// It is called for the source node of the bfs.
... ...
@@ -1130,3 +1130,3 @@
1130 1130
    /// \brief Called when the node processed.
1131
    /// 
1131
    ///
1132 1132
    /// It is Called when the node processed.
... ...
@@ -1149,8 +1149,8 @@
1149 1149
      void constraints() {
1150
	Arc arc;
1151
	Node node;
1152
	visitor.discover(arc);
1153
	visitor.reach(node);
1154
	visitor.examine(arc);
1155
	visitor.start(node);
1150
        Arc arc;
1151
        Node node;
1152
        visitor.discover(arc);
1153
        visitor.reach(node);
1154
        visitor.examine(arc);
1155
        visitor.start(node);
1156 1156
        visitor.process(node);
... ...
@@ -1169,3 +1169,3 @@
1169 1169

	
1170
    /// \brief The digraph type the algorithm runs on. 
1170
    /// \brief The digraph type the algorithm runs on.
1171 1171
    typedef _Digraph Digraph;
... ...
@@ -1173,3 +1173,3 @@
1173 1173
    /// \brief The type of the map that indicates which nodes are reached.
1174
    /// 
1174
    ///
1175 1175
    /// The type of the map that indicates which nodes are reached.
... ...
@@ -1181,3 +1181,3 @@
1181 1181
    ///
1182
    /// This function instantiates a \ref ReachedMap. 
1182
    /// This function instantiates a \ref ReachedMap.
1183 1183
    /// \param digraph is the digraph, to which
... ...
@@ -1191,5 +1191,5 @@
1191 1191
  /// \ingroup search
1192
  ///  
1192
  ///
1193 1193
  /// \brief %BFS Visit algorithm class.
1194
  ///  
1194
  ///
1195 1195
  /// This class provides an efficient implementation of the %BFS algorithm
... ...
@@ -1199,3 +1199,3 @@
1199 1199
  /// class. It works with callback mechanism, the BfsVisit object calls
1200
  /// on every bfs event the \c Visitor class member functions. 
1200
  /// on every bfs event the \c Visitor class member functions.
1201 1201
  ///
... ...
@@ -1204,3 +1204,3 @@
1204 1204
  /// is only passed to \ref BfsDefaultTraits.
1205
  /// \tparam _Visitor The Visitor object for the algorithm. The 
1205
  /// \tparam _Visitor The Visitor object for the algorithm. The
1206 1206
  /// \ref BfsVisitor "BfsVisitor<_Digraph>" is an empty Visitor which
... ...
@@ -1208,3 +1208,3 @@
1208 1208
  /// events you should implement your own Visitor class.
1209
  /// \tparam _Traits Traits class to set various data types used by the 
1209
  /// \tparam _Traits Traits class to set various data types used by the
1210 1210
  /// algorithm. The default traits class is
... ...
@@ -1217,4 +1217,4 @@
1217 1217
  template <typename _Digraph = ListDigraph,
1218
	    typename _Visitor = BfsVisitor<_Digraph>,
1219
	    typename _Traits = BfsDefaultTraits<_Digraph> >
1218
            typename _Visitor = BfsVisitor<_Digraph>,
1219
            typename _Traits = BfsDefaultTraits<_Digraph> >
1220 1220
#endif
... ...
@@ -1222,3 +1222,3 @@
1222 1222
  public:
1223
    
1223

	
1224 1224
    /// \brief \ref Exception for uninitialized parameters.
... ...
@@ -1229,5 +1229,5 @@
1229 1229
    public:
1230
      virtual const char* what() const throw() 
1230
      virtual const char* what() const throw()
1231 1231
      {
1232
	return "lemon::BfsVisit::UninitializedParameter";
1232
        return "lemon::BfsVisit::UninitializedParameter";
1233 1233
      }
... ...
@@ -1268,4 +1268,4 @@
1268 1268
      if(!_reached) {
1269
	local_reached = true;
1270
	_reached = Traits::createReachedMap(*_digraph);
1269
        local_reached = true;
1270
        _reached = Traits::createReachedMap(*_digraph);
1271 1271
      }
... ...
@@ -1276,3 +1276,3 @@
1276 1276
    BfsVisit() {}
1277
    
1277

	
1278 1278
  public:
... ...
@@ -1288,6 +1288,6 @@
1288 1288
      static ReachedMap *createReachedMap(const Digraph &digraph) {
1289
	throw UninitializedParameter();
1289
        throw UninitializedParameter();
1290 1290
      }
1291 1291
    };
1292
    /// \brief \ref named-templ-param "Named parameter" for setting 
1292
    /// \brief \ref named-templ-param "Named parameter" for setting
1293 1293
    /// ReachedMap type
... ...
@@ -1297,3 +1297,3 @@
1297 1297
    struct DefReachedMap : public BfsVisit< Digraph, Visitor,
1298
					    DefReachedMapTraits<T> > {
1298
                                            DefReachedMapTraits<T> > {
1299 1299
      typedef BfsVisit< Digraph, Visitor, DefReachedMapTraits<T> > Create;
... ...
@@ -1302,4 +1302,4 @@
1302 1302

	
1303
  public:      
1304
    
1303
  public:
1304

	
1305 1305
    /// \brief Constructor.
... ...
@@ -1311,6 +1311,6 @@
1311 1311
    ///
1312
    BfsVisit(const Digraph& digraph, Visitor& visitor) 
1312
    BfsVisit(const Digraph& digraph, Visitor& visitor)
1313 1313
      : _digraph(&digraph), _visitor(&visitor),
1314
	_reached(0), local_reached(false) {}
1315
    
1314
        _reached(0), local_reached(false) {}
1315

	
1316 1316
    /// \brief Destructor.
... ...
@@ -1331,4 +1331,4 @@
1331 1331
      if(local_reached) {
1332
	delete _reached;
1333
	local_reached = false;
1332
        delete _reached;
1333
        local_reached = false;
1334 1334
      }
... ...
@@ -1359,6 +1359,6 @@
1359 1359
      for (NodeIt u(*_digraph) ; u != INVALID ; ++u) {
1360
	_reached->set(u, false);
1360
        _reached->set(u, false);
1361 1361
      }
1362 1362
    }
1363
    
1363

	
1364 1364
    /// \brief Adds a new source node.
... ...
@@ -1368,9 +1368,9 @@
1368 1368
      if(!(*_reached)[s]) {
1369
	  _reached->set(s,true);
1370
	  _visitor->start(s);
1371
	  _visitor->reach(s);
1369
          _reached->set(s,true);
1370
          _visitor->start(s);
1371
          _visitor->reach(s);
1372 1372
          _list[++_list_back] = s;
1373
	}
1373
        }
1374 1374
    }
1375
    
1375

	
1376 1376
    /// \brief Processes the next node.
... ...
@@ -1382,3 +1382,3 @@
1382 1382
    /// \pre The queue must not be empty!
1383
    Node processNextNode() { 
1383
    Node processNextNode() {
1384 1384
      Node n = _list[++_list_front];
... ...
@@ -1469,3 +1469,3 @@
1469 1469
    /// empty.
1470
    Node nextNode() { 
1470
    Node nextNode() {
1471 1471
      return _list_front != _list_back ? _list[_list_front + 1] : INVALID;
... ...
@@ -1484,3 +1484,3 @@
1484 1484
    int queueSize() { return _list_back - _list_front; }
1485
    
1485

	
1486 1486
    /// \brief Executes the algorithm.
... ...
@@ -1494,3 +1494,3 @@
1494 1494
    }
1495
    
1495

	
1496 1496
    /// \brief Executes the algorithm until \c dest is reached.
... ...
@@ -1505,3 +1505,3 @@
1505 1505
    }
1506
    
1506

	
1507 1507
    /// \brief Executes the algorithm until a condition is met.
... ...
@@ -1523,3 +1523,3 @@
1523 1523
      while ( !emptyQueue() && rnode == INVALID ) {
1524
	processNextNode(nm, rnode);
1524
        processNextNode(nm, rnode);
1525 1525
      }
... ...
@@ -1544,3 +1544,3 @@
1544 1544
    /// \brief Runs %BFSVisit algorithm to visit all nodes in the digraph.
1545
    ///    
1545
    ///
1546 1546
    /// This method runs the %BFS algorithm in order to
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -50,3 +50,3 @@
50 50
  template <typename _Prio, typename _ItemIntMap,
51
	    typename _Compare = std::less<_Prio> >
51
            typename _Compare = std::less<_Prio> >
52 52
  class BinHeap {
... ...
@@ -92,3 +92,3 @@
92 92
    explicit BinHeap(ItemIntMap &_iim) : iim(_iim) {}
93
    
93

	
94 94
    /// \brief The constructor.
... ...
@@ -101,3 +101,3 @@
101 101
    /// \param _comp The comparator function object.
102
    BinHeap(ItemIntMap &_iim, const Compare &_comp) 
102
    BinHeap(ItemIntMap &_iim, const Compare &_comp)
103 103
      : iim(_iim), comp(_comp) {}
... ...
@@ -109,3 +109,3 @@
109 109
    int size() const { return data.size(); }
110
    
110

	
111 111
    /// \brief Checks if the heap stores no items.
... ...
@@ -116,3 +116,3 @@
116 116
    /// \brief Make empty this heap.
117
    /// 
117
    ///
118 118
    /// Make empty this heap. It does not change the cross reference map.
... ...
@@ -121,4 +121,4 @@
121 121
    /// each item to \c PRE_HEAP.
122
    void clear() { 
123
      data.clear(); 
122
    void clear() {
123
      data.clear();
124 124
    }
... ...
@@ -136,5 +136,5 @@
136 136
      while( hole>0 && less(p,data[par]) ) {
137
	move(data[par],hole);
138
	hole = par;
139
	par = parent(hole);
137
        move(data[par],hole);
138
        hole = par;
139
        par = parent(hole);
140 140
      }
... ...
@@ -147,10 +147,10 @@
147 147
      while(child < length) {
148
	if( less(data[child-1], data[child]) ) {
149
	  --child;
150
	}
151
	if( !less(data[child], p) )
152
	  goto ok;
153
	move(data[child], hole);
154
	hole = child;
155
	child = second_child(hole);
148
        if( less(data[child-1], data[child]) ) {
149
          --child;
150
        }
151
        if( !less(data[child], p) )
152
          goto ok;
153
        move(data[child], hole);
154
        hole = child;
155
        child = second_child(hole);
156 156
      }
... ...
@@ -158,4 +158,4 @@
158 158
      if( child<length && less(data[child], p) ) {
159
	move(data[child], hole);
160
	hole=child;
159
        move(data[child], hole);
160
        hole=child;
161 161
      }
... ...
@@ -183,4 +183,4 @@
183 183
    /// \brief Insert an item into the heap with the given heap.
184
    ///    
185
    /// Adds \c i to the heap with priority \c p. 
184
    ///
185
    /// Adds \c i to the heap with priority \c p.
186 186
    /// \param i The item to insert.
... ...
@@ -192,4 +192,4 @@
192 192
    /// This method returns the item with minimum priority relative to \c
193
    /// Compare.  
194
    /// \pre The heap must be nonempty.  
193
    /// Compare.
194
    /// \pre The heap must be nonempty.
195 195
    Item top() const {
... ...
@@ -209,4 +209,4 @@
209 209
    /// This method deletes the item with minimum priority relative to \c
210
    /// Compare from the heap.  
211
    /// \pre The heap must be non-empty.  
210
    /// Compare from the heap.
211
    /// \pre The heap must be non-empty.
212 212
    void pop() {
... ...
@@ -215,3 +215,3 @@
215 215
      if (n > 0) {
216
	bubble_down(0, data[n], n);
216
        bubble_down(0, data[n], n);
217 217
      }
... ...
@@ -230,5 +230,5 @@
230 230
      if( h < n ) {
231
	if ( bubble_up(h, data[n]) == h) {
232
	  bubble_down(h, data[n], n);
233
	}
231
        if ( bubble_up(h, data[n]) == h) {
232
          bubble_down(h, data[n], n);
233
        }
234 234
      }
... ...
@@ -237,6 +237,6 @@
237 237

	
238
    
238

	
239 239
    /// \brief Returns the priority of \c i.
240 240
    ///
241
    /// This function returns the priority of item \c i.  
241
    /// This function returns the priority of item \c i.
242 242
    /// \pre \c i must be in the heap.
... ...
@@ -248,3 +248,3 @@
248 248

	
249
    /// \brief \c i gets to the heap with priority \c p independently 
249
    /// \brief \c i gets to the heap with priority \c p independently
250 250
    /// if \c i was already there.
... ...
@@ -258,9 +258,9 @@
258 258
      if( idx < 0 ) {
259
	push(i,p);
259
        push(i,p);
260 260
      }
261 261
      else if( comp(p, data[idx].second) ) {
262
	bubble_up(idx, Pair(i,p));
262
        bubble_up(idx, Pair(i,p));
263 263
      }
264 264
      else {
265
	bubble_down(idx, Pair(i,p), data.size());
265
        bubble_down(idx, Pair(i,p), data.size());
266 266
      }
... ...
@@ -279,6 +279,6 @@
279 279
    }
280
    
280

	
281 281
    /// \brief Increases the priority of \c i to \c p.
282 282
    ///
283
    /// This method sets the priority of item \c i to \c p. 
283
    /// This method sets the priority of item \c i to \c p.
284 284
    /// \pre \c i must be stored in the heap with priority at most \c
... ...
@@ -292,3 +292,3 @@
292 292

	
293
    /// \brief Returns if \c item is in, has already been in, or has 
293
    /// \brief Returns if \c item is in, has already been in, or has
294 294
    /// never been in the heap.
... ...
@@ -303,3 +303,3 @@
303 303
      if( s>=0 )
304
	s=0;
304
        s=0;
305 305
      return State(s);
... ...
@@ -313,3 +313,3 @@
313 313
    /// \param i The item.
314
    /// \param st The state. It should not be \c IN_HEAP. 
314
    /// \param st The state. It should not be \c IN_HEAP.
315 315
    void state(const Item& i, State st) {
... ...
@@ -342,3 +342,3 @@
342 342
  }; // class BinHeap
343
  
343

	
344 344
} // namespace lemon
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -34,3 +34,3 @@
34 34
  ///
35
  /// \brief Notifier class to notify observes about alterations in 
35
  /// \brief Notifier class to notify observes about alterations in
36 36
  /// a container.
... ...
@@ -51,3 +51,3 @@
51 51
  ///
52
  /// This class provides an interface to the container. The \e first() and \e 
52
  /// This class provides an interface to the container. The \e first() and \e
53 53
  /// next() member functions make possible to iterate on the keys of the
... ...
@@ -62,3 +62,3 @@
62 62
  /// graph a new graph is builded then it can be signaled with the
63
  /// clear() and build() members. Important rule that if we erase items 
63
  /// clear() and build() members. Important rule that if we erase items
64 64
  /// from graph we should first signal the alteration and after that erase
... ...
@@ -70,3 +70,3 @@
70 70
  /// overriding the virtual functions defined in the base class.  The
71
  /// observer base can be attached to the notifier with the 
71
  /// observer base can be attached to the notifier with the
72 72
  /// \e attach() member and can be detached with detach() function. The
... ...
@@ -81,3 +81,3 @@
81 81
  /// functions. Thence the \e erase() and \e clear() should not throw
82
  /// exception. Actullay, it can be throw only 
82
  /// exception. Actullay, it can be throw only
83 83
  /// \ref AlterationObserver::ImmediateDetach ImmediateDetach
... ...
@@ -87,3 +87,3 @@
87 87
  /// reliable. If we want to carry out the node degree in the graph
88
  /// as in the \ref InDegMap and we use the reverseEdge that cause 
88
  /// as in the \ref InDegMap and we use the reverseEdge that cause
89 89
  /// unreliable functionality. Because the alteration observing signals
... ...
@@ -106,3 +106,3 @@
106 106

	
107
    /// \brief Exception which can be called from \e clear() and 
107
    /// \brief Exception which can be called from \e clear() and
108 108
    /// \e erase().
... ...
@@ -129,3 +129,3 @@
129 129
    /// about the container is built from an empty container or
130
    /// is cleared to an empty container. 
130
    /// is cleared to an empty container.
131 131

	
... ...
@@ -140,3 +140,3 @@
140 140
      /// Default constructor for ObserverBase.
141
      /// 
141
      ///
142 142
      ObserverBase() : _notifier(0) {}
... ...
@@ -153,9 +153,9 @@
153 153
      /// Constructor which attach the obserever to the same notifier as
154
      /// the other observer is attached to. 
154
      /// the other observer is attached to.
155 155
      ObserverBase(const ObserverBase& copy) {
156
	if (copy.attached()) {
156
        if (copy.attached()) {
157 157
          attach(*copy.notifier());
158
	}
158
        }
159 159
      }
160
	
160

	
161 161
      /// \brief Destructor
... ...
@@ -172,5 +172,5 @@
172 172
      void attach(AlterationNotifier& nf) {
173
	nf.attach(*this);
173
        nf.attach(*this);
174 174
      }
175
      
175

	
176 176
      /// \brief Detaches the observer into an AlterationNotifier.
... ...
@@ -182,4 +182,4 @@
182 182
      }
183
      
184
      /// \brief Gives back a pointer to the notifier which the map 
183

	
184
      /// \brief Gives back a pointer to the notifier which the map
185 185
      /// attached into.
... ...
@@ -190,3 +190,3 @@
190 190
      Notifier* notifier() const { return const_cast<Notifier*>(_notifier); }
191
      
191

	
192 192
      /// Gives back true when the observer is attached into a notifier.
... ...
@@ -199,3 +199,3 @@
199 199
    protected:
200
      
200

	
201 201
      Notifier* _notifier;
... ...
@@ -211,3 +211,3 @@
211 211

	
212
      /// \brief The member function to notificate the observer about 
212
      /// \brief The member function to notificate the observer about
213 213
      /// more item is added to the container.
... ...
@@ -224,6 +224,6 @@
224 224
      /// item is erased from the container. It have to be overrided in
225
      /// the subclasses.	
225
      /// the subclasses.
226 226
      virtual void erase(const Item&) = 0;
227 227

	
228
      /// \brief The member function to notificate the observer about 
228
      /// \brief The member function to notificate the observer about
229 229
      /// more item is erased from the container.
... ...
@@ -249,3 +249,3 @@
249 249
      /// items are erased from the container. It have to be overrided in
250
      /// the subclasses.      
250
      /// the subclasses.
251 251
      virtual void clear() = 0;
... ...
@@ -253,3 +253,3 @@
253 253
    };
254
	
254

	
255 255
  protected:
... ...
@@ -258,6 +258,6 @@
258 258

	
259
    typedef std::list<ObserverBase*> Observers; 
259
    typedef std::list<ObserverBase*> Observers;
260 260
    Observers _observers;
261 261

	
262
		
262

	
263 263
  public:
... ...
@@ -266,5 +266,5 @@
266 266
    ///
267
    /// The default constructor of the AlterationNotifier. 
267
    /// The default constructor of the AlterationNotifier.
268 268
    /// It creates an empty notifier.
269
    AlterationNotifier() 
269
    AlterationNotifier()
270 270
      : container(0) {}
... ...
@@ -274,11 +274,11 @@
274 274
    /// Constructor with the observed container parameter.
275
    AlterationNotifier(const Container& _container) 
275
    AlterationNotifier(const Container& _container)
276 276
      : container(&_container) {}
277 277

	
278
    /// \brief Copy Constructor of the AlterationNotifier. 
278
    /// \brief Copy Constructor of the AlterationNotifier.
279 279
    ///
280
    /// Copy constructor of the AlterationNotifier. 
280
    /// Copy constructor of the AlterationNotifier.
281 281
    /// It creates only an empty notifier because the copiable
282 282
    /// notifier's observers have to be registered still into that notifier.
283
    AlterationNotifier(const AlterationNotifier& _notifier) 
283
    AlterationNotifier(const AlterationNotifier& _notifier)
284 284
      : container(_notifier.container) {}
... ...
@@ -286,3 +286,3 @@
286 286
    /// \brief Destructor.
287
    ///		
287
    ///
288 288
    /// Destructor of the AlterationNotifier.
... ...
@@ -292,3 +292,3 @@
292 292
      for (it = _observers.begin(); it != _observers.end(); ++it) {
293
	(*it)->_notifier = 0;
293
        (*it)->_notifier = 0;
294 294
      }
... ...
@@ -340,3 +340,3 @@
340 340
    }
341
		
341

	
342 342
  protected:
... ...
@@ -346,3 +346,3 @@
346 346
      observer._notifier = this;
347
    } 
347
    }
348 348

	
... ...
@@ -355,9 +355,9 @@
355 355
  public:
356
	
357
    /// \brief Notifies all the registed observers about an item added to 
356

	
357
    /// \brief Notifies all the registed observers about an item added to
358 358
    /// the container.
359 359
    ///
360
    /// It notifies all the registed observers about an item added to 
360
    /// It notifies all the registed observers about an item added to
361 361
    /// the container.
362
    /// 
362
    ///
363 363
    void add(const Item& item) {
... ...
@@ -375,10 +375,10 @@
375 375
      }
376
    }	
376
    }
377 377

	
378
    /// \brief Notifies all the registed observers about more item added to 
378
    /// \brief Notifies all the registed observers about more item added to
379 379
    /// the container.
380 380
    ///
381
    /// It notifies all the registed observers about more item added to 
381
    /// It notifies all the registed observers about more item added to
382 382
    /// the container.
383
    /// 
383
    ///
384 384
    void add(const std::vector<Item>& items) {
... ...
@@ -396,10 +396,10 @@
396 396
      }
397
    }	
397
    }
398 398

	
399
    /// \brief Notifies all the registed observers about an item erased from 
399
    /// \brief Notifies all the registed observers about an item erased from
400 400
    /// the container.
401
    ///	
402
    /// It notifies all the registed observers about an item erased from 
401
    ///
402
    /// It notifies all the registed observers about an item erased from
403 403
    /// the container.
404
    /// 
404
    ///
405 405
    void erase(const Item& item) throw() {
... ...
@@ -418,8 +418,8 @@
418 418

	
419
    /// \brief Notifies all the registed observers about more item erased  
419
    /// \brief Notifies all the registed observers about more item erased
420 420
    /// from the container.
421
    ///	
422
    /// It notifies all the registed observers about more item erased from 
421
    ///
422
    /// It notifies all the registed observers about more item erased from
423 423
    /// the container.
424
    /// 
424
    ///
425 425
    void erase(const std::vector<Item>& items) {
... ...
@@ -438,5 +438,5 @@
438 438

	
439
    /// \brief Notifies all the registed observers about the container is 
439
    /// \brief Notifies all the registed observers about the container is
440 440
    /// built.
441
    ///		
441
    ///
442 442
    /// Notifies all the registed observers about the container is built
... ...
@@ -458,3 +458,3 @@
458 458

	
459
    /// \brief Notifies all the registed observers about all items are 
459
    /// \brief Notifies all the registed observers about all items are
460 460
    /// erased.
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -40,3 +40,3 @@
40 40
  /// automatically updates the map when a key is added to or erased from
41
  /// the map. This map uses the allocators to implement 
41
  /// the map. This map uses the allocators to implement
42 42
  /// the container functionality.
... ...
@@ -46,6 +46,6 @@
46 46
  template <typename _Graph, typename _Item, typename _Value>
47
  class ArrayMap 
47
  class ArrayMap
48 48
    : public ItemSetTraits<_Graph, _Item>::ItemNotifier::ObserverBase {
49 49
  public:
50
    /// The graph type of the maps. 
50
    /// The graph type of the maps.
51 51
    typedef _Graph Graph;
... ...
@@ -71,3 +71,3 @@
71 71
    typedef typename Notifier::ObserverBase Parent;
72
		
72

	
73 73
  private:
... ...
@@ -86,10 +86,10 @@
86 86
      for (nf->first(it); it != INVALID; nf->next(it)) {
87
	int id = nf->id(it);;
88
	allocator.construct(&(values[id]), Value());
89
      }								
87
        int id = nf->id(it);;
88
        allocator.construct(&(values[id]), Value());
89
      }
90 90
    }
91 91

	
92
    /// \brief Constructor to use default value to initialize the map. 
92
    /// \brief Constructor to use default value to initialize the map.
93 93
    ///
94
    /// It constructs a map and initialize all of the the map. 
94
    /// It constructs a map and initialize all of the the map.
95 95
    ArrayMap(const Graph& graph, const Value& value) {
... ...
@@ -100,5 +100,5 @@
100 100
      for (nf->first(it); it != INVALID; nf->next(it)) {
101
	int id = nf->id(it);;
102
	allocator.construct(&(values[id]), value);
103
      }								
101
        int id = nf->id(it);;
102
        allocator.construct(&(values[id]), value);
103
      }
104 104
    }
... ...
@@ -107,6 +107,6 @@
107 107
    ///
108
    /// Constructor to copy a map of the same map type.     
108
    /// Constructor to copy a map of the same map type.
109 109
    ArrayMap(const ArrayMap& copy) : Parent() {
110 110
      if (copy.attached()) {
111
	attach(*copy.notifier());
111
        attach(*copy.notifier());
112 112
      }
... ...
@@ -118,4 +118,4 @@
118 118
      for (nf->first(it); it != INVALID; nf->next(it)) {
119
	int id = nf->id(it);;
120
	allocator.construct(&(values[id]), copy.values[id]);
119
        int id = nf->id(it);;
120
        allocator.construct(&(values[id]), copy.values[id]);
121 121
      }
... ...
@@ -126,6 +126,6 @@
126 126
    /// This operator assigns for each item in the map the
127
    /// value mapped to the same item in the copied map.  
127
    /// value mapped to the same item in the copied map.
128 128
    /// The parameter map should be indiced with the same
129 129
    /// itemset because this assign operator does not change
130
    /// the container of the map. 
130
    /// the container of the map.
131 131
    ArrayMap& operator=(const ArrayMap& cmap) {
... ...
@@ -140,3 +140,3 @@
140 140
    /// the NodeMap. In this case the value for each item
141
    /// is assigned by the value of the given ReadMap. 
141
    /// is assigned by the value of the given ReadMap.
142 142
    template <typename CMap>
... ...
@@ -153,11 +153,11 @@
153 153
    /// \brief The destructor of the map.
154
    ///     
154
    ///
155 155
    /// The destructor of the map.
156
    virtual ~ArrayMap() {      
156
    virtual ~ArrayMap() {
157 157
      if (attached()) {
158
	clear();
159
	detach();
158
        clear();
159
        detach();
160 160
      }
161 161
    }
162
		
162

	
163 163
  protected:
... ...
@@ -170,6 +170,6 @@
170 170

	
171
    /// \brief The subscript operator. 
171
    /// \brief The subscript operator.
172 172
    ///
173 173
    /// The subscript operator. The map can be subscripted by the
174
    /// actual keys of the graph. 
174
    /// actual keys of the graph.
175 175
    Value& operator[](const Key& key) {
... ...
@@ -177,4 +177,4 @@
177 177
      return values[id];
178
    } 
179
		
178
    }
179

	
180 180
    /// \brief The const subscript operator.
... ...
@@ -182,3 +182,3 @@
182 182
    /// The const subscript operator. The map can be subscripted by the
183
    /// actual keys of the graph. 
183
    /// actual keys of the graph.
184 184
    const Value& operator[](const Key& key) const {
... ...
@@ -189,3 +189,3 @@
189 189
    /// \brief Setter function of the map.
190
    ///	
190
    ///
191 191
    /// Setter function of the map. Equivalent with map[key] = val.
... ...
@@ -199,5 +199,5 @@
199 199
    /// \brief Adds a new key to the map.
200
    ///		
200
    ///
201 201
    /// It adds a new key to the map. It called by the observer notifier
202
    /// and it overrides the add() member function of the observer base.     
202
    /// and it overrides the add() member function of the observer base.
203 203
    virtual void add(const Key& key) {
... ...
@@ -206,18 +206,18 @@
206 206
      if (id >= capacity) {
207
	int new_capacity = (capacity == 0 ? 1 : capacity);
208
	while (new_capacity <= id) {
209
	  new_capacity <<= 1;
210
	}
211
	Value* new_values = allocator.allocate(new_capacity);
212
	Item it;
213
	for (nf->first(it); it != INVALID; nf->next(it)) {
214
	  int jd = nf->id(it);;
215
	  if (id != jd) {
216
	    allocator.construct(&(new_values[jd]), values[jd]);
217
	    allocator.destroy(&(values[jd]));
218
	  }
219
	}
220
	if (capacity != 0) allocator.deallocate(values, capacity);
221
	values = new_values;
222
	capacity = new_capacity;
207
        int new_capacity = (capacity == 0 ? 1 : capacity);
208
        while (new_capacity <= id) {
209
          new_capacity <<= 1;
210
        }
211
        Value* new_values = allocator.allocate(new_capacity);
212
        Item it;
213
        for (nf->first(it); it != INVALID; nf->next(it)) {
214
          int jd = nf->id(it);;
215
          if (id != jd) {
216
            allocator.construct(&(new_values[jd]), values[jd]);
217
            allocator.destroy(&(values[jd]));
218
          }
219
        }
220
        if (capacity != 0) allocator.deallocate(values, capacity);
221
        values = new_values;
222
        capacity = new_capacity;
223 223
      }
... ...
@@ -227,5 +227,5 @@
227 227
    /// \brief Adds more new keys to the map.
228
    ///		
228
    ///
229 229
    /// It adds more new keys to the map. It called by the observer notifier
230
    /// and it overrides the add() member function of the observer base.     
230
    /// and it overrides the add() member function of the observer base.
231 231
    virtual void add(const std::vector<Key>& keys) {
... ...
@@ -234,38 +234,38 @@
234 234
      for (int i = 0; i < int(keys.size()); ++i) {
235
	int id = nf->id(keys[i]);
236
	if (id > max_id) {
237
	  max_id = id;
238
	}
235
        int id = nf->id(keys[i]);
236
        if (id > max_id) {
237
          max_id = id;
238
        }
239 239
      }
240 240
      if (max_id >= capacity) {
241
	int new_capacity = (capacity == 0 ? 1 : capacity);
242
	while (new_capacity <= max_id) {
243
	  new_capacity <<= 1;
244
	}
245
	Value* new_values = allocator.allocate(new_capacity);
246
	Item it;
247
	for (nf->first(it); it != INVALID; nf->next(it)) {
248
	  int id = nf->id(it);
249
	  bool found = false;
250
	  for (int i = 0; i < int(keys.size()); ++i) {
251
	    int jd = nf->id(keys[i]);
252
	    if (id == jd) {
253
	      found = true;
254
	      break;
255
	    }
256
	  }
257
	  if (found) continue;
258
	  allocator.construct(&(new_values[id]), values[id]);
259
	  allocator.destroy(&(values[id]));
260
	}
261
	if (capacity != 0) allocator.deallocate(values, capacity);
262
	values = new_values;
263
	capacity = new_capacity;
241
        int new_capacity = (capacity == 0 ? 1 : capacity);
242
        while (new_capacity <= max_id) {
243
          new_capacity <<= 1;
244
        }
245
        Value* new_values = allocator.allocate(new_capacity);
246
        Item it;
247
        for (nf->first(it); it != INVALID; nf->next(it)) {
248
          int id = nf->id(it);
249
          bool found = false;
250
          for (int i = 0; i < int(keys.size()); ++i) {
251
            int jd = nf->id(keys[i]);
252
            if (id == jd) {
253
              found = true;
254
              break;
255
            }
256
          }
257
          if (found) continue;
258
          allocator.construct(&(new_values[id]), values[id]);
259
          allocator.destroy(&(values[id]));
260
        }
261
        if (capacity != 0) allocator.deallocate(values, capacity);
262
        values = new_values;
263
        capacity = new_capacity;
264 264
      }
265 265
      for (int i = 0; i < int(keys.size()); ++i) {
266
	int id = nf->id(keys[i]);
267
	allocator.construct(&(values[id]), Value());
266
        int id = nf->id(keys[i]);
267
        allocator.construct(&(values[id]), Value());
268 268
      }
269 269
    }
270
		
270

	
271 271
    /// \brief Erase a key from the map.
... ...
@@ -273,3 +273,3 @@
273 273
    /// Erase a key from the map. It called by the observer notifier
274
    /// and it overrides the erase() member function of the observer base.     
274
    /// and it overrides the erase() member function of the observer base.
275 275
    virtual void erase(const Key& key) {
... ...
@@ -282,7 +282,7 @@
282 282
    /// Erase more keys from the map. It called by the observer notifier
283
    /// and it overrides the erase() member function of the observer base.     
283
    /// and it overrides the erase() member function of the observer base.
284 284
    virtual void erase(const std::vector<Key>& keys) {
285 285
      for (int i = 0; i < int(keys.size()); ++i) {
286
	int id = Parent::notifier()->id(keys[i]);
287
	allocator.destroy(&(values[id]));
286
        int id = Parent::notifier()->id(keys[i]);
287
        allocator.destroy(&(values[id]));
288 288
      }
... ...
@@ -291,5 +291,5 @@
291 291
    /// \brief Buildes the map.
292
    ///	
292
    ///
293 293
    /// It buildes the map. It called by the observer notifier
294
    /// and it overrides the build() member function of the observer base. 
294
    /// and it overrides the build() member function of the observer base.
295 295
    virtual void build() {
... ...
@@ -299,5 +299,5 @@
299 299
      for (nf->first(it); it != INVALID; nf->next(it)) {
300
	int id = nf->id(it);;
301
	allocator.construct(&(values[id]), Value());
302
      }								
300
        int id = nf->id(it);;
301
        allocator.construct(&(values[id]), Value());
302
      }
303 303
    }
... ...
@@ -307,13 +307,13 @@
307 307
    /// It erase all items from the map. It called by the observer notifier
308
    /// and it overrides the clear() member function of the observer base.     
309
    virtual void clear() {	
308
    /// and it overrides the clear() member function of the observer base.
309
    virtual void clear() {
310 310
      Notifier* nf = Parent::notifier();
311 311
      if (capacity != 0) {
312
	Item it;
313
	for (nf->first(it); it != INVALID; nf->next(it)) {
314
	  int id = nf->id(it);
315
	  allocator.destroy(&(values[id]));
316
	}								
317
	allocator.deallocate(values, capacity);
318
	capacity = 0;
312
        Item it;
313
        for (nf->first(it); it != INVALID; nf->next(it)) {
314
          int id = nf->id(it);
315
          allocator.destroy(&(values[id]));
316
        }
317
        allocator.deallocate(values, capacity);
318
        capacity = 0;
319 319
      }
... ...
@@ -322,3 +322,3 @@
322 322
  private:
323
      
323

	
324 324
    void allocate_memory() {
... ...
@@ -326,5 +326,5 @@
326 326
      if (max_id == -1) {
327
	capacity = 0;
328
	values = 0;
329
	return;
327
        capacity = 0;
328
        values = 0;
329
        return;
330 330
      }
... ...
@@ -332,6 +332,6 @@
332 332
      while (capacity <= max_id) {
333
	capacity <<= 1;
333
        capacity <<= 1;
334 334
      }
335
      values = allocator.allocate(capacity);	
336
    }      
335
      values = allocator.allocate(capacity);
336
    }
337 337

	
... ...
@@ -341,3 +341,3 @@
341 341

	
342
  };		
342
  };
343 343

	
... ...
@@ -345,2 +345,2 @@
345 345

	
346
#endif 
346
#endif
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -65,10 +65,10 @@
65 65
      bool operator==(const Arc &that) const {
66
	return forward==that.forward && Edge(*this)==Edge(that);
66
        return forward==that.forward && Edge(*this)==Edge(that);
67 67
      }
68 68
      bool operator!=(const Arc &that) const {
69
	return forward!=that.forward || Edge(*this)!=Edge(that);
69
        return forward!=that.forward || Edge(*this)!=Edge(that);
70 70
      }
71 71
      bool operator<(const Arc &that) const {
72
	return forward<that.forward ||
73
	  (!(that.forward<forward) && Edge(*this)<Edge(that));
72
        return forward<that.forward ||
73
          (!(that.forward<forward) && Edge(*this)<Edge(that));
74 74
      }
... ...
@@ -119,7 +119,7 @@
119 119
      if( e.forward ) {
120
	e.forward = false;
120
        e.forward = false;
121 121
      }
122 122
      else {
123
	Parent::next(e);
124
	e.forward = true;
123
        Parent::next(e);
124
        e.forward = true;
125 125
      }
... ...
@@ -130,7 +130,7 @@
130 130
      if( Edge(e) != INVALID ) {
131
	e.forward = false;
131
        e.forward = false;
132 132
      }
133 133
      else {
134
	Parent::firstOut(e,n);
135
	e.forward = true;
134
        Parent::firstOut(e,n);
135
        e.forward = true;
136 136
      }
... ...
@@ -139,11 +139,11 @@
139 139
      if( ! e.forward ) {
140
	Node n = Parent::target(e);
141
	Parent::nextIn(e);
142
	if( Edge(e) == INVALID ) {
143
	  Parent::firstOut(e, n);
144
	  e.forward = true;
145
	}
140
        Node n = Parent::target(e);
141
        Parent::nextIn(e);
142
        if( Edge(e) == INVALID ) {
143
          Parent::firstOut(e, n);
144
          e.forward = true;
145
        }
146 146
      }
147 147
      else {
148
	Parent::nextOut(e);
148
        Parent::nextOut(e);
149 149
      }
... ...
@@ -154,7 +154,7 @@
154 154
      if( Edge(e) != INVALID ) {
155
	e.forward = false;
155
        e.forward = false;
156 156
      }
157 157
      else {
158
	Parent::firstIn(e,n);
159
	e.forward = true;
158
        Parent::firstIn(e,n);
159
        e.forward = true;
160 160
      }
... ...
@@ -163,11 +163,11 @@
163 163
      if( ! e.forward ) {
164
	Node n = Parent::source(e);
165
	Parent::nextOut(e);
166
	if( Edge(e) == INVALID ) {
167
	  Parent::firstIn(e, n);
168
	  e.forward = true;
169
	}
164
        Node n = Parent::source(e);
165
        Parent::nextOut(e);
166
        if( Edge(e) == INVALID ) {
167
          Parent::firstIn(e, n);
168
          e.forward = true;
169
        }
170 170
      }
171 171
      else {
172
	Parent::nextIn(e);
172
        Parent::nextIn(e);
173 173
      }
... ...
@@ -185,9 +185,9 @@
185 185
      if (d) {
186
	Node s = Parent::source(e);
187
	Parent::nextOut(e);
188
	if (e != INVALID) return;
189
	d = false;
190
	Parent::firstIn(e, s);
186
        Node s = Parent::source(e);
187
        Parent::nextOut(e);
188
        if (e != INVALID) return;
189
        d = false;
190
        Parent::firstIn(e, s);
191 191
      } else {
192
	Parent::nextIn(e);
192
        Parent::nextIn(e);
193 193
      }
... ...
@@ -242,14 +242,14 @@
242 242
      if (p == INVALID) {
243
	Edge arc = Parent::findArc(s, t);
244
	if (arc != INVALID) return direct(arc, true);
245
	arc = Parent::findArc(t, s);
246
	if (arc != INVALID) return direct(arc, false);
243
        Edge arc = Parent::findArc(s, t);
244
        if (arc != INVALID) return direct(arc, true);
245
        arc = Parent::findArc(t, s);
246
        if (arc != INVALID) return direct(arc, false);
247 247
      } else if (direction(p)) {
248
	Edge arc = Parent::findArc(s, t, p);
249
	if (arc != INVALID) return direct(arc, true);
250
	arc = Parent::findArc(t, s);
251
	if (arc != INVALID) return direct(arc, false);	
248
        Edge arc = Parent::findArc(s, t, p);
249
        if (arc != INVALID) return direct(arc, true);
250
        arc = Parent::findArc(t, s);
251
        if (arc != INVALID) return direct(arc, false);
252 252
      } else {
253
	Edge arc = Parent::findArc(t, s, p);
254
	if (arc != INVALID) return direct(arc, false);	      
253
        Edge arc = Parent::findArc(t, s, p);
254
        if (arc != INVALID) return direct(arc, false);
255 255
      }
... ...
@@ -269,6 +269,6 @@
269 269
          arc = Parent::findArc(t, s);
270
          if (arc != INVALID) return arc;	
270
          if (arc != INVALID) return arc;
271 271
        } else {
272 272
          Edge arc = Parent::findArc(t, s, p);
273
          if (arc != INVALID) return arc;	      
273
          if (arc != INVALID) return arc;
274 274
        }
... ...
@@ -301,8 +301,8 @@
301 301
      Red(const Node& node) : Node(node) {
302
	LEMON_ASSERT(Parent::red(node) || node == INVALID, 
303
		     typename Parent::NodeSetError());
302
        LEMON_ASSERT(Parent::red(node) || node == INVALID,
303
                     typename Parent::NodeSetError());
304 304
      }
305 305
      Red& operator=(const Node& node) {
306
	LEMON_ASSERT(Parent::red(node) || node == INVALID, 
307
		     typename Parent::NodeSetError());
306
        LEMON_ASSERT(Parent::red(node) || node == INVALID,
307
                     typename Parent::NodeSetError());
308 308
        Node::operator=(node);
... ...
@@ -333,8 +333,8 @@
333 333
      Blue(const Node& node) : Node(node) {
334
	LEMON_ASSERT(Parent::blue(node) || node == INVALID,
335
		     typename Parent::NodeSetError());
334
        LEMON_ASSERT(Parent::blue(node) || node == INVALID,
335
                     typename Parent::NodeSetError());
336 336
      }
337 337
      Blue& operator=(const Node& node) {
338
	LEMON_ASSERT(Parent::blue(node) || node == INVALID, 
339
		     typename Parent::NodeSetError());
338
        LEMON_ASSERT(Parent::blue(node) || node == INVALID,
339
                     typename Parent::NodeSetError());
340 340
        Node::operator=(node);
... ...
@@ -355,3 +355,3 @@
355 355
    }
356
  
356

	
357 357
    int id(const Blue& node) const {
... ...
@@ -369,7 +369,7 @@
369 369
      if (Parent::red(node)) {
370
	Parent::firstFromRed(arc, node);
371
	dir = true;
370
        Parent::firstFromRed(arc, node);
371
        dir = true;
372 372
      } else {
373
	Parent::firstFromBlue(arc, node);
374
	dir = static_cast<Edge&>(arc) == INVALID;
373
        Parent::firstFromBlue(arc, node);
374
        dir = static_cast<Edge&>(arc) == INVALID;
375 375
      }
... ...
@@ -378,6 +378,6 @@
378 378
      if (dir) {
379
	Parent::nextFromRed(arc);
379
        Parent::nextFromRed(arc);
380 380
      } else {
381
	Parent::nextFromBlue(arc);
382
	if (arc == INVALID) dir = true;
381
        Parent::nextFromBlue(arc);
382
        if (arc == INVALID) dir = true;
383 383
      }
... ...
@@ -391,3 +391,3 @@
391 391
      Arc(const Edge& arc, bool _forward)
392
	: Edge(arc), forward(_forward) {}
392
        : Edge(arc), forward(_forward) {}
393 393

	
... ...
@@ -397,10 +397,10 @@
397 397
      bool operator==(const Arc& i) const {
398
	return Edge::operator==(i) && forward == i.forward;
398
        return Edge::operator==(i) && forward == i.forward;
399 399
      }
400 400
      bool operator!=(const Arc& i) const {
401
	return Edge::operator!=(i) || forward != i.forward;
401
        return Edge::operator!=(i) || forward != i.forward;
402 402
      }
403 403
      bool operator<(const Arc& i) const {
404
	return Edge::operator<(i) || 
405
	  (!(i.forward<forward) && Edge(*this)<Edge(i));
404
        return Edge::operator<(i) ||
405
          (!(i.forward<forward) && Edge(*this)<Edge(i));
406 406
      }
... ...
@@ -415,3 +415,3 @@
415 415
      if (!arc.forward) {
416
	Parent::next(static_cast<Edge&>(arc));
416
        Parent::next(static_cast<Edge&>(arc));
417 417
      }
... ...
@@ -422,7 +422,7 @@
422 422
      if (Parent::red(node)) {
423
	Parent::firstFromRed(arc, node);
424
	arc.forward = true;
423
        Parent::firstFromRed(arc, node);
424
        arc.forward = true;
425 425
      } else {
426
	Parent::firstFromBlue(arc, node);
427
	arc.forward = static_cast<Edge&>(arc) == INVALID;
426
        Parent::firstFromBlue(arc, node);
427
        arc.forward = static_cast<Edge&>(arc) == INVALID;
428 428
      }
... ...
@@ -431,5 +431,5 @@
431 431
      if (arc.forward) {
432
	Parent::nextFromRed(arc);
432
        Parent::nextFromRed(arc);
433 433
      } else {
434
	Parent::nextFromBlue(arc);
434
        Parent::nextFromBlue(arc);
435 435
        arc.forward = static_cast<Edge&>(arc) == INVALID;
... ...
@@ -440,7 +440,7 @@
440 440
      if (Parent::blue(node)) {
441
	Parent::firstFromBlue(arc, node);
442
	arc.forward = true;	
441
        Parent::firstFromBlue(arc, node);
442
        arc.forward = true;
443 443
      } else {
444
	Parent::firstFromRed(arc, node);
445
	arc.forward = static_cast<Edge&>(arc) == INVALID;
444
        Parent::firstFromRed(arc, node);
445
        arc.forward = static_cast<Edge&>(arc) == INVALID;
446 446
      }
... ...
@@ -449,6 +449,6 @@
449 449
      if (arc.forward) {
450
	Parent::nextFromBlue(arc);
450
        Parent::nextFromBlue(arc);
451 451
      } else {
452
	Parent::nextFromRed(arc);
453
	arc.forward = static_cast<Edge&>(arc) == INVALID;
452
        Parent::nextFromRed(arc);
453
        arc.forward = static_cast<Edge&>(arc) == INVALID;
454 454
      }
... ...
@@ -464,3 +464,3 @@
464 464
    int id(const Arc& arc) const {
465
      return (Parent::id(static_cast<const Edge&>(arc)) << 1) + 
465
      return (Parent::id(static_cast<const Edge&>(arc)) << 1) +
466 466
        (arc.forward ? 0 : 1);
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -46,3 +46,3 @@
46 46
  Bezier1(Point _p1, Point _p2) :p1(_p1), p2(_p2) {}
47
  
47

	
48 48
  Point operator()(double t) const
... ...
@@ -56,3 +56,3 @@
56 56
  }
57
  
57

	
58 58
  Bezier1 after(double t) const
... ...
@@ -89,3 +89,3 @@
89 89
  }
90
  
90

	
91 91
  Bezier2 after(double t) const
... ...
@@ -112,8 +112,8 @@
112 112
    : p1(_p1), p2(_p2), p3(_p3), p4(_p4) {}
113
  Bezier3(const Bezier1 &b) : p1(b.p1), p2(conv(b.p1,b.p2,1.0/3.0)), 
114
			      p3(conv(b.p1,b.p2,2.0/3.0)), p4(b.p2) {}
113
  Bezier3(const Bezier1 &b) : p1(b.p1), p2(conv(b.p1,b.p2,1.0/3.0)),
114
                              p3(conv(b.p1,b.p2,2.0/3.0)), p4(b.p2) {}
115 115
  Bezier3(const Bezier2 &b) : p1(b.p1), p2(conv(b.p1,b.p2,2.0/3.0)),
116
			      p3(conv(b.p2,b.p3,1.0/3.0)), p4(b.p3) {}
117
  
118
  Point operator()(double t) const 
116
                              p3(conv(b.p2,b.p3,1.0/3.0)), p4(b.p3) {}
117

	
118
  Point operator()(double t) const
119 119
    {
... ...
@@ -121,3 +121,3 @@
121 121
      return ((1-t)*(1-t)*(1-t))*p1+(3*t*(1-t)*(1-t))*p2+
122
	(3*t*t*(1-t))*p3+(t*t*t)*p4;
122
        (3*t*t*(1-t))*p3+(t*t*t)*p4;
123 123
    }
... ...
@@ -133,3 +133,3 @@
133 133
    }
134
  
134

	
135 135
  Bezier3 after(double t) const
... ...
@@ -148,4 +148,4 @@
148 148
  Bezier2 norm() const { return Bezier2(3.0*rot90(p2-p1),
149
				  3.0*rot90(p3-p2),
150
				  3.0*rot90(p4-p3)); }
149
                                  3.0*rot90(p3-p2),
150
                                  3.0*rot90(p4-p3)); }
151 151
  Point grad(double t) const { return grad()(t); }
... ...
@@ -154,3 +154,3 @@
154 154
  template<class R,class F,class S,class D>
155
  R recSplit(F &_f,const S &_s,D _d) const 
155
  R recSplit(F &_f,const S &_s,D _d) const
156 156
  {
... ...
@@ -166,3 +166,3 @@
166 166
  }
167
  
167

	
168 168
};
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -31,4 +31,4 @@
31 31
namespace lemon {
32
  
33
  
32

	
33

	
34 34
  //#ifndef LEMON_USE_DEBUG_MAP
... ...
@@ -142,3 +142,3 @@
142 142

	
143
// #else 
143
// #else
144 144

	
... ...
@@ -149,3 +149,3 @@
149 149

	
150
// #endif  
150
// #endif
151 151

	
... ...
@@ -153,3 +153,3 @@
153 153
  template <typename _Graph, typename _Item, typename _Value>
154
  class DefaultMap 
154
  class DefaultMap
155 155
    : public DefaultMapSelector<_Graph, _Item, _Value>::Map {
... ...
@@ -158,3 +158,3 @@
158 158
    typedef DefaultMap<_Graph, _Item, _Value> Map;
159
    
159

	
160 160
    typedef typename Parent::Graph Graph;
... ...
@@ -163,3 +163,3 @@
163 163
    explicit DefaultMap(const Graph& graph) : Parent(graph) {}
164
    DefaultMap(const Graph& graph, const Value& value) 
164
    DefaultMap(const Graph& graph, const Value& value)
165 165
      : Parent(graph, value) {}
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -68,7 +68,7 @@
68 68
      if (node == Parent::source(arc))
69
	return Parent::target(arc);
69
        return Parent::target(arc);
70 70
      else if(node == Parent::target(arc))
71
	return Parent::source(arc);
71
        return Parent::source(arc);
72 72
      else
73
	return INVALID;
73
        return INVALID;
74 74
    }
... ...
@@ -91,3 +91,3 @@
91 91
    }
92
    
92

	
93 93
    ArcNotifier& notifier(Arc) const {
... ...
@@ -96,3 +96,3 @@
96 96

	
97
    class NodeIt : public Node { 
97
    class NodeIt : public Node {
98 98
      const Digraph* _digraph;
... ...
@@ -105,11 +105,11 @@
105 105
      explicit NodeIt(const Digraph& digraph) : _digraph(&digraph) {
106
	_digraph->first(static_cast<Node&>(*this));
106
        _digraph->first(static_cast<Node&>(*this));
107 107
      }
108 108

	
109
      NodeIt(const Digraph& digraph, const Node& node) 
110
	: Node(node), _digraph(&digraph) {}
109
      NodeIt(const Digraph& digraph, const Node& node)
110
        : Node(node), _digraph(&digraph) {}
111 111

	
112
      NodeIt& operator++() { 
113
	_digraph->next(*this);
114
	return *this; 
112
      NodeIt& operator++() {
113
        _digraph->next(*this);
114
        return *this;
115 115
      }
... ...
@@ -119,3 +119,3 @@
119 119

	
120
    class ArcIt : public Arc { 
120
    class ArcIt : public Arc {
121 121
      const Digraph* _digraph;
... ...
@@ -128,11 +128,11 @@
128 128
      explicit ArcIt(const Digraph& digraph) : _digraph(&digraph) {
129
	_digraph->first(static_cast<Arc&>(*this));
129
        _digraph->first(static_cast<Arc&>(*this));
130 130
      }
131 131

	
132
      ArcIt(const Digraph& digraph, const Arc& arc) : 
133
	Arc(arc), _digraph(&digraph) { }
132
      ArcIt(const Digraph& digraph, const Arc& arc) :
133
        Arc(arc), _digraph(&digraph) { }
134 134

	
135
      ArcIt& operator++() { 
136
	_digraph->next(*this);
137
	return *this; 
135
      ArcIt& operator++() {
136
        _digraph->next(*this);
137
        return *this;
138 138
      }
... ...
@@ -142,3 +142,3 @@
142 142

	
143
    class OutArcIt : public Arc { 
143
    class OutArcIt : public Arc {
144 144
      const Digraph* _digraph;
... ...
@@ -150,13 +150,13 @@
150 150

	
151
      OutArcIt(const Digraph& digraph, const Node& node) 
152
	: _digraph(&digraph) {
153
	_digraph->firstOut(*this, node);
151
      OutArcIt(const Digraph& digraph, const Node& node)
152
        : _digraph(&digraph) {
153
        _digraph->firstOut(*this, node);
154 154
      }
155 155

	
156
      OutArcIt(const Digraph& digraph, const Arc& arc) 
157
	: Arc(arc), _digraph(&digraph) {}
156
      OutArcIt(const Digraph& digraph, const Arc& arc)
157
        : Arc(arc), _digraph(&digraph) {}
158 158

	
159
      OutArcIt& operator++() { 
160
	_digraph->nextOut(*this);
161
	return *this; 
159
      OutArcIt& operator++() {
160
        _digraph->nextOut(*this);
161
        return *this;
162 162
      }
... ...
@@ -166,3 +166,3 @@
166 166

	
167
    class InArcIt : public Arc { 
167
    class InArcIt : public Arc {
168 168
      const Digraph* _digraph;
... ...
@@ -174,13 +174,13 @@
174 174

	
175
      InArcIt(const Digraph& digraph, const Node& node) 
176
	: _digraph(&digraph) {
177
	_digraph->firstIn(*this, node);
175
      InArcIt(const Digraph& digraph, const Node& node)
176
        : _digraph(&digraph) {
177
        _digraph->firstIn(*this, node);
178 178
      }
179 179

	
180
      InArcIt(const Digraph& digraph, const Arc& arc) : 
181
	Arc(arc), _digraph(&digraph) {}
180
      InArcIt(const Digraph& digraph, const Arc& arc) :
181
        Arc(arc), _digraph(&digraph) {}
182 182

	
183
      InArcIt& operator++() { 
184
	_digraph->nextIn(*this);
185
	return *this; 
183
      InArcIt& operator++() {
184
        _digraph->nextIn(*this);
185
        return *this;
186 186
      }
... ...
@@ -217,5 +217,5 @@
217 217

	
218
    
218

	
219 219
    template <typename _Value>
220
    class NodeMap 
220
    class NodeMap
221 221
      : public MapExtender<DefaultMap<Digraph, Node, _Value> > {
... ...
@@ -225,9 +225,9 @@
225 225

	
226
      explicit NodeMap(const Digraph& digraph) 
227
	: Parent(digraph) {}
228
      NodeMap(const Digraph& digraph, const _Value& value) 
229
	: Parent(digraph, value) {}
226
      explicit NodeMap(const Digraph& digraph)
227
        : Parent(digraph) {}
228
      NodeMap(const Digraph& digraph, const _Value& value)
229
        : Parent(digraph, value) {}
230 230

	
231 231
      NodeMap& operator=(const NodeMap& cmap) {
232
	return operator=<NodeMap>(cmap);
232
        return operator=<NodeMap>(cmap);
233 233
      }
... ...
@@ -237,3 +237,3 @@
237 237
        Parent::operator=(cmap);
238
	return *this;
238
        return *this;
239 239
      }
... ...
@@ -243,3 +243,3 @@
243 243
    template <typename _Value>
244
    class ArcMap 
244
    class ArcMap
245 245
      : public MapExtender<DefaultMap<Digraph, Arc, _Value> > {
... ...
@@ -249,9 +249,9 @@
249 249

	
250
      explicit ArcMap(const Digraph& digraph) 
251
	: Parent(digraph) {}
252
      ArcMap(const Digraph& digraph, const _Value& value) 
253
	: Parent(digraph, value) {}
250
      explicit ArcMap(const Digraph& digraph)
251
        : Parent(digraph) {}
252
      ArcMap(const Digraph& digraph, const _Value& value)
253
        : Parent(digraph, value) {}
254 254

	
255 255
      ArcMap& operator=(const ArcMap& cmap) {
256
	return operator=<ArcMap>(cmap);
256
        return operator=<ArcMap>(cmap);
257 257
      }
... ...
@@ -261,3 +261,3 @@
261 261
        Parent::operator=(cmap);
262
	return *this;
262
        return *this;
263 263
      }
... ...
@@ -271,3 +271,3 @@
271 271
    }
272
    
272

	
273 273
    Arc addArc(const Node& from, const Node& to) {
... ...
@@ -295,5 +295,5 @@
295 295
      while (arc != INVALID ) {
296
	erase(arc);
297
	Parent::firstOut(arc, node);
298
      } 
296
        erase(arc);
297
        Parent::firstOut(arc, node);
298
      }
299 299

	
... ...
@@ -301,4 +301,4 @@
301 301
      while (arc != INVALID ) {
302
	erase(arc);
303
	Parent::firstIn(arc, node);
302
        erase(arc);
303
        Parent::firstIn(arc, node);
304 304
      }
... ...
@@ -308,3 +308,3 @@
308 308
    }
309
    
309

	
310 310
    void erase(const Arc& arc) {
... ...
@@ -317,4 +317,4 @@
317 317
      arc_notifier.setContainer(*this);
318
    } 
319
    
318
    }
319

	
320 320

	
... ...
@@ -329,6 +329,6 @@
329 329
  /// \brief Extender for the Graphs
330
  template <typename Base> 
330
  template <typename Base>
331 331
  class GraphExtender : public Base {
332 332
  public:
333
    
333

	
334 334
    typedef Base Parent;
... ...
@@ -342,3 +342,3 @@
342 342

	
343
    // Graph extension    
343
    // Graph extension
344 344

	
... ...
@@ -370,7 +370,7 @@
370 370
      if( n == Parent::u(e))
371
	return Parent::v(e);
371
        return Parent::v(e);
372 372
      else if( n == Parent::v(e))
373
	return Parent::u(e);
373
        return Parent::u(e);
374 374
      else
375
	return INVALID;
375
        return INVALID;
376 376
    }
... ...
@@ -404,3 +404,3 @@
404 404
    }
405
    
405

	
406 406
    ArcNotifier& notifier(Arc) const {
... ...
@@ -415,3 +415,3 @@
415 415

	
416
    class NodeIt : public Node { 
416
    class NodeIt : public Node {
417 417
      const Graph* _graph;
... ...
@@ -424,11 +424,11 @@
424 424
      explicit NodeIt(const Graph& graph) : _graph(&graph) {
425
	_graph->first(static_cast<Node&>(*this));
425
        _graph->first(static_cast<Node&>(*this));
426 426
      }
427 427

	
428
      NodeIt(const Graph& graph, const Node& node) 
429
	: Node(node), _graph(&graph) {}
428
      NodeIt(const Graph& graph, const Node& node)
429
        : Node(node), _graph(&graph) {}
430 430

	
431
      NodeIt& operator++() { 
432
	_graph->next(*this);
433
	return *this; 
431
      NodeIt& operator++() {
432
        _graph->next(*this);
433
        return *this;
434 434
      }
... ...
@@ -438,3 +438,3 @@
438 438

	
439
    class ArcIt : public Arc { 
439
    class ArcIt : public Arc {
440 440
      const Graph* _graph;
... ...
@@ -447,11 +447,11 @@
447 447
      explicit ArcIt(const Graph& graph) : _graph(&graph) {
448
	_graph->first(static_cast<Arc&>(*this));
448
        _graph->first(static_cast<Arc&>(*this));
449 449
      }
450 450

	
451
      ArcIt(const Graph& graph, const Arc& arc) : 
452
	Arc(arc), _graph(&graph) { }
451
      ArcIt(const Graph& graph, const Arc& arc) :
452
        Arc(arc), _graph(&graph) { }
453 453

	
454
      ArcIt& operator++() { 
455
	_graph->next(*this);
456
	return *this; 
454
      ArcIt& operator++() {
455
        _graph->next(*this);
456
        return *this;
457 457
      }
... ...
@@ -461,3 +461,3 @@
461 461

	
462
    class OutArcIt : public Arc { 
462
    class OutArcIt : public Arc {
463 463
      const Graph* _graph;
... ...
@@ -469,13 +469,13 @@
469 469

	
470
      OutArcIt(const Graph& graph, const Node& node) 
471
	: _graph(&graph) {
472
	_graph->firstOut(*this, node);
470
      OutArcIt(const Graph& graph, const Node& node)
471
        : _graph(&graph) {
472
        _graph->firstOut(*this, node);
473 473
      }
474 474

	
475
      OutArcIt(const Graph& graph, const Arc& arc) 
476
	: Arc(arc), _graph(&graph) {}
475
      OutArcIt(const Graph& graph, const Arc& arc)
476
        : Arc(arc), _graph(&graph) {}
477 477

	
478
      OutArcIt& operator++() { 
479
	_graph->nextOut(*this);
480
	return *this; 
478
      OutArcIt& operator++() {
479
        _graph->nextOut(*this);
480
        return *this;
481 481
      }
... ...
@@ -485,3 +485,3 @@
485 485

	
486
    class InArcIt : public Arc { 
486
    class InArcIt : public Arc {
487 487
      const Graph* _graph;
... ...
@@ -493,13 +493,13 @@
493 493

	
494
      InArcIt(const Graph& graph, const Node& node) 
495
	: _graph(&graph) {
496
	_graph->firstIn(*this, node);
494
      InArcIt(const Graph& graph, const Node& node)
495
        : _graph(&graph) {
496
        _graph->firstIn(*this, node);
497 497
      }
498 498

	
499
      InArcIt(const Graph& graph, const Arc& arc) : 
500
	Arc(arc), _graph(&graph) {}
499
      InArcIt(const Graph& graph, const Arc& arc) :
500
        Arc(arc), _graph(&graph) {}
501 501

	
502
      InArcIt& operator++() { 
503
	_graph->nextIn(*this);
504
	return *this; 
502
      InArcIt& operator++() {
503
        _graph->nextIn(*this);
504
        return *this;
505 505
      }
... ...
@@ -509,3 +509,3 @@
509 509

	
510
    class EdgeIt : public Parent::Edge { 
510
    class EdgeIt : public Parent::Edge {
511 511
      const Graph* _graph;
... ...
@@ -518,11 +518,11 @@
518 518
      explicit EdgeIt(const Graph& graph) : _graph(&graph) {
519
	_graph->first(static_cast<Edge&>(*this));
519
        _graph->first(static_cast<Edge&>(*this));
520 520
      }
521 521

	
522
      EdgeIt(const Graph& graph, const Edge& edge) : 
523
	Edge(edge), _graph(&graph) { }
522
      EdgeIt(const Graph& graph, const Edge& edge) :
523
        Edge(edge), _graph(&graph) { }
524 524

	
525
      EdgeIt& operator++() { 
526
	_graph->next(*this);
527
	return *this; 
525
      EdgeIt& operator++() {
526
        _graph->next(*this);
527
        return *this;
528 528
      }
... ...
@@ -542,3 +542,3 @@
542 542
      IncEdgeIt(const Graph& graph, const Node &node) : _graph(&graph) {
543
	_graph->firstInc(*this, _direction, node);
543
        _graph->firstInc(*this, _direction, node);
544 544
      }
... ...
@@ -546,4 +546,4 @@
546 546
      IncEdgeIt(const Graph& graph, const Edge &edge, const Node &node)
547
	: _graph(&graph), Edge(edge) {
548
	_direction = (_graph->source(edge) == node);
547
        : _graph(&graph), Edge(edge) {
548
        _direction = (_graph->source(edge) == node);
549 549
      }
... ...
@@ -551,4 +551,4 @@
551 551
      IncEdgeIt& operator++() {
552
	_graph->nextInc(*this, _direction);
553
	return *this; 
552
        _graph->nextInc(*this, _direction);
553
        return *this;
554 554
      }
... ...
@@ -600,3 +600,3 @@
600 600
    template <typename _Value>
601
    class NodeMap 
601
    class NodeMap
602 602
      : public MapExtender<DefaultMap<Graph, Node, _Value> > {
... ...
@@ -606,9 +606,9 @@
606 606

	
607
      NodeMap(const Graph& graph) 
608
	: Parent(graph) {}
609
      NodeMap(const Graph& graph, const _Value& value) 
610
	: Parent(graph, value) {}
607
      NodeMap(const Graph& graph)
608
        : Parent(graph) {}
609
      NodeMap(const Graph& graph, const _Value& value)
610
        : Parent(graph, value) {}
611 611

	
612 612
      NodeMap& operator=(const NodeMap& cmap) {
613
	return operator=<NodeMap>(cmap);
613
        return operator=<NodeMap>(cmap);
614 614
      }
... ...
@@ -618,3 +618,3 @@
618 618
        Parent::operator=(cmap);
619
	return *this;
619
        return *this;
620 620
      }
... ...
@@ -624,3 +624,3 @@
624 624
    template <typename _Value>
625
    class ArcMap 
625
    class ArcMap
626 626
      : public MapExtender<DefaultMap<Graph, Arc, _Value> > {
... ...
@@ -630,9 +630,9 @@
630 630

	
631
      ArcMap(const Graph& graph) 
632
	: Parent(graph) {}
633
      ArcMap(const Graph& graph, const _Value& value) 
634
	: Parent(graph, value) {}
631
      ArcMap(const Graph& graph)
632
        : Parent(graph) {}
633
      ArcMap(const Graph& graph, const _Value& value)
634
        : Parent(graph, value) {}
635 635

	
636 636
      ArcMap& operator=(const ArcMap& cmap) {
637
	return operator=<ArcMap>(cmap);
637
        return operator=<ArcMap>(cmap);
638 638
      }
... ...
@@ -642,3 +642,3 @@
642 642
        Parent::operator=(cmap);
643
	return *this;
643
        return *this;
644 644
      }
... ...
@@ -648,3 +648,3 @@
648 648
    template <typename _Value>
649
    class EdgeMap 
649
    class EdgeMap
650 650
      : public MapExtender<DefaultMap<Graph, Edge, _Value> > {
... ...
@@ -654,10 +654,10 @@
654 654

	
655
      EdgeMap(const Graph& graph) 
656
	: Parent(graph) {}
655
      EdgeMap(const Graph& graph)
656
        : Parent(graph) {}
657 657

	
658
      EdgeMap(const Graph& graph, const _Value& value) 
659
	: Parent(graph, value) {}
658
      EdgeMap(const Graph& graph, const _Value& value)
659
        : Parent(graph, value) {}
660 660

	
661 661
      EdgeMap& operator=(const EdgeMap& cmap) {
662
	return operator=<EdgeMap>(cmap);
662
        return operator=<EdgeMap>(cmap);
663 663
      }
... ...
@@ -667,3 +667,3 @@
667 667
        Parent::operator=(cmap);
668
	return *this;
668
        return *this;
669 669
      }
... ...
@@ -685,3 +685,3 @@
685 685
      ev.push_back(Parent::direct(edge, true));
686
      ev.push_back(Parent::direct(edge, false));      
686
      ev.push_back(Parent::direct(edge, false));
687 687
      notifier(Arc()).add(ev);
... ...
@@ -689,3 +689,3 @@
689 689
    }
690
    
690

	
691 691
    void clear() {
... ...
@@ -698,3 +698,3 @@
698 698
    template <typename Graph, typename NodeRefMap, typename EdgeRefMap>
699
    void build(const Graph& graph, NodeRefMap& nodeRef, 
699
    void build(const Graph& graph, NodeRefMap& nodeRef,
700 700
               EdgeRefMap& edgeRef) {
... ...
@@ -710,5 +710,5 @@
710 710
      while (arc != INVALID ) {
711
	erase(arc);
712
	Parent::firstOut(arc, node);
713
      } 
711
        erase(arc);
712
        Parent::firstOut(arc, node);
713
      }
714 714

	
... ...
@@ -716,4 +716,4 @@
716 716
      while (arc != INVALID ) {
717
	erase(arc);
718
	Parent::firstIn(arc, node);
717
        erase(arc);
718
        Parent::firstIn(arc, node);
719 719
      }
... ...
@@ -727,3 +727,3 @@
727 727
      av.push_back(Parent::direct(edge, true));
728
      av.push_back(Parent::direct(edge, false));      
728
      av.push_back(Parent::direct(edge, false));
729 729
      notifier(Arc()).erase(av);
... ...
@@ -734,6 +734,6 @@
734 734
    GraphExtender() {
735
      node_notifier.setContainer(*this); 
735
      node_notifier.setContainer(*this);
736 736
      arc_notifier.setContainer(*this);
737 737
      edge_notifier.setContainer(*this);
738
    } 
738
    }
739 739

	
... ...
@@ -742,4 +742,4 @@
742 742
      arc_notifier.clear();
743
      node_notifier.clear(); 
744
    } 
743
      node_notifier.clear();
744
    }
745 745

	
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -36,3 +36,3 @@
36 36
  };
37
  
37

	
38 38
  /// \brief Invalid iterators.
... ...
@@ -54,2 +54,2 @@
54 54
#endif
55
  
55

	
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -34,3 +34,3 @@
34 34
  /// \ingroup graphbits
35
  /// 
35
  ///
36 36
  /// \brief Extender for maps
... ...
@@ -58,6 +58,6 @@
58 58

	
59
    MapExtender(const Graph& graph) 
59
    MapExtender(const Graph& graph)
60 60
      : Parent(graph) {}
61 61

	
62
    MapExtender(const Graph& graph, const Value& value) 
62
    MapExtender(const Graph& graph, const Value& value)
63 63
      : Parent(graph, value) {}
... ...
@@ -72,3 +72,3 @@
72 72
      return *this;
73
    } 
73
    }
74 74

	
... ...
@@ -76,6 +76,6 @@
76 76
    public:
77
      
77

	
78 78
      typedef Item Parent;
79 79
      typedef typename Map::Value Value;
80
      
80

	
81 81
      MapIt() {}
... ...
@@ -88,12 +88,12 @@
88 88

	
89
      MapIt(const Map& _map, const Item& item) 
90
	: Parent(item), map(_map) {}
89
      MapIt(const Map& _map, const Item& item)
90
        : Parent(item), map(_map) {}
91 91

	
92
      MapIt& operator++() { 
93
	map.notifier()->next(*this);
94
	return *this; 
92
      MapIt& operator++() {
93
        map.notifier()->next(*this);
94
        return *this;
95 95
      }
96
      
96

	
97 97
      typename MapTraits<Map>::ConstReturnValue operator*() const {
98
	return map[*this];
98
        return map[*this];
99 99
      }
... ...
@@ -101,12 +101,12 @@
101 101
      typename MapTraits<Map>::ReturnValue operator*() {
102
	return map[*this];
102
        return map[*this];
103 103
      }
104
      
104

	
105 105
      void set(const Value& value) {
106
	map.set(*this, value);
106
        map.set(*this, value);
107 107
      }
108
      
108

	
109 109
    protected:
110 110
      Map& map;
111
      
111

	
112 112
    };
... ...
@@ -119,3 +119,3 @@
119 119
      typedef typename Map::Value Value;
120
      
120

	
121 121
      ConstMapIt() {}
... ...
@@ -128,8 +128,8 @@
128 128

	
129
      ConstMapIt(const Map& _map, const Item& item) 
130
	: Parent(item), map(_map) {}
129
      ConstMapIt(const Map& _map, const Item& item)
130
        : Parent(item), map(_map) {}
131 131

	
132
      ConstMapIt& operator++() { 
133
	map.notifier()->next(*this);
134
	return *this; 
132
      ConstMapIt& operator++() {
133
        map.notifier()->next(*this);
134
        return *this;
135 135
      }
... ...
@@ -137,3 +137,3 @@
137 137
      typename MapTraits<Map>::ConstReturnValue operator*() const {
138
	return map[*this];
138
        return map[*this];
139 139
      }
... ...
@@ -146,5 +146,5 @@
146 146
    public:
147
      
147

	
148 148
      typedef Item Parent;
149
      
149

	
150 150
      ItemIt() {}
... ...
@@ -157,8 +157,8 @@
157 157

	
158
      ItemIt(const Map& _map, const Item& item) 
159
	: Parent(item), map(_map) {}
158
      ItemIt(const Map& _map, const Item& item)
159
        : Parent(item), map(_map) {}
160 160

	
161
      ItemIt& operator++() { 
162
	map.notifier()->next(*this);
163
	return *this; 
161
      ItemIt& operator++() {
162
        map.notifier()->next(*this);
163
        return *this;
164 164
      }
... ...
@@ -167,3 +167,3 @@
167 167
      const Map& map;
168
      
168

	
169 169
    };
... ...
@@ -172,3 +172,3 @@
172 172
  /// \ingroup graphbits
173
  /// 
173
  ///
174 174
  /// \brief Extender for maps which use a subset of the items.
... ...
@@ -196,6 +196,6 @@
196 196

	
197
    SubMapExtender(const Graph& _graph) 
197
    SubMapExtender(const Graph& _graph)
198 198
      : Parent(_graph), graph(_graph) {}
199 199

	
200
    SubMapExtender(const Graph& _graph, const Value& _value) 
200
    SubMapExtender(const Graph& _graph, const Value& _value)
201 201
      : Parent(_graph, _value), graph(_graph) {}
... ...
@@ -214,3 +214,3 @@
214 214
      return *this;
215
    } 
215
    }
216 216

	
... ...
@@ -218,6 +218,6 @@
218 218
    public:
219
      
219

	
220 220
      typedef Item Parent;
221 221
      typedef typename Map::Value Value;
222
      
222

	
223 223
      MapIt() {}
... ...
@@ -230,12 +230,12 @@
230 230

	
231
      MapIt(const Map& _map, const Item& item) 
232
	: Parent(item), map(_map) {}
231
      MapIt(const Map& _map, const Item& item)
232
        : Parent(item), map(_map) {}
233 233

	
234
      MapIt& operator++() { 
235
	map.graph.next(*this);
236
	return *this; 
234
      MapIt& operator++() {
235
        map.graph.next(*this);
236
        return *this;
237 237
      }
238
      
238

	
239 239
      typename MapTraits<Map>::ConstReturnValue operator*() const {
240
	return map[*this];
240
        return map[*this];
241 241
      }
... ...
@@ -243,12 +243,12 @@
243 243
      typename MapTraits<Map>::ReturnValue operator*() {
244
	return map[*this];
244
        return map[*this];
245 245
      }
246
      
246

	
247 247
      void set(const Value& value) {
248
	map.set(*this, value);
248
        map.set(*this, value);
249 249
      }
250
      
250

	
251 251
    protected:
252 252
      Map& map;
253
      
253

	
254 254
    };
... ...
@@ -261,3 +261,3 @@
261 261
      typedef typename Map::Value Value;
262
      
262

	
263 263
      ConstMapIt() {}
... ...
@@ -270,8 +270,8 @@
270 270

	
271
      ConstMapIt(const Map& _map, const Item& item) 
272
	: Parent(item), map(_map) {}
271
      ConstMapIt(const Map& _map, const Item& item)
272
        : Parent(item), map(_map) {}
273 273

	
274
      ConstMapIt& operator++() { 
275
	map.graph.next(*this);
276
	return *this; 
274
      ConstMapIt& operator++() {
275
        map.graph.next(*this);
276
        return *this;
277 277
      }
... ...
@@ -279,3 +279,3 @@
279 279
      typename MapTraits<Map>::ConstReturnValue operator*() const {
280
	return map[*this];
280
        return map[*this];
281 281
      }
... ...
@@ -288,5 +288,5 @@
288 288
    public:
289
      
289

	
290 290
      typedef Item Parent;
291
      
291

	
292 292
      ItemIt() {}
... ...
@@ -299,8 +299,8 @@
299 299

	
300
      ItemIt(const Map& _map, const Item& item) 
301
	: Parent(item), map(_map) {}
300
      ItemIt(const Map& _map, const Item& item)
301
        : Parent(item), map(_map) {}
302 302

	
303
      ItemIt& operator++() { 
304
	map.graph.next(*this);
305
	return *this; 
303
      ItemIt& operator++() {
304
        map.graph.next(*this);
305
        return *this;
306 306
      }
... ...
@@ -309,5 +309,5 @@
309 309
      const Map& map;
310
      
310

	
311 311
    };
312
    
312

	
313 313
  private:
... ...
@@ -315,3 +315,3 @@
315 315
    const Graph& graph;
316
    
316

	
317 317
  };
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -55,3 +55,3 @@
55 55
      RevArcIt(Invalid) : path(0), current(INVALID) {}
56
      RevArcIt(const PredMapPath& _path) 
56
      RevArcIt(const PredMapPath& _path)
57 57
        : path(&_path), current(_path.target) {
... ...
@@ -70,4 +70,4 @@
70 70

	
71
      bool operator==(const RevArcIt& e) const { 
72
        return current == e.current; 
71
      bool operator==(const RevArcIt& e) const {
72
        return current == e.current;
73 73
      }
... ...
@@ -75,9 +75,9 @@
75 75
      bool operator!=(const RevArcIt& e) const {
76
        return current != e.current; 
76
        return current != e.current;
77 77
      }
78 78

	
79
      bool operator<(const RevArcIt& e) const { 
80
        return current < e.current; 
79
      bool operator<(const RevArcIt& e) const {
80
        return current < e.current;
81 81
      }
82
      
82

	
83 83
    private:
... ...
@@ -103,7 +103,7 @@
103 103

	
104
    PredMatrixMapPath(const Digraph& _digraph, 
104
    PredMatrixMapPath(const Digraph& _digraph,
105 105
                      const PredMatrixMap& _predMatrixMap,
106
                      typename Digraph::Node _source, 
106
                      typename Digraph::Node _source,
107 107
                      typename Digraph::Node _target)
108
      : digraph(_digraph), predMatrixMap(_predMatrixMap), 
108
      : digraph(_digraph), predMatrixMap(_predMatrixMap),
109 109
        source(_source), target(_target) {}
... ...
@@ -129,5 +129,5 @@
129 129
      RevArcIt(Invalid) : path(0), current(INVALID) {}
130
      RevArcIt(const PredMatrixMapPath& _path) 
130
      RevArcIt(const PredMatrixMapPath& _path)
131 131
        : path(&_path), current(_path.target) {
132
        if (path->predMatrixMap(path->source, current) == INVALID) 
132
        if (path->predMatrixMap(path->source, current) == INVALID)
133 133
          current = INVALID;
... ...
@@ -140,5 +140,5 @@
140 140
      RevArcIt& operator++() {
141
        current = 
141
        current =
142 142
          path->digraph.source(path->predMatrixMap(path->source, current));
143
        if (path->predMatrixMap(path->source, current) == INVALID) 
143
        if (path->predMatrixMap(path->source, current) == INVALID)
144 144
          current = INVALID;
... ...
@@ -147,4 +147,4 @@
147 147

	
148
      bool operator==(const RevArcIt& e) const { 
149
        return current == e.current; 
148
      bool operator==(const RevArcIt& e) const {
149
        return current == e.current;
150 150
      }
... ...
@@ -152,9 +152,9 @@
152 152
      bool operator!=(const RevArcIt& e) const {
153
        return current != e.current; 
153
        return current != e.current;
154 154
      }
155 155

	
156
      bool operator<(const RevArcIt& e) const { 
157
        return current < e.current; 
156
      bool operator<(const RevArcIt& e) const {
157
        return current < e.current;
158 158
      }
159
      
159

	
160 160
    private:
Ignore white space 6 line context
1

	
2
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
3 2
 *
4
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
5 4
 *
... ...
@@ -31,3 +30,3 @@
31 30
  class ItemSetTraits {};
32
  
31

	
33 32

	
... ...
@@ -39,5 +38,5 @@
39 38
  struct NodeNotifierIndicator<
40
    Graph, 
39
    Graph,
41 40
    typename enable_if<typename Graph::NodeNotifier::Notifier, void>::type
42
  > { 
41
  > {
43 42
    typedef typename Graph::NodeNotifier Type;
... ...
@@ -48,3 +47,3 @@
48 47
  public:
49
    
48

	
50 49
    typedef _Graph Graph;
... ...
@@ -59,4 +58,4 @@
59 58
    public:
60
      typedef typename Graph::template NodeMap<_Value> Parent; 
61
      typedef typename Graph::template NodeMap<_Value> Type; 
59
      typedef typename Graph::template NodeMap<_Value> Parent;
60
      typedef typename Graph::template NodeMap<_Value> Type;
62 61
      typedef typename Parent::Value Value;
... ...
@@ -64,4 +63,4 @@
64 63
      Map(const Graph& _digraph) : Parent(_digraph) {}
65
      Map(const Graph& _digraph, const Value& _value) 
66
	: Parent(_digraph, _value) {}
64
      Map(const Graph& _digraph, const Value& _value)
65
        : Parent(_digraph, _value) {}
67 66

	
... ...
@@ -77,5 +76,5 @@
77 76
  struct ArcNotifierIndicator<
78
    Graph, 
77
    Graph,
79 78
    typename enable_if<typename Graph::ArcNotifier::Notifier, void>::type
80
  > { 
79
  > {
81 80
    typedef typename Graph::ArcNotifier Type;
... ...
@@ -86,3 +85,3 @@
86 85
  public:
87
    
86

	
88 87
    typedef _Graph Graph;
... ...
@@ -97,4 +96,4 @@
97 96
    public:
98
      typedef typename Graph::template ArcMap<_Value> Parent; 
99
      typedef typename Graph::template ArcMap<_Value> Type; 
97
      typedef typename Graph::template ArcMap<_Value> Parent;
98
      typedef typename Graph::template ArcMap<_Value> Type;
100 99
      typedef typename Parent::Value Value;
... ...
@@ -102,4 +101,4 @@
102 101
      Map(const Graph& _digraph) : Parent(_digraph) {}
103
      Map(const Graph& _digraph, const Value& _value) 
104
	: Parent(_digraph, _value) {}
102
      Map(const Graph& _digraph, const Value& _value)
103
        : Parent(_digraph, _value) {}
105 104
    };
... ...
@@ -114,5 +113,5 @@
114 113
  struct EdgeNotifierIndicator<
115
    Graph, 
114
    Graph,
116 115
    typename enable_if<typename Graph::EdgeNotifier::Notifier, void>::type
117
  > { 
116
  > {
118 117
    typedef typename Graph::EdgeNotifier Type;
... ...
@@ -123,3 +122,3 @@
123 122
  public:
124
    
123

	
125 124
    typedef _Graph Graph;
... ...
@@ -134,4 +133,4 @@
134 133
    public:
135
      typedef typename Graph::template EdgeMap<_Value> Parent; 
136
      typedef typename Graph::template EdgeMap<_Value> Type; 
134
      typedef typename Graph::template EdgeMap<_Value> Parent;
135
      typedef typename Graph::template EdgeMap<_Value> Type;
137 136
      typedef typename Parent::Value Value;
... ...
@@ -139,4 +138,4 @@
139 138
      Map(const Graph& _digraph) : Parent(_digraph) {}
140
      Map(const Graph& _digraph, const Value& _value) 
141
	: Parent(_digraph, _value) {}
139
      Map(const Graph& _digraph, const Value& _value)
140
        : Parent(_digraph, _value) {}
142 141
    };
... ...
@@ -158,6 +157,6 @@
158 157
  struct MapTraits<
159
    Map, typename enable_if<typename Map::ReferenceMapTag, void>::type > 
158
    Map, typename enable_if<typename Map::ReferenceMapTag, void>::type >
160 159
  {
161 160
    typedef True ReferenceMapTag;
162
    
161

	
163 162
    typedef typename Map::Key Key;
... ...
@@ -168,3 +167,3 @@
168 167

	
169
    typedef typename Map::ConstReference ConstReference; 
168
    typedef typename Map::ConstReference ConstReference;
170 169
    typedef typename Map::Reference Reference;
... ...
@@ -186,7 +185,7 @@
186 185
  struct MatrixMapTraits<
187
    MatrixMap, typename enable_if<typename MatrixMap::ReferenceMapTag, 
188
                                  void>::type > 
186
    MatrixMap, typename enable_if<typename MatrixMap::ReferenceMapTag,
187
                                  void>::type >
189 188
  {
190 189
    typedef True ReferenceMapTag;
191
    
190

	
192 191
    typedef typename MatrixMap::FirstKey FirstKey;
... ...
@@ -198,3 +197,3 @@
198 197

	
199
    typedef typename MatrixMap::ConstReference ConstReference; 
198
    typedef typename MatrixMap::ConstReference ConstReference;
200 199
    typedef typename MatrixMap::Reference Reference;
... ...
@@ -211,3 +210,3 @@
211 210
  struct NodeNumTagIndicator<
212
    Graph, 
211
    Graph,
213 212
    typename enable_if<typename Graph::NodeNumTag, void>::type
... ...
@@ -224,3 +223,3 @@
224 223
  struct EdgeNumTagIndicator<
225
    Graph, 
224
    Graph,
226 225
    typename enable_if<typename Graph::EdgeNumTag, void>::type
... ...
@@ -237,3 +236,3 @@
237 236
  struct FindEdgeTagIndicator<
238
    Graph, 
237
    Graph,
239 238
    typename enable_if<typename Graph::FindEdgeTag, void>::type
... ...
@@ -250,3 +249,3 @@
250 249
  struct UndirectedTagIndicator<
251
    Graph, 
250
    Graph,
252 251
    typename enable_if<typename Graph::UndirectedTag, void>::type
... ...
@@ -263,3 +262,3 @@
263 262
  struct BuildTagIndicator<
264
    Graph, 
263
    Graph,
265 264
    typename enable_if<typename Graph::BuildTag, void>::type
Show white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -85,3 +85,3 @@
85 85
  /**************** enable_if from BOOST ****************/
86
  
86

	
87 87
  template <typename Type, typename T = void>
... ...
@@ -91,3 +91,3 @@
91 91

	
92
 
92

	
93 93
  template <bool B, class T = void>
... ...
@@ -100,3 +100,3 @@
100 100

	
101
  template <class Cond, class T = void> 
101
  template <class Cond, class T = void>
102 102
  struct enable_if : public enable_if_c<Cond::value, T> {};
... ...
@@ -111,3 +111,3 @@
111 111

	
112
  template <class Cond, class T> 
112
  template <class Cond, class T>
113 113
  struct lazy_enable_if : public lazy_enable_if_c<Cond::value, T> {};
... ...
@@ -123,3 +123,3 @@
123 123

	
124
  template <class Cond, class T = void> 
124
  template <class Cond, class T = void>
125 125
  struct disable_if : public disable_if_c<Cond::value, T> {};
... ...
@@ -134,3 +134,3 @@
134 134

	
135
  template <class Cond, class T> 
135
  template <class Cond, class T>
136 136
  struct lazy_disable_if : public lazy_disable_if_c<Cond::value, T> {};
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -51,8 +51,8 @@
51 51
  template <typename _Graph, typename _Item, typename _Value>
52
  class VectorMap 
52
  class VectorMap
53 53
    : public ItemSetTraits<_Graph, _Item>::ItemNotifier::ObserverBase {
54 54
  private:
55
		
55

	
56 56
    /// The container type of the map.
57
    typedef std::vector<_Value> Container;	
57
    typedef std::vector<_Value> Container;
58 58

	
... ...
@@ -60,3 +60,3 @@
60 60

	
61
    /// The graph type of the map. 
61
    /// The graph type of the map.
62 62
    typedef _Graph Graph;
... ...
@@ -95,5 +95,5 @@
95 95

	
96
    /// \brief Constructor uses given value to initialize the map. 
96
    /// \brief Constructor uses given value to initialize the map.
97 97
    ///
98
    /// It constructs a map uses a given value to initialize the map. 
98
    /// It constructs a map uses a given value to initialize the map.
99 99
    /// It adds all the items of the graph to the map.
... ...
@@ -109,4 +109,4 @@
109 109
      if (_copy.attached()) {
110
	Parent::attach(*_copy.notifier());
111
	container = _copy.container;
110
        Parent::attach(*_copy.notifier());
111
        container = _copy.container;
112 112
      }
... ...
@@ -117,6 +117,6 @@
117 117
    /// This operator assigns for each item in the map the
118
    /// value mapped to the same item in the copied map.  
118
    /// value mapped to the same item in the copied map.
119 119
    /// The parameter map should be indiced with the same
120 120
    /// itemset because this assign operator does not change
121
    /// the container of the map. 
121
    /// the container of the map.
122 122
    VectorMap& operator=(const VectorMap& cmap) {
... ...
@@ -131,3 +131,3 @@
131 131
    /// the NodeMap. In this case the value for each item
132
    /// is assigned by the value of the given ReadMap. 
132
    /// is assigned by the value of the given ReadMap.
133 133
    template <typename CMap>
... ...
@@ -142,3 +142,3 @@
142 142
    }
143
    
143

	
144 144
  public:
... ...
@@ -148,7 +148,7 @@
148 148
    /// The subscript operator. The map can be subscripted by the
149
    /// actual items of the graph.      
149
    /// actual items of the graph.
150 150
    Reference operator[](const Key& key) {
151 151
      return container[Parent::notifier()->id(key)];
152
    } 
153
		
152
    }
153

	
154 154
    /// \brief The const subcript operator.
... ...
@@ -156,3 +156,3 @@
156 156
    /// The const subscript operator. The map can be subscripted by the
157
    /// actual items of the graph. 
157
    /// actual items of the graph.
158 158
    ConstReference operator[](const Key& key) const {
... ...
@@ -172,5 +172,5 @@
172 172
    /// \brief Adds a new key to the map.
173
    ///		
173
    ///
174 174
    /// It adds a new key to the map. It called by the observer notifier
175
    /// and it overrides the add() member function of the observer base.     
175
    /// and it overrides the add() member function of the observer base.
176 176
    virtual void add(const Key& key) {
... ...
@@ -178,3 +178,3 @@
178 178
      if (id >= int(container.size())) {
179
	container.resize(id + 1);
179
        container.resize(id + 1);
180 180
      }
... ...
@@ -183,5 +183,5 @@
183 183
    /// \brief Adds more new keys to the map.
184
    ///		
184
    ///
185 185
    /// It adds more new keys to the map. It called by the observer notifier
186
    /// and it overrides the add() member function of the observer base.     
186
    /// and it overrides the add() member function of the observer base.
187 187
    virtual void add(const std::vector<Key>& keys) {
... ...
@@ -200,3 +200,3 @@
200 200
    /// Erase a key from the map. It called by the observer notifier
201
    /// and it overrides the erase() member function of the observer base.     
201
    /// and it overrides the erase() member function of the observer base.
202 202
    virtual void erase(const Key& key) {
... ...
@@ -208,14 +208,14 @@
208 208
    /// Erase more keys from the map. It called by the observer notifier
209
    /// and it overrides the erase() member function of the observer base.     
209
    /// and it overrides the erase() member function of the observer base.
210 210
    virtual void erase(const std::vector<Key>& keys) {
211 211
      for (int i = 0; i < int(keys.size()); ++i) {
212
	container[Parent::notifier()->id(keys[i])] = Value();
212
        container[Parent::notifier()->id(keys[i])] = Value();
213 213
      }
214 214
    }
215
    
215

	
216 216
    /// \brief Buildes the map.
217
    ///	
217
    ///
218 218
    /// It buildes the map. It called by the observer notifier
219 219
    /// and it overrides the build() member function of the observer base.
220
    virtual void build() { 
220
    virtual void build() {
221 221
      int size = Parent::notifier()->maxId() + 1;
... ...
@@ -228,9 +228,9 @@
228 228
    /// It erase all items from the map. It called by the observer notifier
229
    /// and it overrides the clear() member function of the observer base.     
230
    virtual void clear() { 
229
    /// and it overrides the clear() member function of the observer base.
230
    virtual void clear() {
231 231
      container.clear();
232 232
    }
233
    
233

	
234 234
  private:
235
		
235

	
236 236
    Container container;
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -26,3 +26,3 @@
26 26
  const Color WHITE(1,1,1);
27
  
27

	
28 28
  const Color BLACK(0,0,0);
... ...
@@ -42,3 +42,3 @@
42 42
  const Color DARK_CYAN(0,.5,.5);
43
    
43

	
44 44
} //namespace lemon
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -64,3 +64,3 @@
64 64
  /// White color constant
65
  extern const Color WHITE;  
65
  extern const Color WHITE;
66 66
  /// Black color constant
... ...
@@ -132,3 +132,3 @@
132 132
        colors.push_back(Color(0,1,1));
133
      
133

	
134 134
        colors.push_back(Color(.5,0,0));
... ...
@@ -139,3 +139,3 @@
139 139
        colors.push_back(Color(0,.5,.5));
140
      
140

	
141 141
        colors.push_back(Color(.5,.5,.5));
... ...
@@ -147,3 +147,3 @@
147 147
        colors.push_back(Color(.5,1,1));
148
      
148

	
149 149
        colors.push_back(Color(1,.5,0));
... ...
@@ -173,3 +173,3 @@
173 173
    ///Adds a new color to the end of the color list.
174
    void add(const Color &c) 
174
    void add(const Color &c)
175 175
    {
... ...
@@ -188,3 +188,3 @@
188 188
  ///as it is possible.
189
  inline Color distantColor(const Color &c) 
189
  inline Color distantColor(const Color &c)
190 190
  {
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -38,3 +38,3 @@
38 38
///
39
///\todo Are we still using BOOST concept checking utility? 
39
///\todo Are we still using BOOST concept checking utility?
40 40
///Is the BOOST copyright notice necessary?
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -48,3 +48,3 @@
48 48
      ///Digraphs are \e not copy constructible. Use DigraphCopy() instead.
49
      
49

	
50 50
      ///Digraphs are \e not copy constructible. Use DigraphCopy() instead.
... ...
@@ -54,3 +54,3 @@
54 54
      ///\e not allowed. Use DigraphCopy() instead.
55
      
55

	
56 56
      ///Assignment of \ref Digraph "Digraph"s to another ones are
... ...
@@ -97,3 +97,3 @@
97 97
        /// Inequality operator
98
        
98

	
99 99
        /// \sa operator==(Node n)
... ...
@@ -102,14 +102,14 @@
102 102

	
103
	/// Artificial ordering operator.
104
	
105
	/// To allow the use of digraph descriptors as key type in std::map or
106
	/// similar associative container we require this.
107
	///
108
	/// \note This operator only have to define some strict ordering of
109
	/// the items; this order has nothing to do with the iteration
110
	/// ordering of the items.
111
	bool operator<(Node) const { return false; }
103
        /// Artificial ordering operator.
104

	
105
        /// To allow the use of digraph descriptors as key type in std::map or
106
        /// similar associative container we require this.
107
        ///
108
        /// \note This operator only have to define some strict ordering of
109
        /// the items; this order has nothing to do with the iteration
110
        /// ordering of the items.
111
        bool operator<(Node) const { return false; }
112 112

	
113 113
      };
114
    
114

	
115 115
      /// This iterator goes through each node.
... ...
@@ -131,3 +131,3 @@
131 131
        /// Copy constructor.
132
        
132

	
133 133
        /// Copy constructor.
... ...
@@ -147,5 +147,5 @@
147 147

	
148
        /// Sets the iterator to the node of \c the digraph pointed by 
149
	/// the trivial iterator.
150
        /// This feature necessitates that each time we 
148
        /// Sets the iterator to the node of \c the digraph pointed by
149
        /// the trivial iterator.
150
        /// This feature necessitates that each time we
151 151
        /// iterate the arc-set, the iteration order is the same.
... ...
@@ -158,4 +158,4 @@
158 158
      };
159
    
160
    
159

	
160

	
161 161
      /// Class for identifying an arc of the digraph
... ...
@@ -193,13 +193,13 @@
193 193

	
194
	/// Artificial ordering operator.
195
	
196
	/// To allow the use of digraph descriptors as key type in std::map or
197
	/// similar associative container we require this.
198
	///
199
	/// \note This operator only have to define some strict ordering of
200
	/// the items; this order has nothing to do with the iteration
201
	/// ordering of the items.
202
	bool operator<(Arc) const { return false; }
194
        /// Artificial ordering operator.
195

	
196
        /// To allow the use of digraph descriptors as key type in std::map or
197
        /// similar associative container we require this.
198
        ///
199
        /// \note This operator only have to define some strict ordering of
200
        /// the items; this order has nothing to do with the iteration
201
        /// ordering of the items.
202
        bool operator<(Arc) const { return false; }
203 203
      };
204
    
204

	
205 205
      /// This iterator goes trough the outgoing arcs of a node.
... ...
@@ -215,3 +215,3 @@
215 215
      ///\endcode
216
    
216

	
217 217
      class OutArcIt : public Arc {
... ...
@@ -234,3 +234,3 @@
234 234
        /// This constructor sets the iterator to the first outgoing arc.
235
    
235

	
236 236
        /// This constructor sets the iterator to the first outgoing arc of
... ...
@@ -241,3 +241,3 @@
241 241
        /// Sets the iterator to the value of the trivial iterator.
242
	/// This feature necessitates that each time we 
242
        /// This feature necessitates that each time we
243 243
        /// iterate the arc-set, the iteration order is the same.
... ...
@@ -245,4 +245,4 @@
245 245
        ///Next outgoing arc
246
        
247
        /// Assign the iterator to the next 
246

	
247
        /// Assign the iterator to the next
248 248
        /// outgoing arc of the corresponding node.
... ...
@@ -281,3 +281,3 @@
281 281
        /// This constructor sets the iterator to first incoming arc.
282
    
282

	
283 283
        /// This constructor set the iterator to the first incoming arc of
... ...
@@ -288,3 +288,3 @@
288 288
        /// Sets the iterator to the value of the trivial iterator \c e.
289
        /// This feature necessitates that each time we 
289
        /// This feature necessitates that each time we
290 290
        /// iterate the arc-set, the iteration order is the same.
... ...
@@ -324,3 +324,3 @@
324 324
        /// This constructor sets the iterator to the first arc.
325
    
325

	
326 326
        /// This constructor sets the iterator to the first arc of \c g.
... ...
@@ -331,7 +331,7 @@
331 331
        /// Sets the iterator to the value of the trivial iterator \c e.
332
        /// This feature necessitates that each time we 
332
        /// This feature necessitates that each time we
333 333
        /// iterate the arc-set, the iteration order is the same.
334
        ArcIt(const Digraph&, const Arc&) { } 
334
        ArcIt(const Digraph&, const Arc&) { }
335 335
        ///Next arc
336
        
336

	
337 337
        /// Assign the iterator to the next arc.
... ...
@@ -351,6 +351,6 @@
351 351
      /// \brief Returns the ID of the node.
352
      int id(Node) const { return -1; } 
352
      int id(Node) const { return -1; }
353 353

	
354 354
      /// \brief Returns the ID of the arc.
355
      int id(Arc) const { return -1; } 
355
      int id(Arc) const { return -1; }
356 356

	
... ...
@@ -359,3 +359,3 @@
359 359
      /// \pre The argument should be a valid node ID in the graph.
360
      Node nodeFromId(int) const { return INVALID; } 
360
      Node nodeFromId(int) const { return INVALID; }
361 361

	
... ...
@@ -364,9 +364,9 @@
364 364
      /// \pre The argument should be a valid arc ID in the graph.
365
      Arc arcFromId(int) const { return INVALID; } 
365
      Arc arcFromId(int) const { return INVALID; }
366 366

	
367 367
      /// \brief Returns an upper bound on the node IDs.
368
      int maxNodeId() const { return -1; } 
368
      int maxNodeId() const { return -1; }
369 369

	
370 370
      /// \brief Returns an upper bound on the arc IDs.
371
      int maxArcId() const { return -1; } 
371
      int maxArcId() const { return -1; }
372 372

	
... ...
@@ -391,5 +391,5 @@
391 391
      // Dummy parameter.
392
      int maxId(Node) const { return -1; } 
392
      int maxId(Node) const { return -1; }
393 393
      // Dummy parameter.
394
      int maxId(Arc) const { return -1; } 
394
      int maxId(Arc) const { return -1; }
395 395

	
... ...
@@ -425,6 +425,6 @@
425 425
      /// \brief Read write map of the nodes to type \c T.
426
      /// 
426
      ///
427 427
      /// ReadWrite map of the nodes to type \c T.
428 428
      /// \sa Reference
429
      template<class T> 
429
      template<class T>
430 430
      class NodeMap : public ReadWriteMap< Node, T > {
... ...
@@ -441,5 +441,5 @@
441 441
        template <typename CMap>
442
        NodeMap& operator=(const CMap&) { 
442
        NodeMap& operator=(const CMap&) {
443 443
          checkConcept<ReadMap<Node, T>, CMap>();
444
          return *this; 
444
          return *this;
445 445
        }
... ...
@@ -451,3 +451,3 @@
451 451
      /// \sa Reference
452
      template<class T> 
452
      template<class T>
453 453
      class ArcMap : public ReadWriteMap<Arc,T> {
... ...
@@ -463,5 +463,5 @@
463 463
        template <typename CMap>
464
        ArcMap& operator=(const CMap&) { 
464
        ArcMap& operator=(const CMap&) {
465 465
          checkConcept<ReadMap<Arc, T>, CMap>();
466
          return *this; 
466
          return *this;
467 467
        }
... ...
@@ -473,3 +473,3 @@
473 473
          checkConcept<IterableDigraphComponent<>, _Digraph>();
474
	  checkConcept<IDableDigraphComponent<>, _Digraph>();
474
          checkConcept<IDableDigraphComponent<>, _Digraph>();
475 475
          checkConcept<MappableDigraphComponent<>, _Digraph>();
... ...
@@ -479,4 +479,4 @@
479 479
    };
480
    
481
  } //namespace concepts  
480

	
481
  } //namespace concepts
482 482
} //namespace lemon
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -67,3 +67,3 @@
67 67
    /// as the OutArcIt and InArcIt but it is not convertible to Arc just
68
    /// to Edge.  
68
    /// to Edge.
69 69
    class Graph {
... ...
@@ -74,7 +74,7 @@
74 74
      /// The undirected graph should be tagged by the UndirectedTag. This
75
      /// tag helps the enable_if technics to make compile time 
76
      /// specializations for undirected graphs.  
75
      /// tag helps the enable_if technics to make compile time
76
      /// specializations for undirected graphs.
77 77
      typedef True UndirectedTag;
78 78

	
79
      /// \brief The base type of node iterators, 
79
      /// \brief The base type of node iterators,
80 80
      /// or in other words, the trivial node iterator.
... ...
@@ -83,3 +83,3 @@
83 83
      /// thus each kind of node iterator converts to this.
84
      /// More precisely each kind of node iterator should be inherited 
84
      /// More precisely each kind of node iterator should be inherited
85 85
      /// from the trivial node iterator.
... ...
@@ -110,3 +110,3 @@
110 110
        /// Inequality operator
111
        
111

	
112 112
        /// \sa operator==(Node n)
... ...
@@ -115,14 +115,14 @@
115 115

	
116
	/// Artificial ordering operator.
117
	
118
	/// To allow the use of graph descriptors as key type in std::map or
119
	/// similar associative container we require this.
120
	///
121
	/// \note This operator only have to define some strict ordering of
122
	/// the items; this order has nothing to do with the iteration
123
	/// ordering of the items.
124
	bool operator<(Node) const { return false; }
116
        /// Artificial ordering operator.
117

	
118
        /// To allow the use of graph descriptors as key type in std::map or
119
        /// similar associative container we require this.
120
        ///
121
        /// \note This operator only have to define some strict ordering of
122
        /// the items; this order has nothing to do with the iteration
123
        /// ordering of the items.
124
        bool operator<(Node) const { return false; }
125 125

	
126 126
      };
127
    
127

	
128 128
      /// This iterator goes through each node.
... ...
@@ -144,3 +144,3 @@
144 144
        /// Copy constructor.
145
        
145

	
146 146
        /// Copy constructor.
... ...
@@ -160,5 +160,5 @@
160 160

	
161
        /// Sets the iterator to the node of \c the graph pointed by 
162
	/// the trivial iterator.
163
        /// This feature necessitates that each time we 
161
        /// Sets the iterator to the node of \c the graph pointed by
162
        /// the trivial iterator.
163
        /// This feature necessitates that each time we
164 164
        /// iterate the arc-set, the iteration order is the same.
... ...
@@ -171,4 +171,4 @@
171 171
      };
172
    
173
    
172

	
173

	
174 174
      /// The base type of the edge iterators.
... ...
@@ -205,11 +205,11 @@
205 205

	
206
	/// Artificial ordering operator.
207
	
208
	/// To allow the use of graph descriptors as key type in std::map or
209
	/// similar associative container we require this.
210
	///
211
	/// \note This operator only have to define some strict ordering of
212
	/// the items; this order has nothing to do with the iteration
213
	/// ordering of the items.
214
	bool operator<(Edge) const { return false; }
206
        /// Artificial ordering operator.
207

	
208
        /// To allow the use of graph descriptors as key type in std::map or
209
        /// similar associative container we require this.
210
        ///
211
        /// \note This operator only have to define some strict ordering of
212
        /// the items; this order has nothing to do with the iteration
213
        /// ordering of the items.
214
        bool operator<(Edge) const { return false; }
215 215
      };
... ...
@@ -243,3 +243,3 @@
243 243
        /// This constructor sets the iterator to the first edge.
244
    
244

	
245 245
        /// This constructor sets the iterator to the first edge.
... ...
@@ -250,7 +250,7 @@
250 250
        /// This feature necessitates that each time we
251
        /// iterate the edge-set, the iteration order is the 
252
	/// same.
253
        EdgeIt(const Graph&, const Edge&) { } 
251
        /// iterate the edge-set, the iteration order is the
252
        /// same.
253
        EdgeIt(const Graph&, const Edge&) { }
254 254
        /// Next edge
255
        
255

	
256 256
        /// Assign the iterator to the next edge.
... ...
@@ -259,3 +259,3 @@
259 259

	
260
      /// \brief This iterator goes trough the incident undirected 
260
      /// \brief This iterator goes trough the incident undirected
261 261
      /// arcs of a node.
... ...
@@ -263,8 +263,8 @@
263 263
      /// This iterator goes trough the incident edges
264
      /// of a certain node of a graph. You should assume that the 
264
      /// of a certain node of a graph. You should assume that the
265 265
      /// loop arcs will be iterated twice.
266
      /// 
266
      ///
267 267
      /// Its usage is quite simple, for example you can compute the
268 268
      /// degree (i.e. count the number of incident arcs of a node \c n
269
      /// in graph \c g of type \c Graph as follows. 
269
      /// in graph \c g of type \c Graph as follows.
270 270
      ///
... ...
@@ -292,3 +292,3 @@
292 292
        /// This constructor sets the iterator to first incident arc.
293
    
293

	
294 294
        /// This constructor set the iterator to the first incident arc of
... ...
@@ -299,3 +299,3 @@
299 299
        /// Sets the iterator to the value of the trivial iterator \c e.
300
        /// This feature necessitates that each time we 
300
        /// This feature necessitates that each time we
301 301
        /// iterate the arc-set, the iteration order is the same.
... ...
@@ -305,3 +305,3 @@
305 305
        /// Assign the iterator to the next incident arc
306
	/// of the corresponding node.
306
        /// of the corresponding node.
307 307
        IncEdgeIt& operator++() { return *this; }
... ...
@@ -342,13 +342,13 @@
342 342

	
343
	/// Artificial ordering operator.
344
	
345
	/// To allow the use of graph descriptors as key type in std::map or
346
	/// similar associative container we require this.
347
	///
348
	/// \note This operator only have to define some strict ordering of
349
	/// the items; this order has nothing to do with the iteration
350
	/// ordering of the items.
351
	bool operator<(Arc) const { return false; }
352
	
353
      }; 
343
        /// Artificial ordering operator.
344

	
345
        /// To allow the use of graph descriptors as key type in std::map or
346
        /// similar associative container we require this.
347
        ///
348
        /// \note This operator only have to define some strict ordering of
349
        /// the items; this order has nothing to do with the iteration
350
        /// ordering of the items.
351
        bool operator<(Arc) const { return false; }
352

	
353
      };
354 354
      /// This iterator goes through each directed arc.
... ...
@@ -380,3 +380,3 @@
380 380
        /// This constructor sets the iterator to the first arc.
381
    
381

	
382 382
        /// This constructor sets the iterator to the first arc of \c g.
... ...
@@ -387,7 +387,7 @@
387 387
        /// Sets the iterator to the value of the trivial iterator \c e.
388
        /// This feature necessitates that each time we 
388
        /// This feature necessitates that each time we
389 389
        /// iterate the arc-set, the iteration order is the same.
390
        ArcIt(const Graph&, const Arc&) { } 
390
        ArcIt(const Graph&, const Arc&) { }
391 391
        ///Next arc
392
        
392

	
393 393
        /// Assign the iterator to the next arc.
... ...
@@ -395,3 +395,3 @@
395 395
      };
396
   
396

	
397 397
      /// This iterator goes trough the outgoing directed arcs of a node.
... ...
@@ -407,3 +407,3 @@
407 407
      ///\endcode
408
    
408

	
409 409
      class OutArcIt : public Arc {
... ...
@@ -426,3 +426,3 @@
426 426
        /// This constructor sets the iterator to the first outgoing arc.
427
    
427

	
428 428
        /// This constructor sets the iterator to the first outgoing arc of
... ...
@@ -432,5 +432,5 @@
432 432
        OutArcIt(const Graph& n, const Node& g) {
433
	  ignore_unused_variable_warning(n);
434
	  ignore_unused_variable_warning(g);
435
	}
433
          ignore_unused_variable_warning(n);
434
          ignore_unused_variable_warning(g);
435
        }
436 436
        /// Arc -> OutArcIt conversion
... ...
@@ -438,3 +438,3 @@
438 438
        /// Sets the iterator to the value of the trivial iterator.
439
	/// This feature necessitates that each time we 
439
        /// This feature necessitates that each time we
440 440
        /// iterate the arc-set, the iteration order is the same.
... ...
@@ -442,4 +442,4 @@
442 442
        ///Next outgoing arc
443
        
444
        /// Assign the iterator to the next 
443

	
444
        /// Assign the iterator to the next
445 445
        /// outgoing arc of the corresponding node.
... ...
@@ -478,3 +478,3 @@
478 478
        /// This constructor sets the iterator to first incoming arc.
479
    
479

	
480 480
        /// This constructor set the iterator to the first incoming arc of
... ...
@@ -483,6 +483,6 @@
483 483
        ///@param g the graph
484
        InArcIt(const Graph& g, const Node& n) { 
485
	  ignore_unused_variable_warning(n);
486
	  ignore_unused_variable_warning(g);
487
	}
484
        InArcIt(const Graph& g, const Node& n) {
485
          ignore_unused_variable_warning(n);
486
          ignore_unused_variable_warning(g);
487
        }
488 488
        /// Arc -> InArcIt conversion
... ...
@@ -490,3 +490,3 @@
490 490
        /// Sets the iterator to the value of the trivial iterator \c e.
491
        /// This feature necessitates that each time we 
491
        /// This feature necessitates that each time we
492 492
        /// iterate the arc-set, the iteration order is the same.
... ...
@@ -501,6 +501,6 @@
501 501
      /// \brief Read write map of the nodes to type \c T.
502
      /// 
502
      ///
503 503
      /// ReadWrite map of the nodes to type \c T.
504 504
      /// \sa Reference
505
      template<class T> 
505
      template<class T>
506 506
      class NodeMap : public ReadWriteMap< Node, T >
... ...
@@ -518,5 +518,5 @@
518 518
        template <typename CMap>
519
        NodeMap& operator=(const CMap&) { 
519
        NodeMap& operator=(const CMap&) {
520 520
          checkConcept<ReadMap<Node, T>, CMap>();
521
          return *this; 
521
          return *this;
522 522
        }
... ...
@@ -528,3 +528,3 @@
528 528
      /// \sa Reference
529
      template<class T> 
529
      template<class T>
530 530
      class ArcMap : public ReadWriteMap<Arc,T>
... ...
@@ -541,5 +541,5 @@
541 541
        template <typename CMap>
542
        ArcMap& operator=(const CMap&) { 
542
        ArcMap& operator=(const CMap&) {
543 543
          checkConcept<ReadMap<Arc, T>, CMap>();
544
          return *this; 
544
          return *this;
545 545
        }
... ...
@@ -551,3 +551,3 @@
551 551
      /// \sa Reference
552
      template<class T> 
552
      template<class T>
553 553
      class EdgeMap : public ReadWriteMap<Edge,T>
... ...
@@ -564,5 +564,5 @@
564 564
        template <typename CMap>
565
        EdgeMap& operator=(const CMap&) { 
565
        EdgeMap& operator=(const CMap&) {
566 566
          checkConcept<ReadMap<Edge, T>, CMap>();
567
          return *this; 
567
          return *this;
568 568
        }
... ...
@@ -575,3 +575,3 @@
575 575
      Arc direct(const Edge&, const Node&) const {
576
	return INVALID;
576
        return INVALID;
577 577
      }
... ...
@@ -585,3 +585,3 @@
585 585
      Arc direct(const Edge&, bool) const {
586
	return INVALID;
586
        return INVALID;
587 587
      }
... ...
@@ -627,9 +627,9 @@
627 627
      /// \brief Returns the id of the node.
628
      int id(Node) const { return -1; } 
628
      int id(Node) const { return -1; }
629 629

	
630 630
      /// \brief Returns the id of the edge.
631
      int id(Edge) const { return -1; } 
631
      int id(Edge) const { return -1; }
632 632

	
633 633
      /// \brief Returns the id of the arc.
634
      int id(Arc) const { return -1; } 
634
      int id(Arc) const { return -1; }
635 635

	
... ...
@@ -638,3 +638,3 @@
638 638
      /// \pre The argument should be a valid node id in the graph.
639
      Node nodeFromId(int) const { return INVALID; } 
639
      Node nodeFromId(int) const { return INVALID; }
640 640

	
... ...
@@ -643,3 +643,3 @@
643 643
      /// \pre The argument should be a valid edge id in the graph.
644
      Edge edgeFromId(int) const { return INVALID; } 
644
      Edge edgeFromId(int) const { return INVALID; }
645 645

	
... ...
@@ -648,12 +648,12 @@
648 648
      /// \pre The argument should be a valid arc id in the graph.
649
      Arc arcFromId(int) const { return INVALID; } 
649
      Arc arcFromId(int) const { return INVALID; }
650 650

	
651 651
      /// \brief Returns an upper bound on the node IDs.
652
      int maxNodeId() const { return -1; } 
652
      int maxNodeId() const { return -1; }
653 653

	
654 654
      /// \brief Returns an upper bound on the edge IDs.
655
      int maxEdgeId() const { return -1; } 
655
      int maxEdgeId() const { return -1; }
656 656

	
657 657
      /// \brief Returns an upper bound on the arc IDs.
658
      int maxArcId() const { return -1; } 
658
      int maxArcId() const { return -1; }
659 659

	
... ...
@@ -685,7 +685,7 @@
685 685
      // Dummy parameter.
686
      int maxId(Node) const { return -1; } 
686
      int maxId(Node) const { return -1; }
687 687
      // Dummy parameter.
688
      int maxId(Edge) const { return -1; } 
688
      int maxId(Edge) const { return -1; }
689 689
      // Dummy parameter.
690
      int maxId(Arc) const { return -1; } 
690
      int maxId(Arc) const { return -1; }
691 691

	
... ...
@@ -695,3 +695,3 @@
695 695
      Node baseNode(OutArcIt e) const {
696
	return source(e);
696
        return source(e);
697 697
      }
... ...
@@ -702,3 +702,3 @@
702 702
      Node runningNode(OutArcIt e) const {
703
	return target(e);
703
        return target(e);
704 704
      }
... ...
@@ -709,3 +709,3 @@
709 709
      Node baseNode(InArcIt e) const {
710
	return target(e);
710
        return target(e);
711 711
      }
... ...
@@ -716,3 +716,3 @@
716 716
      Node runningNode(InArcIt e) const {
717
	return source(e);
717
        return source(e);
718 718
      }
... ...
@@ -723,5 +723,5 @@
723 723
      Node baseNode(IncEdgeIt) const {
724
	return INVALID;
724
        return INVALID;
725 725
      }
726
      
726

	
727 727
      /// \brief Running node of the iterator
... ...
@@ -730,3 +730,3 @@
730 730
      Node runningNode(IncEdgeIt) const {
731
	return INVALID;
731
        return INVALID;
732 732
      }
... ...
@@ -735,7 +735,7 @@
735 735
      struct Constraints {
736
	void constraints() {
737
	  checkConcept<IterableGraphComponent<>, _Graph>();
738
	  checkConcept<IDableGraphComponent<>, _Graph>();
739
	  checkConcept<MappableGraphComponent<>, _Graph>();
740
	}
736
        void constraints() {
737
          checkConcept<IterableGraphComponent<>, _Graph>();
738
          checkConcept<IDableGraphComponent<>, _Graph>();
739
          checkConcept<MappableGraphComponent<>, _Graph>();
740
        }
741 741
      };
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -51,3 +51,3 @@
51 51
      /// \brief Default constructor.
52
      ///      
52
      ///
53 53
      /// \warning The default constructor is not required to set
... ...
@@ -68,3 +68,3 @@
68 68
      ///
69
      /// The nodes are assignable. 
69
      /// The nodes are assignable.
70 70
      ///
... ...
@@ -94,18 +94,18 @@
94 94
      struct Constraints {
95
	void constraints() {
96
	  _GraphItem i1;
97
	  _GraphItem i2 = i1;
98
	  _GraphItem i3 = INVALID;
99
	  
100
	  i1 = i2 = i3;
95
        void constraints() {
96
          _GraphItem i1;
97
          _GraphItem i2 = i1;
98
          _GraphItem i3 = INVALID;
101 99

	
102
	  bool b;
103
	  //	  b = (ia == ib) && (ia != ib) && (ia < ib);
104
	  b = (ia == ib) && (ia != ib);
105
	  b = (ia == INVALID) && (ib != INVALID);
100
          i1 = i2 = i3;
101

	
102
          bool b;
103
          //          b = (ia == ib) && (ia != ib) && (ia < ib);
104
          b = (ia == ib) && (ia != ib);
105
          b = (ia == INVALID) && (ib != INVALID);
106 106
          b = (ia < ib);
107
	}
107
        }
108 108

	
109
	const _GraphItem &ia;
110
	const _GraphItem &ib;
109
        const _GraphItem &ia;
110
        const _GraphItem &ib;
111 111
      };
... ...
@@ -114,3 +114,3 @@
114 114
    /// \brief An empty base directed graph class.
115
    ///  
115
    ///
116 116
    /// This class provides the minimal set of features needed for a
... ...
@@ -124,6 +124,6 @@
124 124
      typedef BaseDigraphComponent Digraph;
125
      
125

	
126 126
      /// \brief Node class of the digraph.
127 127
      ///
128
      /// This class represents the Nodes of the digraph. 
128
      /// This class represents the Nodes of the digraph.
129 129
      ///
... ...
@@ -133,3 +133,3 @@
133 133
      ///
134
      /// This class represents the Arcs of the digraph. 
134
      /// This class represents the Arcs of the digraph.
135 135
      ///
... ...
@@ -158,18 +158,18 @@
158 158
      struct Constraints {
159
	typedef typename _Digraph::Node Node;
160
	typedef typename _Digraph::Arc Arc;
161
      
162
	void constraints() {
163
	  checkConcept<GraphItem<'n'>, Node>();
164
	  checkConcept<GraphItem<'a'>, Arc>();
165
	  {
166
	    Node n;
167
	    Arc e(INVALID);
168
	    n = digraph.source(e);
169
	    n = digraph.target(e);
159
        typedef typename _Digraph::Node Node;
160
        typedef typename _Digraph::Arc Arc;
161

	
162
        void constraints() {
163
          checkConcept<GraphItem<'n'>, Node>();
164
          checkConcept<GraphItem<'a'>, Arc>();
165
          {
166
            Node n;
167
            Arc e(INVALID);
168
            n = digraph.source(e);
169
            n = digraph.target(e);
170 170
            n = digraph.oppositeNode(n, e);
171
	  }      
172
	}
173
      
174
	const _Digraph& digraph;
171
          }
172
        }
173

	
174
        const _Digraph& digraph;
175 175
      };
... ...
@@ -178,3 +178,3 @@
178 178
    /// \brief An empty base undirected graph class.
179
    ///  
179
    ///
180 180
    /// This class provides the minimal set of features needed for an
... ...
@@ -201,3 +201,3 @@
201 201
        /// \brief Default constructor.
202
        ///      
202
        ///
203 203
        /// \warning The default constructor is not required to set
... ...
@@ -219,3 +219,3 @@
219 219
        /// Besides the core graph item functionality each arc should
220
        /// be convertible to the represented edge. 
220
        /// be convertible to the represented edge.
221 221
        Edge(const Arc&) {}
... ...
@@ -224,3 +224,3 @@
224 224
        /// Besides the core graph item functionality each arc should
225
        /// be convertible to the represented edge. 
225
        /// be convertible to the represented edge.
226 226
        Edge& operator=(const Arc&) { return *this; }
... ...
@@ -239,3 +239,3 @@
239 239
      /// represented edge.
240
      Arc direct(const Edge&, bool) const { return INVALID;} 
240
      Arc direct(const Edge&, bool) const { return INVALID;}
241 241

	
... ...
@@ -245,3 +245,3 @@
245 245
      /// represented edge.
246
      Arc direct(const Edge&, const Node&) const { return INVALID;} 
246
      Arc direct(const Edge&, const Node&) const { return INVALID;}
247 247

	
... ...
@@ -262,18 +262,18 @@
262 262
      Node v(const Edge&) const { return INVALID;}
263
      
263

	
264 264
      template <typename _Graph>
265 265
      struct Constraints {
266
	typedef typename _Graph::Node Node;
267
	typedef typename _Graph::Arc Arc;
268
	typedef typename _Graph::Edge Edge;
269
      
270
	void constraints() {
266
        typedef typename _Graph::Node Node;
267
        typedef typename _Graph::Arc Arc;
268
        typedef typename _Graph::Edge Edge;
269

	
270
        void constraints() {
271 271
          checkConcept<BaseDigraphComponent, _Graph>();
272
	  checkConcept<GraphItem<'u'>, Edge>();
273
	  {
274
	    Node n;
275
	    Edge ue(INVALID);
272
          checkConcept<GraphItem<'u'>, Edge>();
273
          {
274
            Node n;
275
            Edge ue(INVALID);
276 276
            Arc e;
277
	    n = graph.u(ue);
278
	    n = graph.v(ue);
277
            n = graph.u(ue);
278
            n = graph.v(ue);
279 279
            e = graph.direct(ue, true);
... ...
@@ -284,6 +284,6 @@
284 284
            ignore_unused_variable_warning(d);
285
	  }      
286
	}
287
      
288
	const _Graph& graph;
285
          }
286
        }
287

	
288
        const _Graph& graph;
289 289
      };
... ...
@@ -293,3 +293,3 @@
293 293
    /// \brief An empty idable base digraph class.
294
    ///  
294
    ///
295 295
    /// This class provides beside the core digraph features
... ...
@@ -306,5 +306,5 @@
306 306

	
307
      /// \brief Gives back an unique integer id for the Node. 
307
      /// \brief Gives back an unique integer id for the Node.
308 308
      ///
309
      /// Gives back an unique integer id for the Node. 
309
      /// Gives back an unique integer id for the Node.
310 310
      ///
... ...
@@ -316,8 +316,8 @@
316 316
      /// If the digraph does not contain node with the given id
317
      /// then the result of the function is undetermined. 
317
      /// then the result of the function is undetermined.
318 318
      Node nodeFromId(int) const { return INVALID;}
319 319

	
320
      /// \brief Gives back an unique integer id for the Arc. 
320
      /// \brief Gives back an unique integer id for the Arc.
321 321
      ///
322
      /// Gives back an unique integer id for the Arc. 
322
      /// Gives back an unique integer id for the Arc.
323 323
      ///
... ...
@@ -329,3 +329,3 @@
329 329
      /// If the digraph does not contain arc with the given id
330
      /// then the result of the function is undetermined. 
330
      /// then the result of the function is undetermined.
331 331
      Arc arcFromId(int) const { return INVALID;}
... ...
@@ -349,20 +349,20 @@
349 349

	
350
	void constraints() {
351
	  checkConcept<Base, _Digraph >();
352
	  typename _Digraph::Node node;
353
	  int nid = digraph.id(node);
354
	  nid = digraph.id(node);
355
	  node = digraph.nodeFromId(nid);
356
	  typename _Digraph::Arc arc;
357
	  int eid = digraph.id(arc);
358
	  eid = digraph.id(arc);
359
	  arc = digraph.arcFromId(eid);
350
        void constraints() {
351
          checkConcept<Base, _Digraph >();
352
          typename _Digraph::Node node;
353
          int nid = digraph.id(node);
354
          nid = digraph.id(node);
355
          node = digraph.nodeFromId(nid);
356
          typename _Digraph::Arc arc;
357
          int eid = digraph.id(arc);
358
          eid = digraph.id(arc);
359
          arc = digraph.arcFromId(eid);
360 360

	
361
	  nid = digraph.maxNodeId();
362
	  ignore_unused_variable_warning(nid);
363
	  eid = digraph.maxArcId();
364
	  ignore_unused_variable_warning(eid);
365
	}
361
          nid = digraph.maxNodeId();
362
          ignore_unused_variable_warning(nid);
363
          eid = digraph.maxArcId();
364
          ignore_unused_variable_warning(eid);
365
        }
366 366

	
367
	const _Digraph& digraph;
367
        const _Digraph& digraph;
368 368
      };
... ...
@@ -371,3 +371,3 @@
371 371
    /// \brief An empty idable base undirected graph class.
372
    ///  
372
    ///
373 373
    /// This class provides beside the core undirected graph features
... ...
@@ -385,5 +385,5 @@
385 385

	
386
      /// \brief Gives back an unique integer id for the Edge. 
386
      /// \brief Gives back an unique integer id for the Edge.
387 387
      ///
388
      /// Gives back an unique integer id for the Edge. 
388
      /// Gives back an unique integer id for the Edge.
389 389
      ///
... ...
@@ -408,14 +408,14 @@
408 408

	
409
	void constraints() {
410
	  checkConcept<Base, _Graph >();
411
	  checkConcept<IDableDigraphComponent<Base>, _Graph >();
412
	  typename _Graph::Edge edge;
413
	  int ueid = graph.id(edge);
414
	  ueid = graph.id(edge);
415
	  edge = graph.edgeFromId(ueid);
416
	  ueid = graph.maxEdgeId();
417
	  ignore_unused_variable_warning(ueid);
418
	}
409
        void constraints() {
410
          checkConcept<Base, _Graph >();
411
          checkConcept<IDableDigraphComponent<Base>, _Graph >();
412
          typename _Graph::Edge edge;
413
          int ueid = graph.id(edge);
414
          ueid = graph.id(edge);
415
          edge = graph.edgeFromId(ueid);
416
          ueid = graph.maxEdgeId();
417
          ignore_unused_variable_warning(ueid);
418
        }
419 419

	
420
	const _Graph& graph;
420
        const _Graph& graph;
421 421
      };
... ...
@@ -452,7 +452,7 @@
452 452
      ///
453
      /// The items are assignable. 
453
      /// The items are assignable.
454 454
      ///
455
      GraphItemIt& operator=(const GraphItemIt&) { return *this; }      
455
      GraphItemIt& operator=(const GraphItemIt&) { return *this; }
456 456
      /// \brief Next item.
457
      /// 
457
      ///
458 458
      /// Assign the iterator to the next item.
... ...
@@ -461,3 +461,3 @@
461 461
      /// \brief Equality operator
462
      /// 
462
      ///
463 463
      /// Two iterators are equal if and only if they point to the
... ...
@@ -466,3 +466,3 @@
466 466
      /// \brief Inequality operator
467
      ///	
467
      ///
468 468
      /// \sa operator==(Node n)
... ...
@@ -470,17 +470,17 @@
470 470
      bool operator!=(const GraphItemIt&) const { return true;}
471
      
471

	
472 472
      template<typename _GraphItemIt>
473 473
      struct Constraints {
474
	void constraints() {
475
	  _GraphItemIt it1(g);	
476
	  _GraphItemIt it2;
474
        void constraints() {
475
          _GraphItemIt it1(g);
476
          _GraphItemIt it2;
477 477

	
478
	  it2 = ++it1;
479
	  ++it2 = it1;
480
	  ++(++it1);
478
          it2 = ++it1;
479
          ++it2 = it1;
480
          ++(++it1);
481 481

	
482
	  _Item bi = it1;
483
	  bi = it2;
484
	}
485
	_Graph& g;
482
          _Item bi = it1;
483
          bi = it2;
484
        }
485
        _Graph& g;
486 486
      };
... ...
@@ -491,9 +491,9 @@
491 491
    /// \note Because InArcIt and OutArcIt may not inherit from the same
492
    /// base class, the _selector is a additional template parameter. For 
493
    /// InArcIt you should instantiate it with character 'i' and for 
492
    /// base class, the _selector is a additional template parameter. For
493
    /// InArcIt you should instantiate it with character 'i' and for
494 494
    /// OutArcIt with 'o'.
495 495
    template <typename _Graph,
496
	      typename _Item = typename _Graph::Arc,
497
              typename _Base = typename _Graph::Node, 
498
	      char _selector = '0'>
496
              typename _Item = typename _Graph::Arc,
497
              typename _Base = typename _Graph::Node,
498
              char _selector = '0'>
499 499
    class GraphIncIt : public _Item {
... ...
@@ -510,6 +510,6 @@
510 510
      GraphIncIt(GraphIncIt const& gi) : _Item(gi) {}
511
      /// \brief Sets the iterator to the first arc incoming into or outgoing 
511
      /// \brief Sets the iterator to the first arc incoming into or outgoing
512 512
      /// from the node.
513 513
      ///
514
      /// Sets the iterator to the first arc incoming into or outgoing 
514
      /// Sets the iterator to the first arc incoming into or outgoing
515 515
      /// from the node.
... ...
@@ -524,5 +524,5 @@
524 524
      ///
525
      /// The iterators are assignable. 
525
      /// The iterators are assignable.
526 526
      ///
527
      GraphIncIt& operator=(GraphIncIt const&) { return *this; }      
527
      GraphIncIt& operator=(GraphIncIt const&) { return *this; }
528 528
      /// \brief Next item.
... ...
@@ -547,19 +547,19 @@
547 547
      struct Constraints {
548
	void constraints() {
549
	  checkConcept<GraphItem<_selector>, _GraphIncIt>();
550
	  _GraphIncIt it1(graph, node);
551
	  _GraphIncIt it2;
548
        void constraints() {
549
          checkConcept<GraphItem<_selector>, _GraphIncIt>();
550
          _GraphIncIt it1(graph, node);
551
          _GraphIncIt it2;
552 552

	
553
	  it2 = ++it1;
554
	  ++it2 = it1;
555
	  ++(++it1);
556
	  _Item e = it1;
557
	  e = it2;
553
          it2 = ++it1;
554
          ++it2 = it1;
555
          ++(++it1);
556
          _Item e = it1;
557
          e = it2;
558 558

	
559
	}
559
        }
560 560

	
561
	_Item arc;
562
	_Base node;
563
	_Graph graph;
564
	_GraphIncIt it;
561
        _Item arc;
562
        _Base node;
563
        _Graph graph;
564
        _GraphIncIt it;
565 565
      };
... ...
@@ -577,3 +577,3 @@
577 577
    public:
578
    
578

	
579 579
      typedef _Base Base;
... ...
@@ -585,11 +585,11 @@
585 585
      /// \name Base iteration
586
      /// 
586
      ///
587 587
      /// This interface provides functions for iteration on digraph items
588 588
      ///
589
      /// @{  
589
      /// @{
590 590

	
591 591
      /// \brief Gives back the first node in the iterating order.
592
      ///      
592
      ///
593 593
      /// Gives back the first node in the iterating order.
594
      ///     
594
      ///
595 595
      void first(Node&) const {}
... ...
@@ -599,3 +599,3 @@
599 599
      /// Gives back the next node in the iterating order.
600
      ///     
600
      ///
601 601
      void next(Node&) const {}
... ...
@@ -605,3 +605,3 @@
605 605
      /// Gives back the first arc in the iterating order.
606
      ///     
606
      ///
607 607
      void first(Arc&) const {}
... ...
@@ -611,3 +611,3 @@
611 611
      /// Gives back the next arc in the iterating order.
612
      ///     
612
      ///
613 613
      void next(Arc&) const {}
... ...
@@ -619,3 +619,3 @@
619 619
      /// Gives back the first of the arcs point to the given node.
620
      ///     
620
      ///
621 621
      void firstIn(Arc&, const Node&) const {}
... ...
@@ -631,5 +631,5 @@
631 631
      /// given node.
632
      ///      
632
      ///
633 633
      /// Gives back the first of the arcs start from the given node.
634
      ///     
634
      ///
635 635
      void firstOut(Arc&, const Node&) const {}
... ...
@@ -640,3 +640,3 @@
640 640
      /// Gives back the next of the arcs start from the given node.
641
      ///     
641
      ///
642 642
      void nextOut(Arc&) const {}
... ...
@@ -646,3 +646,3 @@
646 646
      /// \name Class based iteration
647
      /// 
647
      ///
648 648
      /// This interface provides functions for iteration on digraph items
... ...
@@ -701,9 +701,9 @@
701 701

	
702
      template <typename _Digraph> 
702
      template <typename _Digraph>
703 703
      struct Constraints {
704
	void constraints() {
705
	  checkConcept<Base, _Digraph>();
704
        void constraints() {
705
          checkConcept<Base, _Digraph>();
706 706

	
707 707
          {
708
            typename _Digraph::Node node(INVALID);      
708
            typename _Digraph::Node node(INVALID);
709 709
            typename _Digraph::Arc arc(INVALID);
... ...
@@ -725,3 +725,3 @@
725 725
            }
726
          }           
726
          }
727 727

	
... ...
@@ -732,5 +732,5 @@
732 732
              typename _Digraph::NodeIt >();
733
            checkConcept<GraphIncIt<_Digraph, typename _Digraph::Arc, 
733
            checkConcept<GraphIncIt<_Digraph, typename _Digraph::Arc,
734 734
              typename _Digraph::Node, 'i'>, typename _Digraph::InArcIt>();
735
            checkConcept<GraphIncIt<_Digraph, typename _Digraph::Arc, 
735
            checkConcept<GraphIncIt<_Digraph, typename _Digraph::Arc,
736 736
              typename _Digraph::Node, 'o'>, typename _Digraph::OutArcIt>();
... ...
@@ -747,5 +747,5 @@
747 747
        }
748
	
749
	const _Digraph& digraph;
750
	
748

	
749
        const _Digraph& digraph;
750

	
751 751
      };
... ...
@@ -767,3 +767,3 @@
767 767

	
768
    
768

	
769 769
      typedef IterableGraphComponent Graph;
... ...
@@ -771,5 +771,5 @@
771 771
      /// \name Base iteration
772
      /// 
772
      ///
773 773
      /// This interface provides functions for iteration on graph items
774
      /// @{  
774
      /// @{
775 775

	
... ...
@@ -782,3 +782,3 @@
782 782
      /// Gives back the first edge in the iterating order.
783
      ///     
783
      ///
784 784
      void first(Edge&) const {}
... ...
@@ -789,3 +789,3 @@
789 789
      /// Gives back the next edge in the iterating order.
790
      ///     
790
      ///
791 791
      void next(Edge&) const {}
... ...
@@ -816,3 +816,3 @@
816 816
      /// \name Class based iteration
817
      /// 
817
      ///
818 818
      /// This interface provides functions for iteration on graph items
... ...
@@ -843,6 +843,6 @@
843 843

	
844
      template <typename _Graph> 
844
      template <typename _Graph>
845 845
      struct Constraints {
846
	void constraints() {
847
	  checkConcept<IterableDigraphComponent<Base>, _Graph>();
846
        void constraints() {
847
          checkConcept<IterableDigraphComponent<Base>, _Graph>();
848 848

	
... ...
@@ -860,5 +860,5 @@
860 860
            }
861
            
862
          }	
863
  
861

	
862
          }
863

	
864 864
          {
... ...
@@ -866,5 +866,5 @@
866 866
              typename _Graph::EdgeIt >();
867
            checkConcept<GraphIncIt<_Graph, typename _Graph::Edge, 
867
            checkConcept<GraphIncIt<_Graph, typename _Graph::Edge,
868 868
              typename _Graph::Node, 'u'>, typename _Graph::IncEdgeIt>();
869
            
869

	
870 870
            typename _Graph::Node n;
... ...
@@ -875,5 +875,5 @@
875 875
        }
876
	
877
	const _Graph& graph;
878
	
876

	
877
        const _Graph& graph;
878

	
879 879
      };
... ...
@@ -882,3 +882,3 @@
882 882
    /// \brief An empty alteration notifier digraph class.
883
    ///  
883
    ///
884 884
    /// This class provides beside the core digraph features alteration
... ...
@@ -899,8 +899,8 @@
899 899
      /// The node observer registry.
900
      typedef AlterationNotifier<AlterableDigraphComponent, Node> 
900
      typedef AlterationNotifier<AlterableDigraphComponent, Node>
901 901
      NodeNotifier;
902 902
      /// The arc observer registry.
903
      typedef AlterationNotifier<AlterableDigraphComponent, Arc> 
903
      typedef AlterationNotifier<AlterableDigraphComponent, Arc>
904 904
      ArcNotifier;
905
      
905

	
906 906
      /// \brief Gives back the node alteration notifier.
... ...
@@ -909,5 +909,5 @@
909 909
      NodeNotifier& notifier(Node) const {
910
	return NodeNotifier();
910
        return NodeNotifier();
911 911
      }
912
      
912

	
913 913
      /// \brief Gives back the arc alteration notifier.
... ...
@@ -916,23 +916,23 @@
916 916
      ArcNotifier& notifier(Arc) const {
917
	return ArcNotifier();
917
        return ArcNotifier();
918 918
      }
919 919

	
920
      template <typename _Digraph> 
920
      template <typename _Digraph>
921 921
      struct Constraints {
922
	void constraints() {
923
	  checkConcept<Base, _Digraph>();
924
          typename _Digraph::NodeNotifier& nn 
922
        void constraints() {
923
          checkConcept<Base, _Digraph>();
924
          typename _Digraph::NodeNotifier& nn
925 925
            = digraph.notifier(typename _Digraph::Node());
926 926

	
927
          typename _Digraph::ArcNotifier& en 
927
          typename _Digraph::ArcNotifier& en
928 928
            = digraph.notifier(typename _Digraph::Arc());
929
          
929

	
930 930
          ignore_unused_variable_warning(nn);
931 931
          ignore_unused_variable_warning(en);
932
	}
933
	
934
	const _Digraph& digraph;
935
	
932
        }
933

	
934
        const _Digraph& digraph;
935

	
936 936
      };
937
      
937

	
938 938
    };
... ...
@@ -940,3 +940,3 @@
940 940
    /// \brief An empty alteration notifier undirected graph class.
941
    ///  
941
    ///
942 942
    /// This class provides beside the core graph features alteration
... ...
@@ -956,5 +956,5 @@
956 956
      /// The arc observer registry.
957
      typedef AlterationNotifier<AlterableGraphComponent, Edge> 
957
      typedef AlterationNotifier<AlterableGraphComponent, Edge>
958 958
      EdgeNotifier;
959
      
959

	
960 960
      /// \brief Gives back the arc alteration notifier.
... ...
@@ -963,18 +963,18 @@
963 963
      EdgeNotifier& notifier(Edge) const {
964
	return EdgeNotifier();
964
        return EdgeNotifier();
965 965
      }
966 966

	
967
      template <typename _Graph> 
967
      template <typename _Graph>
968 968
      struct Constraints {
969
	void constraints() {
970
	  checkConcept<AlterableGraphComponent<Base>, _Graph>();
971
          typename _Graph::EdgeNotifier& uen 
969
        void constraints() {
970
          checkConcept<AlterableGraphComponent<Base>, _Graph>();
971
          typename _Graph::EdgeNotifier& uen
972 972
            = graph.notifier(typename _Graph::Edge());
973 973
          ignore_unused_variable_warning(uen);
974
	}
975
	
976
	const _Graph& graph;
977
	
974
        }
975

	
976
        const _Graph& graph;
977

	
978 978
      };
979
      
979

	
980 980
    };
... ...
@@ -982,3 +982,3 @@
982 982
    /// \brief Class describing the concept of graph maps
983
    /// 
983
    ///
984 984
    /// This class describes the common interface of the graph maps
... ...
@@ -1011,3 +1011,3 @@
1011 1011
      GraphMap(const GraphMap&) : Parent() {}
1012
      
1012

	
1013 1013
      /// \brief Assign operator.
... ...
@@ -1016,5 +1016,5 @@
1016 1016
      /// it just iterates on the current item set and set the  map
1017
      /// with the value returned by the assigned map. 
1017
      /// with the value returned by the assigned map.
1018 1018
      template <typename CMap>
1019
      GraphMap& operator=(const CMap&) { 
1019
      GraphMap& operator=(const CMap&) {
1020 1020
        checkConcept<ReadMap<Key, Value>, CMap>();
... ...
@@ -1025,11 +1025,11 @@
1025 1025
      struct Constraints {
1026
	void constraints() {
1027
	  checkConcept<ReadWriteMap<Key, Value>, _Map >();
1028
	  // Construction with a graph parameter
1029
	  _Map a(g);
1030
	  // Constructor with a graph and a default value parameter
1031
	  _Map a2(g,t);
1032
	  // Copy constructor.
1033
	  _Map b(c);
1034
          
1026
        void constraints() {
1027
          checkConcept<ReadWriteMap<Key, Value>, _Map >();
1028
          // Construction with a graph parameter
1029
          _Map a(g);
1030
          // Constructor with a graph and a default value parameter
1031
          _Map a2(g,t);
1032
          // Copy constructor.
1033
          _Map b(c);
1034

	
1035 1035
          ReadMap<Key, Value> cmap;
... ...
@@ -1037,9 +1037,9 @@
1037 1037

	
1038
	  ignore_unused_variable_warning(a2);
1039
	  ignore_unused_variable_warning(b);
1040
	}
1038
          ignore_unused_variable_warning(a2);
1039
          ignore_unused_variable_warning(b);
1040
        }
1041 1041

	
1042
	const _Map &c;
1043
	const Graph &g;
1044
	const typename GraphMap::Value &t;
1042
        const _Map &c;
1043
        const Graph &g;
1044
        const typename GraphMap::Value &t;
1045 1045
      };
... ...
@@ -1072,24 +1072,24 @@
1072 1072

	
1073
	/// \brief Construct a new map.
1074
	///
1075
	/// Construct a new map for the digraph.
1076
	explicit NodeMap(const MappableDigraphComponent& digraph) 
1073
        /// \brief Construct a new map.
1074
        ///
1075
        /// Construct a new map for the digraph.
1076
        explicit NodeMap(const MappableDigraphComponent& digraph)
1077 1077
          : Parent(digraph) {}
1078 1078

	
1079
	/// \brief Construct a new map with default value.
1080
	///
1081
	/// Construct a new map for the digraph and initalise the values.
1082
	NodeMap(const MappableDigraphComponent& digraph, const _Value& value)
1079
        /// \brief Construct a new map with default value.
1080
        ///
1081
        /// Construct a new map for the digraph and initalise the values.
1082
        NodeMap(const MappableDigraphComponent& digraph, const _Value& value)
1083 1083
          : Parent(digraph, value) {}
1084 1084

	
1085
	/// \brief Copy constructor.
1086
	///
1087
	/// Copy Constructor.
1088
	NodeMap(const NodeMap& nm) : Parent(nm) {}
1085
        /// \brief Copy constructor.
1086
        ///
1087
        /// Copy Constructor.
1088
        NodeMap(const NodeMap& nm) : Parent(nm) {}
1089 1089

	
1090
	/// \brief Assign operator.
1091
	///
1092
	/// Assign operator.
1090
        /// \brief Assign operator.
1091
        ///
1092
        /// Assign operator.
1093 1093
        template <typename CMap>
1094
        NodeMap& operator=(const CMap&) { 
1094
        NodeMap& operator=(const CMap&) {
1095 1095
          checkConcept<ReadMap<Node, _Value>, CMap>();
... ...
@@ -1109,24 +1109,24 @@
1109 1109

	
1110
	/// \brief Construct a new map.
1111
	///
1112
	/// Construct a new map for the digraph.
1113
	explicit ArcMap(const MappableDigraphComponent& digraph) 
1110
        /// \brief Construct a new map.
1111
        ///
1112
        /// Construct a new map for the digraph.
1113
        explicit ArcMap(const MappableDigraphComponent& digraph)
1114 1114
          : Parent(digraph) {}
1115 1115

	
1116
	/// \brief Construct a new map with default value.
1117
	///
1118
	/// Construct a new map for the digraph and initalise the values.
1119
	ArcMap(const MappableDigraphComponent& digraph, const _Value& value)
1116
        /// \brief Construct a new map with default value.
1117
        ///
1118
        /// Construct a new map for the digraph and initalise the values.
1119
        ArcMap(const MappableDigraphComponent& digraph, const _Value& value)
1120 1120
          : Parent(digraph, value) {}
1121 1121

	
1122
	/// \brief Copy constructor.
1123
	///
1124
	/// Copy Constructor.
1125
	ArcMap(const ArcMap& nm) : Parent(nm) {}
1122
        /// \brief Copy constructor.
1123
        ///
1124
        /// Copy Constructor.
1125
        ArcMap(const ArcMap& nm) : Parent(nm) {}
1126 1126

	
1127
	/// \brief Assign operator.
1128
	///
1129
	/// Assign operator.
1127
        /// \brief Assign operator.
1128
        ///
1129
        /// Assign operator.
1130 1130
        template <typename CMap>
1131
        ArcMap& operator=(const CMap&) { 
1131
        ArcMap& operator=(const CMap&) {
1132 1132
          checkConcept<ReadMap<Arc, _Value>, CMap>();
... ...
@@ -1141,40 +1141,40 @@
1141 1141

	
1142
	struct Dummy {
1143
	  int value;
1144
	  Dummy() : value(0) {}
1145
	  Dummy(int _v) : value(_v) {}
1146
	};
1142
        struct Dummy {
1143
          int value;
1144
          Dummy() : value(0) {}
1145
          Dummy(int _v) : value(_v) {}
1146
        };
1147 1147

	
1148
	void constraints() {
1149
	  checkConcept<Base, _Digraph>();
1150
	  { // int map test
1151
	    typedef typename _Digraph::template NodeMap<int> IntNodeMap;
1152
	    checkConcept<GraphMap<_Digraph, typename _Digraph::Node, int>, 
1153
	      IntNodeMap >();
1154
	  } { // bool map test
1155
	    typedef typename _Digraph::template NodeMap<bool> BoolNodeMap;
1156
	    checkConcept<GraphMap<_Digraph, typename _Digraph::Node, bool>,
1157
	      BoolNodeMap >();
1158
	  } { // Dummy map test
1159
	    typedef typename _Digraph::template NodeMap<Dummy> DummyNodeMap;
1160
	    checkConcept<GraphMap<_Digraph, typename _Digraph::Node, Dummy>,
1161
	      DummyNodeMap >();
1162
	  } 
1148
        void constraints() {
1149
          checkConcept<Base, _Digraph>();
1150
          { // int map test
1151
            typedef typename _Digraph::template NodeMap<int> IntNodeMap;
1152
            checkConcept<GraphMap<_Digraph, typename _Digraph::Node, int>,
1153
              IntNodeMap >();
1154
          } { // bool map test
1155
            typedef typename _Digraph::template NodeMap<bool> BoolNodeMap;
1156
            checkConcept<GraphMap<_Digraph, typename _Digraph::Node, bool>,
1157
              BoolNodeMap >();
1158
          } { // Dummy map test
1159
            typedef typename _Digraph::template NodeMap<Dummy> DummyNodeMap;
1160
            checkConcept<GraphMap<_Digraph, typename _Digraph::Node, Dummy>,
1161
              DummyNodeMap >();
1162
          }
1163 1163

	
1164
	  { // int map test
1165
	    typedef typename _Digraph::template ArcMap<int> IntArcMap;
1166
	    checkConcept<GraphMap<_Digraph, typename _Digraph::Arc, int>,
1167
	      IntArcMap >();
1168
	  } { // bool map test
1169
	    typedef typename _Digraph::template ArcMap<bool> BoolArcMap;
1170
	    checkConcept<GraphMap<_Digraph, typename _Digraph::Arc, bool>,
1171
	      BoolArcMap >();
1172
	  } { // Dummy map test
1173
	    typedef typename _Digraph::template ArcMap<Dummy> DummyArcMap;
1174
	    checkConcept<GraphMap<_Digraph, typename _Digraph::Arc, Dummy>, 
1175
	      DummyArcMap >();
1176
	  } 
1177
	}
1164
          { // int map test
1165
            typedef typename _Digraph::template ArcMap<int> IntArcMap;
1166
            checkConcept<GraphMap<_Digraph, typename _Digraph::Arc, int>,
1167
              IntArcMap >();
1168
          } { // bool map test
1169
            typedef typename _Digraph::template ArcMap<bool> BoolArcMap;
1170
            checkConcept<GraphMap<_Digraph, typename _Digraph::Arc, bool>,
1171
              BoolArcMap >();
1172
          } { // Dummy map test
1173
            typedef typename _Digraph::template ArcMap<Dummy> DummyArcMap;
1174
            checkConcept<GraphMap<_Digraph, typename _Digraph::Arc, Dummy>,
1175
              DummyArcMap >();
1176
          }
1177
        }
1178 1178

	
1179
	_Digraph& digraph;
1179
        _Digraph& digraph;
1180 1180
      };
... ...
@@ -1201,3 +1201,3 @@
1201 1201
      template <typename _Value>
1202
      class EdgeMap : public GraphMap<Graph, Edge, _Value> {  
1202
      class EdgeMap : public GraphMap<Graph, Edge, _Value> {
1203 1203
      public:
... ...
@@ -1205,24 +1205,24 @@
1205 1205

	
1206
	/// \brief Construct a new map.
1207
	///
1208
	/// Construct a new map for the graph.
1209
	explicit EdgeMap(const MappableGraphComponent& graph) 
1206
        /// \brief Construct a new map.
1207
        ///
1208
        /// Construct a new map for the graph.
1209
        explicit EdgeMap(const MappableGraphComponent& graph)
1210 1210
          : Parent(graph) {}
1211 1211

	
1212
	/// \brief Construct a new map with default value.
1213
	///
1214
	/// Construct a new map for the graph and initalise the values.
1215
	EdgeMap(const MappableGraphComponent& graph, const _Value& value)
1212
        /// \brief Construct a new map with default value.
1213
        ///
1214
        /// Construct a new map for the graph and initalise the values.
1215
        EdgeMap(const MappableGraphComponent& graph, const _Value& value)
1216 1216
          : Parent(graph, value) {}
1217 1217

	
1218
	/// \brief Copy constructor.
1219
	///
1220
	/// Copy Constructor.
1221
	EdgeMap(const EdgeMap& nm) : Parent(nm) {}
1218
        /// \brief Copy constructor.
1219
        ///
1220
        /// Copy Constructor.
1221
        EdgeMap(const EdgeMap& nm) : Parent(nm) {}
1222 1222

	
1223
	/// \brief Assign operator.
1224
	///
1225
	/// Assign operator.
1223
        /// \brief Assign operator.
1224
        ///
1225
        /// Assign operator.
1226 1226
        template <typename CMap>
1227
        EdgeMap& operator=(const CMap&) { 
1227
        EdgeMap& operator=(const CMap&) {
1228 1228
          checkConcept<ReadMap<Edge, _Value>, CMap>();
... ...
@@ -1237,27 +1237,27 @@
1237 1237

	
1238
	struct Dummy {
1239
	  int value;
1240
	  Dummy() : value(0) {}
1241
	  Dummy(int _v) : value(_v) {}
1242
	};
1238
        struct Dummy {
1239
          int value;
1240
          Dummy() : value(0) {}
1241
          Dummy(int _v) : value(_v) {}
1242
        };
1243 1243

	
1244
	void constraints() {
1245
	  checkConcept<MappableGraphComponent<Base>, _Graph>();
1244
        void constraints() {
1245
          checkConcept<MappableGraphComponent<Base>, _Graph>();
1246 1246

	
1247
	  { // int map test
1248
	    typedef typename _Graph::template EdgeMap<int> IntEdgeMap;
1249
	    checkConcept<GraphMap<_Graph, typename _Graph::Edge, int>,
1250
	      IntEdgeMap >();
1251
	  } { // bool map test
1252
	    typedef typename _Graph::template EdgeMap<bool> BoolEdgeMap;
1253
	    checkConcept<GraphMap<_Graph, typename _Graph::Edge, bool>,
1254
	      BoolEdgeMap >();
1255
	  } { // Dummy map test
1256
	    typedef typename _Graph::template EdgeMap<Dummy> DummyEdgeMap;
1257
	    checkConcept<GraphMap<_Graph, typename _Graph::Edge, Dummy>, 
1258
	      DummyEdgeMap >();
1259
	  } 
1260
	}
1247
          { // int map test
1248
            typedef typename _Graph::template EdgeMap<int> IntEdgeMap;
1249
            checkConcept<GraphMap<_Graph, typename _Graph::Edge, int>,
1250
              IntEdgeMap >();
1251
          } { // bool map test
1252
            typedef typename _Graph::template EdgeMap<bool> BoolEdgeMap;
1253
            checkConcept<GraphMap<_Graph, typename _Graph::Edge, bool>,
1254
              BoolEdgeMap >();
1255
          } { // Dummy map test
1256
            typedef typename _Graph::template EdgeMap<Dummy> DummyEdgeMap;
1257
            checkConcept<GraphMap<_Graph, typename _Graph::Edge, Dummy>,
1258
              DummyEdgeMap >();
1259
          }
1260
        }
1261 1261

	
1262
	_Graph& graph;
1262
        _Graph& graph;
1263 1263
      };
... ...
@@ -1284,5 +1284,5 @@
1284 1284
      Node addNode() {
1285
	return INVALID;
1285
        return INVALID;
1286 1286
      }
1287
    
1287

	
1288 1288
      /// \brief Adds a new arc connects the given two nodes.
... ...
@@ -1291,3 +1291,3 @@
1291 1291
      Arc addArc(const Node&, const Node&) {
1292
	return INVALID;
1292
        return INVALID;
1293 1293
      }
... ...
@@ -1296,12 +1296,12 @@
1296 1296
      struct Constraints {
1297
	void constraints() {
1297
        void constraints() {
1298 1298
          checkConcept<Base, _Digraph>();
1299
	  typename _Digraph::Node node_a, node_b;
1300
	  node_a = digraph.addNode();
1301
	  node_b = digraph.addNode();
1302
	  typename _Digraph::Arc arc;
1303
	  arc = digraph.addArc(node_a, node_b);
1304
	}
1299
          typename _Digraph::Node node_a, node_b;
1300
          node_a = digraph.addNode();
1301
          node_b = digraph.addNode();
1302
          typename _Digraph::Arc arc;
1303
          arc = digraph.addArc(node_a, node_b);
1304
        }
1305 1305

	
1306
	_Digraph& digraph;
1306
        _Digraph& digraph;
1307 1307
      };
... ...
@@ -1329,5 +1329,5 @@
1329 1329
      Node addNode() {
1330
	return INVALID;
1330
        return INVALID;
1331 1331
      }
1332
    
1332

	
1333 1333
      /// \brief Adds a new arc connects the given two nodes.
... ...
@@ -1336,3 +1336,3 @@
1336 1336
      Edge addArc(const Node&, const Node&) {
1337
	return INVALID;
1337
        return INVALID;
1338 1338
      }
... ...
@@ -1341,12 +1341,12 @@
1341 1341
      struct Constraints {
1342
	void constraints() {
1343
	  checkConcept<Base, _Graph>();
1344
	  typename _Graph::Node node_a, node_b;
1345
	  node_a = graph.addNode();
1346
	  node_b = graph.addNode();
1347
	  typename _Graph::Edge edge;
1348
	  edge = graph.addEdge(node_a, node_b);
1349
	}
1342
        void constraints() {
1343
          checkConcept<Base, _Graph>();
1344
          typename _Graph::Node node_a, node_b;
1345
          node_a = graph.addNode();
1346
          node_b = graph.addNode();
1347
          typename _Graph::Edge edge;
1348
          edge = graph.addEdge(node_a, node_b);
1349
        }
1350 1350

	
1351
	_Graph& graph;
1351
        _Graph& graph;
1352 1352
      };
... ...
@@ -1355,3 +1355,3 @@
1355 1355
    /// \brief An empty erasable digraph class.
1356
    ///  
1356
    ///
1357 1357
    /// This class provides beside the core digraph features core erase
... ...
@@ -1370,5 +1370,5 @@
1370 1370
      ///
1371
      /// Erase a node from the digraph. This function should 
1371
      /// Erase a node from the digraph. This function should
1372 1372
      /// erase all arcs connecting to the node.
1373
      void erase(const Node&) {}    
1373
      void erase(const Node&) {}
1374 1374

	
... ...
@@ -1382,11 +1382,11 @@
1382 1382
      struct Constraints {
1383
	void constraints() {
1383
        void constraints() {
1384 1384
          checkConcept<Base, _Digraph>();
1385
	  typename _Digraph::Node node;
1386
	  digraph.erase(node);
1387
	  typename _Digraph::Arc arc;
1388
	  digraph.erase(arc);
1389
	}
1385
          typename _Digraph::Node node;
1386
          digraph.erase(node);
1387
          typename _Digraph::Arc arc;
1388
          digraph.erase(arc);
1389
        }
1390 1390

	
1391
	_Digraph& digraph;
1391
        _Digraph& digraph;
1392 1392
      };
... ...
@@ -1395,3 +1395,3 @@
1395 1395
    /// \brief An empty erasable base undirected graph class.
1396
    ///  
1396
    ///
1397 1397
    /// This class provides beside the core undirected graph features
... ...
@@ -1412,3 +1412,3 @@
1412 1412
      /// arcs connecting to the node.
1413
      void erase(const Node&) {}    
1413
      void erase(const Node&) {}
1414 1414

	
... ...
@@ -1422,11 +1422,11 @@
1422 1422
      struct Constraints {
1423
	void constraints() {
1423
        void constraints() {
1424 1424
          checkConcept<Base, _Graph>();
1425
	  typename _Graph::Node node;
1426
	  graph.erase(node);
1427
	  typename _Graph::Edge edge;
1428
	  graph.erase(edge);
1429
	}
1425
          typename _Graph::Node node;
1426
          graph.erase(node);
1427
          typename _Graph::Edge edge;
1428
          graph.erase(edge);
1429
        }
1430 1430

	
1431
	_Graph& graph;
1431
        _Graph& graph;
1432 1432
      };
... ...
@@ -1450,3 +1450,3 @@
1450 1450
      ///
1451
      void clear() {}    
1451
      void clear() {}
1452 1452

	
... ...
@@ -1454,8 +1454,8 @@
1454 1454
      struct Constraints {
1455
	void constraints() {
1455
        void constraints() {
1456 1456
          checkConcept<Base, _Digraph>();
1457
	  digraph.clear();
1458
	}
1457
          digraph.clear();
1458
        }
1459 1459

	
1460
	_Digraph digraph;
1460
        _Digraph digraph;
1461 1461
      };
... ...
@@ -1477,7 +1477,7 @@
1477 1477
      struct Constraints {
1478
	void constraints() {
1478
        void constraints() {
1479 1479
          checkConcept<ClearableGraphComponent<Base>, _Graph>();
1480
	}
1480
        }
1481 1481

	
1482
	_Graph graph;
1482
        _Graph graph;
1483 1483
      };
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -54,10 +54,10 @@
54 54
      ///
55
      /// The \c ItemIntMap must be initialized in such a way, that it 
55
      /// The \c ItemIntMap must be initialized in such a way, that it
56 56
      /// assigns \c PRE_HEAP (<tt>-1</tt>) to every item.
57 57
      enum State {
58
	IN_HEAP = 0,
59
	PRE_HEAP = -1,
60
	POST_HEAP = -2
58
        IN_HEAP = 0,
59
        PRE_HEAP = -1,
60
        POST_HEAP = -2
61 61
      };
62
      
62

	
63 63
      /// \brief The constructor.
... ...
@@ -87,4 +87,4 @@
87 87
      /// \brief Inserts an item into the heap with the given priority.
88
      ///    
89
      /// Inserts the given item into the heap with the given priority. 
88
      ///
89
      /// Inserts the given item into the heap with the given priority.
90 90
      /// \param i The item to insert.
... ...
@@ -114,3 +114,3 @@
114 114
      /// Removes the given item from the heap if it is already stored.
115
      /// \param i The item to delete. 
115
      /// \param i The item to delete.
116 116
      void erase(const Item &i) {}
... ...
@@ -119,3 +119,3 @@
119 119
      ///
120
      /// Returns the priority of the given item.  
120
      /// Returns the priority of the given item.
121 121
      /// \pre \c i must be in the heap.
... ...
@@ -135,3 +135,3 @@
135 135
      void set(const Item &i, const Prio &p) {}
136
      
136

	
137 137
      /// \brief Decreases the priority of an item to the given value.
... ...
@@ -176,65 +176,65 @@
176 176
      public:
177
	void constraints() {
178
	  typedef typename _Heap::Item OwnItem;
179
	  typedef typename _Heap::Prio OwnPrio;
180
	  typedef typename _Heap::State OwnState;
177
        void constraints() {
178
          typedef typename _Heap::Item OwnItem;
179
          typedef typename _Heap::Prio OwnPrio;
180
          typedef typename _Heap::State OwnState;
181 181

	
182
	  Item item;
183
	  Prio prio;
184
	  item=Item();
185
	  prio=Prio();
186
	  ignore_unused_variable_warning(item);
187
	  ignore_unused_variable_warning(prio);
182
          Item item;
183
          Prio prio;
184
          item=Item();
185
          prio=Prio();
186
          ignore_unused_variable_warning(item);
187
          ignore_unused_variable_warning(prio);
188 188

	
189
	  OwnItem own_item;
190
	  OwnPrio own_prio;
191
	  OwnState own_state;
192
	  own_item=Item();
193
	  own_prio=Prio();
194
	  ignore_unused_variable_warning(own_item);
195
	  ignore_unused_variable_warning(own_prio);
196
	  ignore_unused_variable_warning(own_state);
189
          OwnItem own_item;
190
          OwnPrio own_prio;
191
          OwnState own_state;
192
          own_item=Item();
193
          own_prio=Prio();
194
          ignore_unused_variable_warning(own_item);
195
          ignore_unused_variable_warning(own_prio);
196
          ignore_unused_variable_warning(own_state);
197 197

	
198
	  _Heap heap1(map);
199
	  _Heap heap2 = heap1;
200
	  ignore_unused_variable_warning(heap1);
201
	  ignore_unused_variable_warning(heap2);
202
	  
203
	  int s = heap.size();
204
	  ignore_unused_variable_warning(s);
205
	  bool e = heap.empty();
206
	  ignore_unused_variable_warning(e);
198
          _Heap heap1(map);
199
          _Heap heap2 = heap1;
200
          ignore_unused_variable_warning(heap1);
201
          ignore_unused_variable_warning(heap2);
207 202

	
208
	  prio = heap.prio();
209
	  item = heap.top();
210
	  prio = heap[item];
211
	  own_prio = heap.prio();
212
	  own_item = heap.top();
213
	  own_prio = heap[own_item];
203
          int s = heap.size();
204
          ignore_unused_variable_warning(s);
205
          bool e = heap.empty();
206
          ignore_unused_variable_warning(e);
214 207

	
215
	  heap.push(item, prio);
216
	  heap.push(own_item, own_prio);
217
	  heap.pop();
208
          prio = heap.prio();
209
          item = heap.top();
210
          prio = heap[item];
211
          own_prio = heap.prio();
212
          own_item = heap.top();
213
          own_prio = heap[own_item];
218 214

	
219
	  heap.set(item, prio);
220
	  heap.decrease(item, prio);
221
	  heap.increase(item, prio);
222
	  heap.set(own_item, own_prio);
223
	  heap.decrease(own_item, own_prio);
224
	  heap.increase(own_item, own_prio);
215
          heap.push(item, prio);
216
          heap.push(own_item, own_prio);
217
          heap.pop();
225 218

	
226
	  heap.erase(item);
227
	  heap.erase(own_item);
228
	  heap.clear();
219
          heap.set(item, prio);
220
          heap.decrease(item, prio);
221
          heap.increase(item, prio);
222
          heap.set(own_item, own_prio);
223
          heap.decrease(own_item, own_prio);
224
          heap.increase(own_item, own_prio);
229 225

	
230
	  own_state = heap.state(own_item);
231
	  heap.state(own_item, own_state);
226
          heap.erase(item);
227
          heap.erase(own_item);
228
          heap.clear();
232 229

	
233
	  own_state = _Heap::PRE_HEAP;
234
	  own_state = _Heap::IN_HEAP;
235
	  own_state = _Heap::POST_HEAP;
236
	}
230
          own_state = heap.state(own_item);
231
          heap.state(own_item, own_state);
237 232

	
238
	_Heap& heap;
239
	ItemIntMap& map;
233
          own_state = _Heap::PRE_HEAP;
234
          own_state = _Heap::IN_HEAP;
235
          own_state = _Heap::POST_HEAP;
236
        }
237

	
238
        _Heap& heap;
239
        ItemIntMap& map;
240 240
      };
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -49,3 +49,3 @@
49 49
      /// Returns the value associated with the given key.
50
      Value operator[](const Key &) const { 
50
      Value operator[](const Key &) const {
51 51
        return *static_cast<Value *>(0);
... ...
@@ -55,16 +55,16 @@
55 55
      struct Constraints {
56
	void constraints() {
57
	  Value val = m[key];
58
	  val = m[key];
59
	  typename _ReadMap::Value own_val = m[own_key];
60
	  own_val = m[own_key];
56
        void constraints() {
57
          Value val = m[key];
58
          val = m[key];
59
          typename _ReadMap::Value own_val = m[own_key];
60
          own_val = m[own_key];
61 61

	
62
	  ignore_unused_variable_warning(key);
63
	  ignore_unused_variable_warning(val);
64
	  ignore_unused_variable_warning(own_key);
65
	  ignore_unused_variable_warning(own_val);
66
	}
67
	const Key& key;
68
	const typename _ReadMap::Key& own_key;
69
	const _ReadMap& m;
62
          ignore_unused_variable_warning(key);
63
          ignore_unused_variable_warning(val);
64
          ignore_unused_variable_warning(own_key);
65
          ignore_unused_variable_warning(own_val);
66
        }
67
        const Key& key;
68
        const typename _ReadMap::Key& own_key;
69
        const _ReadMap& m;
70 70
      };
... ...
@@ -95,16 +95,16 @@
95 95
      struct Constraints {
96
	void constraints() {
97
	  m.set(key, val);
98
	  m.set(own_key, own_val);
96
        void constraints() {
97
          m.set(key, val);
98
          m.set(own_key, own_val);
99 99

	
100
	  ignore_unused_variable_warning(key);
101
	  ignore_unused_variable_warning(val);
102
	  ignore_unused_variable_warning(own_key);
103
	  ignore_unused_variable_warning(own_val);
104
	}
105
	const Key& key;
106
	const Value& val;
107
	const typename _WriteMap::Key& own_key;
108
	const typename _WriteMap::Value& own_val;
109
	_WriteMap& m;
100
          ignore_unused_variable_warning(key);
101
          ignore_unused_variable_warning(val);
102
          ignore_unused_variable_warning(own_key);
103
          ignore_unused_variable_warning(own_val);
104
        }
105
        const Key& key;
106
        const Value& val;
107
        const typename _WriteMap::Key& own_key;
108
        const typename _WriteMap::Value& own_val;
109
        _WriteMap& m;
110 110
      };
... ...
@@ -118,3 +118,3 @@
118 118
    class ReadWriteMap : public ReadMap<K,T>,
119
			 public WriteMap<K,T>
119
                         public WriteMap<K,T>
120 120
    {
... ...
@@ -127,3 +127,3 @@
127 127
      /// Returns the value associated with the given key.
128
      Value operator[](const Key &) const { 
128
      Value operator[](const Key &) const {
129 129
        return *static_cast<Value *>(0);
... ...
@@ -136,6 +136,6 @@
136 136
      struct Constraints {
137
	void constraints() {
138
	  checkConcept<ReadMap<K, T>, _ReadWriteMap >();
139
	  checkConcept<WriteMap<K, T>, _ReadWriteMap >();
140
	}
137
        void constraints() {
138
          checkConcept<ReadMap<K, T>, _ReadWriteMap >();
139
          checkConcept<WriteMap<K, T>, _ReadWriteMap >();
140
        }
141 141
      };
... ...
@@ -166,3 +166,3 @@
166 166
      /// Returns a reference to the value associated with the given key.
167
      Reference operator[](const Key &) { 
167
      Reference operator[](const Key &) {
168 168
        return *static_cast<Value *>(0);
... ...
@@ -180,24 +180,24 @@
180 180
      struct Constraints {
181
	void constraints() {
182
	  checkConcept<ReadWriteMap<K, T>, _ReferenceMap >();
183
	  ref = m[key];
184
	  m[key] = val;
185
	  m[key] = ref;
186
	  m[key] = cref;
187
	  own_ref = m[own_key];
188
	  m[own_key] = own_val;
189
	  m[own_key] = own_ref;
190
	  m[own_key] = own_cref;
191
	  m[key] = m[own_key];
192
	  m[own_key] = m[key];
193
	}
194
	const Key& key;
195
	Value& val;
196
	Reference ref;
197
	ConstReference cref;
198
	const typename _ReferenceMap::Key& own_key;
199
	typename _ReferenceMap::Value& own_val;
200
	typename _ReferenceMap::Reference own_ref;
201
	typename _ReferenceMap::ConstReference own_cref;
202
	_ReferenceMap& m;
181
        void constraints() {
182
          checkConcept<ReadWriteMap<K, T>, _ReferenceMap >();
183
          ref = m[key];
184
          m[key] = val;
185
          m[key] = ref;
186
          m[key] = cref;
187
          own_ref = m[own_key];
188
          m[own_key] = own_val;
189
          m[own_key] = own_ref;
190
          m[own_key] = own_cref;
191
          m[key] = m[own_key];
192
          m[own_key] = m[key];
193
        }
194
        const Key& key;
195
        Value& val;
196
        Reference ref;
197
        ConstReference cref;
198
        const typename _ReferenceMap::Key& own_key;
199
        typename _ReferenceMap::Value& own_val;
200
        typename _ReferenceMap::Reference own_ref;
201
        typename _ReferenceMap::ConstReference own_cref;
202
        _ReferenceMap& m;
203 203
      };
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -41,3 +41,3 @@
41 41
    /// A skeleton structure for representing directed paths in a
42
    /// digraph.  
42
    /// digraph.
43 43
    /// \tparam _Digraph The digraph type in which the path is.
... ...
@@ -85,21 +85,21 @@
85 85
      public:
86
	/// Default constructor
87
	ArcIt() {}
88
	/// Invalid constructor
89
	ArcIt(Invalid) {}
90
	/// Constructor for first arc
91
	ArcIt(const Path &) {}
86
        /// Default constructor
87
        ArcIt() {}
88
        /// Invalid constructor
89
        ArcIt(Invalid) {}
90
        /// Constructor for first arc
91
        ArcIt(const Path &) {}
92 92

	
93 93
        /// Conversion to Arc
94
	operator Arc() const { return INVALID; }
94
        operator Arc() const { return INVALID; }
95 95

	
96
	/// Next arc
97
	ArcIt& operator++() {return *this;}
96
        /// Next arc
97
        ArcIt& operator++() {return *this;}
98 98

	
99
	/// Comparison operator
100
	bool operator==(const ArcIt&) const {return true;}
101
	/// Comparison operator
102
	bool operator!=(const ArcIt&) const {return true;}
103
 	/// Comparison operator
104
 	bool operator<(const ArcIt&) const {return false;}
99
        /// Comparison operator
100
        bool operator==(const ArcIt&) const {return true;}
101
        /// Comparison operator
102
        bool operator!=(const ArcIt&) const {return true;}
103
         /// Comparison operator
104
         bool operator<(const ArcIt&) const {return false;}
105 105

	
... ...
@@ -139,3 +139,3 @@
139 139
    namespace _path_bits {
140
      
140

	
141 141
      template <typename _Digraph, typename _Path, typename RevPathTag = void>
... ...
@@ -164,3 +164,3 @@
164 164
      struct PathDumperConstraints<
165
        _Digraph, _Path, 
165
        _Digraph, _Path,
166 166
        typename enable_if<typename _Path::RevPathTag, void>::type
... ...
@@ -186,3 +186,3 @@
186 186
      };
187
    
187

	
188 188
    }
... ...
@@ -211,3 +211,3 @@
211 211
    /// template constructor or a template assignment operator.
212
    /// 
212
    ///
213 213
    template <typename _Digraph>
... ...
@@ -240,21 +240,21 @@
240 240
      public:
241
	/// Default constructor
242
	ArcIt() {}
243
	/// Invalid constructor
244
	ArcIt(Invalid) {}
245
	/// Constructor for first arc
246
	ArcIt(const PathDumper&) {}
241
        /// Default constructor
242
        ArcIt() {}
243
        /// Invalid constructor
244
        ArcIt(Invalid) {}
245
        /// Constructor for first arc
246
        ArcIt(const PathDumper&) {}
247 247

	
248 248
        /// Conversion to Arc
249
	operator Arc() const { return INVALID; }
249
        operator Arc() const { return INVALID; }
250 250

	
251
	/// Next arc
252
	ArcIt& operator++() {return *this;}
251
        /// Next arc
252
        ArcIt& operator++() {return *this;}
253 253

	
254
	/// Comparison operator
255
	bool operator==(const ArcIt&) const {return true;}
256
	/// Comparison operator
257
	bool operator!=(const ArcIt&) const {return true;}
258
 	/// Comparison operator
259
 	bool operator<(const ArcIt&) const {return false;}
254
        /// Comparison operator
255
        bool operator==(const ArcIt&) const {return true;}
256
        /// Comparison operator
257
        bool operator!=(const ArcIt&) const {return true;}
258
         /// Comparison operator
259
         bool operator<(const ArcIt&) const {return false;}
260 260

	
... ...
@@ -268,21 +268,21 @@
268 268
      public:
269
	/// Default constructor
270
	RevArcIt() {}
271
	/// Invalid constructor
272
	RevArcIt(Invalid) {}
273
	/// Constructor for first arc
274
	RevArcIt(const PathDumper &) {}
269
        /// Default constructor
270
        RevArcIt() {}
271
        /// Invalid constructor
272
        RevArcIt(Invalid) {}
273
        /// Constructor for first arc
274
        RevArcIt(const PathDumper &) {}
275 275

	
276 276
        /// Conversion to Arc
277
	operator Arc() const { return INVALID; }
277
        operator Arc() const { return INVALID; }
278 278

	
279
	/// Next arc
280
	RevArcIt& operator++() {return *this;}
279
        /// Next arc
280
        RevArcIt& operator++() {return *this;}
281 281

	
282
	/// Comparison operator
283
	bool operator==(const RevArcIt&) const {return true;}
284
	/// Comparison operator
285
	bool operator!=(const RevArcIt&) const {return true;}
286
 	/// Comparison operator
287
 	bool operator<(const RevArcIt&) const {return false;}
282
        /// Comparison operator
283
        bool operator==(const RevArcIt&) const {return true;}
284
        /// Comparison operator
285
        bool operator!=(const RevArcIt&) const {return true;}
286
         /// Comparison operator
287
         bool operator<(const RevArcIt&) const {return false;}
288 288

	
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -28,3 +28,3 @@
28 28

	
29
namespace lemon 
29
namespace lemon
30 30
{
... ...
@@ -34,3 +34,3 @@
34 34
  template<class P>
35
  class _SubCounter 
35
  class _SubCounter
36 36
  {
... ...
@@ -51,3 +51,3 @@
51 51
      : _parent(parent), _title(title), _os(os), count(0) {}
52
    ~_SubCounter() { 
52
    ~_SubCounter() {
53 53
      _os << _title << count <<std::endl;
... ...
@@ -65,3 +65,3 @@
65 65
  template<class P>
66
  class _NoSubCounter 
66
  class _NoSubCounter
67 67
  {
... ...
@@ -71,7 +71,7 @@
71 71
    typedef _NoSubCounter<_NoSubCounter<P> > NoSubCounter;
72
  
72

	
73 73
    _NoSubCounter(P &parent) :_parent(parent) {}
74
    _NoSubCounter(P &parent,std::string,std::ostream &) 
74
    _NoSubCounter(P &parent,std::string,std::ostream &)
75 75
      :_parent(parent) {}
76
    _NoSubCounter(P &parent,std::string) 
76
    _NoSubCounter(P &parent,std::string)
77 77
      :_parent(parent) {}
... ...
@@ -104,3 +104,3 @@
104 104
  /// A report containing the given title and the value of the counter
105
  /// is automatically printed on destruction. 
105
  /// is automatically printed on destruction.
106 106
  ///
... ...
@@ -135,3 +135,3 @@
135 135
  /// \sa NoCounter
136
  class Counter 
136
  class Counter
137 137
  {
... ...
@@ -143,3 +143,3 @@
143 143
    /// SubCounter class
144
    
144

	
145 145
    /// This class can be used to setup subcounters for a \ref Counter
... ...
@@ -149,3 +149,3 @@
149 149
    /// Subcounters can also have subcounters.
150
    /// 
150
    ///
151 151
    /// The parent counter must be given as the first parameter of the
... ...
@@ -158,3 +158,3 @@
158 158
    /// instead.
159
    /// 
159
    ///
160 160
    /// \sa NoSubCounter
... ...
@@ -162,4 +162,4 @@
162 162

	
163
    /// SubCounter class without printing report on destruction 
164
    
163
    /// SubCounter class without printing report on destruction
164

	
165 165
    /// This class can be used to setup subcounters for a \ref Counter.
... ...
@@ -170,3 +170,3 @@
170 170
    /// Replacing \ref SubCounter "SubCounter"s with \ref NoSubCounter
171
    /// "NoSubCounter"s makes it possible to turn off reporting 
171
    /// "NoSubCounter"s makes it possible to turn off reporting
172 172
    /// subcounter values without actually removing the definitions
... ...
@@ -180,3 +180,3 @@
180 180
    /// Constructor.
181
    Counter(std::string title,std::ostream &os=std::cerr) 
181
    Counter(std::string title,std::ostream &os=std::cerr)
182 182
      : _title(title), _os(os), count(0) {}
... ...
@@ -206,3 +206,3 @@
206 206
    /// \ref SubCounter "SubCounter"s but it resets \ref NoSubCounter
207
    /// "NoSubCounter"s along with the main counter. 
207
    /// "NoSubCounter"s along with the main counter.
208 208
    void reset(int c=0) {count=c;}
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -36,3 +36,3 @@
36 36

	
37
  
37

	
38 38
  ///Default traits class of Dfs class.
... ...
@@ -44,3 +44,3 @@
44 44
  {
45
    ///The digraph type the algorithm runs on. 
45
    ///The digraph type the algorithm runs on.
46 46
    typedef GR Digraph;
... ...
@@ -48,3 +48,3 @@
48 48
    ///arcs of the %DFS paths.
49
    /// 
49
    ///
50 50
    ///The type of the map that stores the last
... ...
@@ -55,7 +55,7 @@
55 55
    ///Instantiates a PredMap.
56
 
57
    ///This function instantiates a \ref PredMap. 
56

	
57
    ///This function instantiates a \ref PredMap.
58 58
    ///\param G is the digraph, to which we would like to define the PredMap.
59 59
    ///\todo The digraph alone may be insufficient to initialize
60
    static PredMap *createPredMap(const GR &G) 
60
    static PredMap *createPredMap(const GR &G)
61 61
    {
... ...
@@ -65,3 +65,3 @@
65 65
    ///The type of the map that indicates which nodes are processed.
66
 
66

	
67 67
    ///The type of the map that indicates which nodes are processed.
... ...
@@ -71,4 +71,4 @@
71 71
    ///Instantiates a ProcessedMap.
72
 
73
    ///This function instantiates a \ref ProcessedMap. 
72

	
73
    ///This function instantiates a \ref ProcessedMap.
74 74
    ///\param g is the digraph, to which
... ...
@@ -84,3 +84,3 @@
84 84
    ///The type of the map that indicates which nodes are reached.
85
 
85

	
86 86
    ///The type of the map that indicates which nodes are reached.
... ...
@@ -90,4 +90,4 @@
90 90
    ///Instantiates a ReachedMap.
91
 
92
    ///This function instantiates a \ref ReachedMap. 
91

	
92
    ///This function instantiates a \ref ReachedMap.
93 93
    ///\param G is the digraph, to which
... ...
@@ -99,3 +99,3 @@
99 99
    ///The type of the map that stores the dists of the nodes.
100
 
100

	
101 101
    ///The type of the map that stores the dists of the nodes.
... ...
@@ -105,4 +105,4 @@
105 105
    ///Instantiates a DistMap.
106
 
107
    ///This function instantiates a \ref DistMap. 
106

	
107
    ///This function instantiates a \ref DistMap.
108 108
    ///\param G is the digraph, to which we would like to define the \ref DistMap
... ...
@@ -113,5 +113,5 @@
113 113
  };
114
  
114

	
115 115
  ///%DFS algorithm class.
116
  
116

	
117 117
  ///\ingroup search
... ...
@@ -129,6 +129,6 @@
129 129
  template <typename GR,
130
	    typename TR>
130
            typename TR>
131 131
#else
132 132
  template <typename GR=ListDigraph,
133
	    typename TR=DfsDefaultTraits<GR> >
133
            typename TR=DfsDefaultTraits<GR> >
134 134
#endif
... ...
@@ -145,3 +145,3 @@
145 145
      virtual const char* what() const throw() {
146
	return "lemon::Dfs::UninitializedParameter";
146
        return "lemon::Dfs::UninitializedParameter";
147 147
      }
... ...
@@ -160,3 +160,3 @@
160 160
    typedef typename Digraph::OutArcIt OutArcIt;
161
    
161

	
162 162
    ///\brief The type of the map that stores the last
... ...
@@ -194,21 +194,21 @@
194 194
    ///Creates the maps if necessary.
195
    
195

	
196 196
    ///\todo Better memory allocation (instead of new).
197
    void create_maps() 
197
    void create_maps()
198 198
    {
199 199
      if(!_pred) {
200
	local_pred = true;
201
	_pred = Traits::createPredMap(*G);
200
        local_pred = true;
201
        _pred = Traits::createPredMap(*G);
202 202
      }
203 203
      if(!_dist) {
204
	local_dist = true;
205
	_dist = Traits::createDistMap(*G);
204
        local_dist = true;
205
        _dist = Traits::createDistMap(*G);
206 206
      }
207 207
      if(!_reached) {
208
	local_reached = true;
209
	_reached = Traits::createReachedMap(*G);
208
        local_reached = true;
209
        _reached = Traits::createReachedMap(*G);
210 210
      }
211 211
      if(!_processed) {
212
	local_processed = true;
213
	_processed = Traits::createProcessedMap(*G);
212
        local_processed = true;
213
        _processed = Traits::createProcessedMap(*G);
214 214
      }
... ...
@@ -219,3 +219,3 @@
219 219
    Dfs() {}
220
    
220

	
221 221
  public:
... ...
@@ -231,5 +231,5 @@
231 231
      typedef T PredMap;
232
      static PredMap *createPredMap(const Digraph &G) 
232
      static PredMap *createPredMap(const Digraph &G)
233 233
      {
234
	throw UninitializedParameter();
234
        throw UninitializedParameter();
235 235
      }
... ...
@@ -245,4 +245,4 @@
245 245
    };
246
    
247
    
246

	
247

	
248 248
    template <class T>
... ...
@@ -250,5 +250,5 @@
250 250
      typedef T DistMap;
251
      static DistMap *createDistMap(const Digraph &) 
251
      static DistMap *createDistMap(const Digraph &)
252 252
      {
253
	throw UninitializedParameter();
253
        throw UninitializedParameter();
254 254
      }
... ...
@@ -264,3 +264,3 @@
264 264
    };
265
    
265

	
266 266
    template <class T>
... ...
@@ -268,5 +268,5 @@
268 268
      typedef T ReachedMap;
269
      static ReachedMap *createReachedMap(const Digraph &) 
269
      static ReachedMap *createReachedMap(const Digraph &)
270 270
      {
271
	throw UninitializedParameter();
271
        throw UninitializedParameter();
272 272
      }
... ...
@@ -286,5 +286,5 @@
286 286
      typedef T ProcessedMap;
287
      static ProcessedMap *createProcessedMap(const Digraph &) 
287
      static ProcessedMap *createProcessedMap(const Digraph &)
288 288
      {
289
	throw UninitializedParameter();
289
        throw UninitializedParameter();
290 290
      }
... ...
@@ -297,11 +297,11 @@
297 297
    template <class T>
298
    struct DefProcessedMap : public Dfs< Digraph, DefProcessedMapTraits<T> > { 
298
    struct DefProcessedMap : public Dfs< Digraph, DefProcessedMapTraits<T> > {
299 299
      typedef Dfs< Digraph, DefProcessedMapTraits<T> > Create;
300 300
    };
301
    
301

	
302 302
    struct DefDigraphProcessedMapTraits : public Traits {
303 303
      typedef typename Digraph::template NodeMap<bool> ProcessedMap;
304
      static ProcessedMap *createProcessedMap(const Digraph &G) 
304
      static ProcessedMap *createProcessedMap(const Digraph &G)
305 305
      {
306
	return new ProcessedMap(G);
306
        return new ProcessedMap(G);
307 307
      }
... ...
@@ -316,12 +316,12 @@
316 316
    class DefProcessedMapToBeDefaultMap :
317
      public Dfs< Digraph, DefDigraphProcessedMapTraits> { 
317
      public Dfs< Digraph, DefDigraphProcessedMapTraits> {
318 318
      typedef Dfs< Digraph, DefDigraphProcessedMapTraits> Create;
319 319
    };
320
    
320

	
321 321
    ///@}
322 322

	
323
  public:      
324
    
323
  public:
324

	
325 325
    ///Constructor.
326
    
326

	
327 327
    ///\param _G the digraph the algorithm will run on.
... ...
@@ -335,5 +335,5 @@
335 335
    { }
336
    
336

	
337 337
    ///Destructor.
338
    ~Dfs() 
338
    ~Dfs()
339 339
    {
... ...
@@ -352,7 +352,7 @@
352 352
    ///\return <tt> (*this) </tt>
353
    Dfs &predMap(PredMap &m) 
353
    Dfs &predMap(PredMap &m)
354 354
    {
355 355
      if(local_pred) {
356
	delete _pred;
357
	local_pred=false;
356
        delete _pred;
357
        local_pred=false;
358 358
      }
... ...
@@ -369,7 +369,7 @@
369 369
    ///\return <tt> (*this) </tt>
370
    Dfs &distMap(DistMap &m) 
370
    Dfs &distMap(DistMap &m)
371 371
    {
372 372
      if(local_dist) {
373
	delete _dist;
374
	local_dist=false;
373
        delete _dist;
374
        local_dist=false;
375 375
      }
... ...
@@ -386,7 +386,7 @@
386 386
    ///\return <tt> (*this) </tt>
387
    Dfs &reachedMap(ReachedMap &m) 
387
    Dfs &reachedMap(ReachedMap &m)
388 388
    {
389 389
      if(local_reached) {
390
	delete _reached;
391
	local_reached=false;
390
        delete _reached;
391
        local_reached=false;
392 392
      }
... ...
@@ -403,7 +403,7 @@
403 403
    ///\return <tt> (*this) </tt>
404
    Dfs &processedMap(ProcessedMap &m) 
404
    Dfs &processedMap(ProcessedMap &m)
405 405
    {
406 406
      if(local_processed) {
407
	delete _processed;
408
	local_processed=false;
407
        delete _processed;
408
        local_processed=false;
409 409
      }
... ...
@@ -436,9 +436,9 @@
436 436
      for ( NodeIt u(*G) ; u!=INVALID ; ++u ) {
437
	_pred->set(u,INVALID);
438
	// _predNode->set(u,INVALID);
439
	_reached->set(u,false);
440
	_processed->set(u,false);
437
        _pred->set(u,INVALID);
438
        // _predNode->set(u,INVALID);
439
        _reached->set(u,false);
440
        _processed->set(u,false);
441 441
      }
442 442
    }
443
    
443

	
444 444
    ///Adds a new source node.
... ...
@@ -452,17 +452,17 @@
452 452
      if(!(*_reached)[s])
453
	{
454
	  _reached->set(s,true);
455
	  _pred->set(s,INVALID);
456
	  OutArcIt e(*G,s);
457
	  if(e!=INVALID) {
458
	    _stack[++_stack_head]=e;
459
	    _dist->set(s,_stack_head);
460
	  }
461
	  else {
462
	    _processed->set(s,true);
463
	    _dist->set(s,0);
464
	  }
465
	}
453
        {
454
          _reached->set(s,true);
455
          _pred->set(s,INVALID);
456
          OutArcIt e(*G,s);
457
          if(e!=INVALID) {
458
            _stack[++_stack_head]=e;
459
            _dist->set(s,_stack_head);
460
          }
461
          else {
462
            _processed->set(s,true);
463
            _dist->set(s,0);
464
          }
465
        }
466 466
    }
467
    
467

	
468 468
    ///Processes the next arc.
... ...
@@ -475,3 +475,3 @@
475 475
    Arc processNextArc()
476
    { 
476
    {
477 477
      Node m;
... ...
@@ -479,19 +479,19 @@
479 479
      if(!(*_reached)[m=G->target(e)]) {
480
	_pred->set(m,e);
481
	_reached->set(m,true);
482
	++_stack_head;
483
	_stack[_stack_head] = OutArcIt(*G, m);
484
	_dist->set(m,_stack_head);
480
        _pred->set(m,e);
481
        _reached->set(m,true);
482
        ++_stack_head;
483
        _stack[_stack_head] = OutArcIt(*G, m);
484
        _dist->set(m,_stack_head);
485 485
      }
486 486
      else {
487
	m=G->source(e);
488
	++_stack[_stack_head];
487
        m=G->source(e);
488
        ++_stack[_stack_head];
489 489
      }
490 490
      while(_stack_head>=0 && _stack[_stack_head]==INVALID) {
491
	_processed->set(m,true);
492
	--_stack_head;
493
	if(_stack_head>=0) {
494
	  m=G->source(_stack[_stack_head]);
495
	  ++_stack[_stack_head];
496
	}
491
        _processed->set(m,true);
492
        --_stack_head;
493
        if(_stack_head>=0) {
494
          m=G->source(_stack[_stack_head]);
495
          ++_stack[_stack_head];
496
        }
497 497
      }
... ...
@@ -506,3 +506,3 @@
506 506
    OutArcIt nextArc()
507
    { 
507
    {
508 508
      return _stack_head>=0?_stack[_stack_head]:INVALID;
... ...
@@ -517,6 +517,6 @@
517 517
    ///Returns the number of the nodes to be processed.
518
    
518

	
519 519
    ///Returns the number of the nodes to be processed in the queue.
520 520
    int queueSize() { return _stack_head+1; }
521
    
521

	
522 522
    ///Executes the algorithm.
... ...
@@ -539,3 +539,3 @@
539 539
    }
540
    
540

	
541 541
    ///Executes the algorithm until \c dest is reached.
... ...
@@ -556,6 +556,6 @@
556 556
    {
557
      while ( !emptyQueue() && G->target(_stack[_stack_head])!=dest ) 
558
	processNextArc();
557
      while ( !emptyQueue() && G->target(_stack[_stack_head])!=dest )
558
        processNextArc();
559 559
    }
560
    
560

	
561 561
    ///Executes the algorithm until a condition is met.
... ...
@@ -584,3 +584,3 @@
584 584
    ///Runs %DFS algorithm to visit all nodes in the digraph.
585
    
585

	
586 586
    ///This method runs the %DFS algorithm in order to
... ...
@@ -612,3 +612,3 @@
612 612
    ///Runs %DFS algorithm from node \c s.
613
    
613

	
614 614
    ///This method runs the %DFS algorithm from a root node \c s
... ...
@@ -631,5 +631,5 @@
631 631
    }
632
    
632

	
633 633
    ///Finds the %DFS path between \c s and \c t.
634
    
634

	
635 635
    ///Finds the %DFS path between \c s and \c t.
... ...
@@ -651,3 +651,3 @@
651 651
    }
652
    
652

	
653 653
    ///@}
... ...
@@ -659,3 +659,3 @@
659 659
    ///either run() or start() must be called.
660
    
660

	
661 661
    ///@{
... ...
@@ -665,6 +665,6 @@
665 665
    ///Gives back the shortest path.
666
    
666

	
667 667
    ///Gives back the shortest path.
668 668
    ///\pre The \c t should be reachable from the source.
669
    Path path(Node t) 
669
    Path path(Node t)
670 670
    {
... ...
@@ -677,3 +677,3 @@
677 677
    ///\pre \ref run() must be called before using this function.
678
    ///\warning If node \c v is unreachable from the root(s) then the return 
678
    ///\warning If node \c v is unreachable from the root(s) then the return
679 679
    ///value of this funcion is undefined.
... ...
@@ -707,4 +707,4 @@
707 707
    Node predNode(Node v) const { return (*_pred)[v]==INVALID ? INVALID:
708
				  G->source((*_pred)[v]); }
709
    
708
                                  G->source((*_pred)[v]); }
709

	
710 710
    ///Returns a reference to the NodeMap of distances.
... ...
@@ -715,3 +715,3 @@
715 715
    const DistMap &distMap() const { return *_dist;}
716
 
716

	
717 717
    ///Returns a reference to the %DFS arc-tree map.
... ...
@@ -723,3 +723,3 @@
723 723
    const PredMap &predMap() const { return *_pred;}
724
 
724

	
725 725
    ///Checks if a node is reachable from the root.
... ...
@@ -732,3 +732,3 @@
732 732
    bool reached(Node v) { return (*_reached)[v]; }
733
    
733

	
734 734
    ///@}
... ...
@@ -743,3 +743,3 @@
743 743
  {
744
    ///The digraph type the algorithm runs on. 
744
    ///The digraph type the algorithm runs on.
745 745
    typedef GR Digraph;
... ...
@@ -747,3 +747,3 @@
747 747
    ///arcs of the %DFS paths.
748
    /// 
748
    ///
749 749
    ///The type of the map that stores the last
... ...
@@ -754,4 +754,4 @@
754 754
    ///Instantiates a PredMap.
755
 
756
    ///This function instantiates a \ref PredMap. 
755

	
756
    ///This function instantiates a \ref PredMap.
757 757
    ///\param g is the digraph, to which we would like to define the PredMap.
... ...
@@ -759,5 +759,5 @@
759 759
#ifdef DOXYGEN
760
    static PredMap *createPredMap(const GR &g) 
760
    static PredMap *createPredMap(const GR &g)
761 761
#else
762
    static PredMap *createPredMap(const GR &) 
762
    static PredMap *createPredMap(const GR &)
763 763
#endif
... ...
@@ -768,3 +768,3 @@
768 768
    ///The type of the map that indicates which nodes are processed.
769
 
769

	
770 770
    ///The type of the map that indicates which nodes are processed.
... ...
@@ -774,4 +774,4 @@
774 774
    ///Instantiates a ProcessedMap.
775
 
776
    ///This function instantiates a \ref ProcessedMap. 
775

	
776
    ///This function instantiates a \ref ProcessedMap.
777 777
    ///\param g is the digraph, to which
... ...
@@ -787,3 +787,3 @@
787 787
    ///The type of the map that indicates which nodes are reached.
788
 
788

	
789 789
    ///The type of the map that indicates which nodes are reached.
... ...
@@ -793,4 +793,4 @@
793 793
    ///Instantiates a ReachedMap.
794
 
795
    ///This function instantiates a \ref ReachedMap. 
794

	
795
    ///This function instantiates a \ref ReachedMap.
796 796
    ///\param G is the digraph, to which
... ...
@@ -802,3 +802,3 @@
802 802
    ///The type of the map that stores the dists of the nodes.
803
 
803

	
804 804
    ///The type of the map that stores the dists of the nodes.
... ...
@@ -808,4 +808,4 @@
808 808
    ///Instantiates a DistMap.
809
 
810
    ///This function instantiates a \ref DistMap. 
809

	
810
    ///This function instantiates a \ref DistMap.
811 811
    ///\param g is the digraph, to which we would like to define the \ref DistMap
... ...
@@ -820,3 +820,3 @@
820 820
  };
821
  
821

	
822 822
  /// Default traits used by \ref DfsWizard
... ...
@@ -850,6 +850,6 @@
850 850
    Node _source;
851
    
851

	
852 852
    public:
853 853
    /// Constructor.
854
    
854

	
855 855
    /// This constructor does not require parameters, therefore it initiates
... ...
@@ -857,6 +857,6 @@
857 857
    DfsWizardBase() : _g(0), _reached(0), _processed(0), _pred(0),
858
			   _dist(0), _source(INVALID) {}
858
                           _dist(0), _source(INVALID) {}
859 859

	
860 860
    /// Constructor.
861
    
861

	
862 862
    /// This constructor requires some parameters,
... ...
@@ -867,3 +867,3 @@
867 867
    DfsWizardBase(const GR &g, Node s=INVALID) :
868
      _g(reinterpret_cast<void*>(const_cast<GR*>(&g))), 
868
      _g(reinterpret_cast<void*>(const_cast<GR*>(&g))),
869 869
      _reached(0), _processed(0), _pred(0), _dist(0), _source(s) {}
... ...
@@ -871,3 +871,3 @@
871 871
  };
872
  
872

	
873 873
  /// A class to make the usage of the Dfs algorithm easier
... ...
@@ -906,3 +906,3 @@
906 906
    typedef typename Digraph::OutArcIt OutArcIt;
907
    
907

	
908 908
    ///\brief The type of the map that stores
... ...
@@ -936,3 +936,3 @@
936 936
    ///Runs Dfs algorithm from a given node.
937
    
937

	
938 938
    ///Runs Dfs algorithm from a given node.
... ...
@@ -943,9 +943,9 @@
943 943
      Dfs<Digraph,TR> alg(*reinterpret_cast<const Digraph*>(Base::_g));
944
      if(Base::_reached) 
944
      if(Base::_reached)
945 945
        alg.reachedMap(*reinterpret_cast<ReachedMap*>(Base::_reached));
946
      if(Base::_processed) 
946
      if(Base::_processed)
947 947
        alg.processedMap(*reinterpret_cast<ProcessedMap*>(Base::_processed));
948
      if(Base::_pred) 
948
      if(Base::_pred)
949 949
        alg.predMap(*reinterpret_cast<PredMap*>(Base::_pred));
950
      if(Base::_dist) 
950
      if(Base::_dist)
951 951
        alg.distMap(*reinterpret_cast<DistMap*>(Base::_dist));
... ...
@@ -970,3 +970,3 @@
970 970
    };
971
    
971

	
972 972
    ///\brief \ref named-templ-param "Named parameter"
... ...
@@ -978,3 +978,3 @@
978 978
    template<class T>
979
    DfsWizard<DefPredMapBase<T> > predMap(const T &t) 
979
    DfsWizard<DefPredMapBase<T> > predMap(const T &t)
980 980
    {
... ...
@@ -983,4 +983,4 @@
983 983
    }
984
    
985
 
984

	
985

	
986 986
    template<class T>
... ...
@@ -991,3 +991,3 @@
991 991
    };
992
    
992

	
993 993
    ///\brief \ref named-templ-param "Named parameter"
... ...
@@ -999,3 +999,3 @@
999 999
    template<class T>
1000
    DfsWizard<DefReachedMapBase<T> > reachedMap(const T &t) 
1000
    DfsWizard<DefReachedMapBase<T> > reachedMap(const T &t)
1001 1001
    {
... ...
@@ -1004,3 +1004,3 @@
1004 1004
    }
1005
    
1005

	
1006 1006

	
... ...
@@ -1012,3 +1012,3 @@
1012 1012
    };
1013
    
1013

	
1014 1014
    ///\brief \ref named-templ-param "Named parameter"
... ...
@@ -1020,3 +1020,3 @@
1020 1020
    template<class T>
1021
    DfsWizard<DefProcessedMapBase<T> > processedMap(const T &t) 
1021
    DfsWizard<DefProcessedMapBase<T> > processedMap(const T &t)
1022 1022
    {
... ...
@@ -1025,3 +1025,3 @@
1025 1025
    }
1026
    
1026

	
1027 1027
    template<class T>
... ...
@@ -1032,3 +1032,3 @@
1032 1032
    };
1033
    
1033

	
1034 1034
    ///\brief \ref named-templ-param "Named parameter"
... ...
@@ -1040,3 +1040,3 @@
1040 1040
    template<class T>
1041
    DfsWizard<DefDistMapBase<T> > distMap(const T &t) 
1041
    DfsWizard<DefDistMapBase<T> > distMap(const T &t)
1042 1042
    {
... ...
@@ -1045,3 +1045,3 @@
1045 1045
    }
1046
    
1046

	
1047 1047
    /// Sets the source node, from which the Dfs algorithm runs.
... ...
@@ -1050,3 +1050,3 @@
1050 1050
    /// \param s is the source node.
1051
    DfsWizard<TR> &source(Node s) 
1051
    DfsWizard<TR> &source(Node s)
1052 1052
    {
... ...
@@ -1055,5 +1055,5 @@
1055 1055
    }
1056
    
1056

	
1057 1057
  };
1058
  
1058

	
1059 1059
  ///Function type interface for Dfs algorithm.
... ...
@@ -1084,5 +1084,5 @@
1084 1084
  /// \brief Visitor class for dfs.
1085
  ///  
1086
  /// It gives a simple interface for a functional interface for dfs 
1087
  /// traversal. The traversal on a linear data structure. 
1085
  ///
1086
  /// It gives a simple interface for a functional interface for dfs
1087
  /// traversal. The traversal on a linear data structure.
1088 1088
  template <typename _Digraph>
... ...
@@ -1093,3 +1093,3 @@
1093 1093
    /// \brief Called when the arc reach a node.
1094
    /// 
1094
    ///
1095 1095
    /// It is called when the dfs find an arc which target is not
... ...
@@ -1098,3 +1098,3 @@
1098 1098
    /// \brief Called when the node reached first time.
1099
    /// 
1099
    ///
1100 1100
    /// It is Called when the node reached first time.
... ...
@@ -1102,3 +1102,3 @@
1102 1102
    /// \brief Called when we step back on an arc.
1103
    /// 
1103
    ///
1104 1104
    /// It is called when the dfs should step back on the arc.
... ...
@@ -1106,9 +1106,9 @@
1106 1106
    /// \brief Called when we step back from the node.
1107
    /// 
1107
    ///
1108 1108
    /// It is called when we step back from the node.
1109 1109
    void leave(const Node& node) {}
1110
    /// \brief Called when the arc examined but target of the arc 
1110
    /// \brief Called when the arc examined but target of the arc
1111 1111
    /// already discovered.
1112
    /// 
1113
    /// It called when the arc examined but the target of the arc 
1112
    ///
1113
    /// It called when the arc examined but the target of the arc
1114 1114
    /// already discovered.
... ...
@@ -1116,3 +1116,3 @@
1116 1116
    /// \brief Called for the source node of the dfs.
1117
    /// 
1117
    ///
1118 1118
    /// It is called for the source node of the dfs.
... ...
@@ -1120,3 +1120,3 @@
1120 1120
    /// \brief Called when we leave the source node of the dfs.
1121
    /// 
1121
    ///
1122 1122
    /// It is called when we leave the source node of the dfs.
... ...
@@ -1142,11 +1142,11 @@
1142 1142
      void constraints() {
1143
	Arc arc;
1144
	Node node;
1145
	visitor.discover(arc);
1146
	visitor.reach(node);
1147
	visitor.backtrack(arc);
1148
	visitor.leave(node);
1149
	visitor.examine(arc);
1150
	visitor.start(node);
1151
	visitor.stop(arc);
1143
        Arc arc;
1144
        Node node;
1145
        visitor.discover(arc);
1146
        visitor.reach(node);
1147
        visitor.backtrack(arc);
1148
        visitor.leave(node);
1149
        visitor.examine(arc);
1150
        visitor.start(node);
1151
        visitor.stop(arc);
1152 1152
      }
... ...
@@ -1164,3 +1164,3 @@
1164 1164

	
1165
    /// \brief The digraph type the algorithm runs on. 
1165
    /// \brief The digraph type the algorithm runs on.
1166 1166
    typedef _Digraph Digraph;
... ...
@@ -1168,3 +1168,3 @@
1168 1168
    /// \brief The type of the map that indicates which nodes are reached.
1169
    /// 
1169
    ///
1170 1170
    /// The type of the map that indicates which nodes are reached.
... ...
@@ -1176,3 +1176,3 @@
1176 1176
    ///
1177
    /// This function instantiates a \ref ReachedMap. 
1177
    /// This function instantiates a \ref ReachedMap.
1178 1178
    /// \param digraph is the digraph, to which
... ...
@@ -1184,5 +1184,5 @@
1184 1184
  };
1185
  
1185

	
1186 1186
  /// %DFS Visit algorithm class.
1187
  
1187

	
1188 1188
  /// \ingroup search
... ...
@@ -1193,3 +1193,3 @@
1193 1193
  /// class. It works with callback mechanism, the DfsVisit object calls
1194
  /// on every dfs event the \c Visitor class member functions. 
1194
  /// on every dfs event the \c Visitor class member functions.
1195 1195
  ///
... ...
@@ -1198,3 +1198,3 @@
1198 1198
  /// is only passed to \ref DfsDefaultTraits.
1199
  /// \tparam _Visitor The Visitor object for the algorithm. The 
1199
  /// \tparam _Visitor The Visitor object for the algorithm. The
1200 1200
  /// \ref DfsVisitor "DfsVisitor<_Digraph>" is an empty Visitor which
... ...
@@ -1202,3 +1202,3 @@
1202 1202
  /// events you should implement your own Visitor class.
1203
  /// \tparam _Traits Traits class to set various data types used by the 
1203
  /// \tparam _Traits Traits class to set various data types used by the
1204 1204
  /// algorithm. The default traits class is
... ...
@@ -1213,4 +1213,4 @@
1213 1213
  template <typename _Digraph = ListDigraph,
1214
	    typename _Visitor = DfsVisitor<_Digraph>,
1215
	    typename _Traits = DfsDefaultTraits<_Digraph> >
1214
            typename _Visitor = DfsVisitor<_Digraph>,
1215
            typename _Traits = DfsDefaultTraits<_Digraph> >
1216 1216
#endif
... ...
@@ -1218,3 +1218,3 @@
1218 1218
  public:
1219
    
1219

	
1220 1220
    /// \brief \ref Exception for uninitialized parameters.
... ...
@@ -1225,5 +1225,5 @@
1225 1225
    public:
1226
      virtual const char* what() const throw() 
1226
      virtual const char* what() const throw()
1227 1227
      {
1228
	return "lemon::DfsVisit::UninitializedParameter";
1228
        return "lemon::DfsVisit::UninitializedParameter";
1229 1229
      }
... ...
@@ -1264,4 +1264,4 @@
1264 1264
      if(!_reached) {
1265
	local_reached = true;
1266
	_reached = Traits::createReachedMap(*_digraph);
1265
        local_reached = true;
1266
        _reached = Traits::createReachedMap(*_digraph);
1267 1267
      }
... ...
@@ -1272,3 +1272,3 @@
1272 1272
    DfsVisit() {}
1273
    
1273

	
1274 1274
  public:
... ...
@@ -1284,6 +1284,6 @@
1284 1284
      static ReachedMap *createReachedMap(const Digraph &digraph) {
1285
	throw UninitializedParameter();
1285
        throw UninitializedParameter();
1286 1286
      }
1287 1287
    };
1288
    /// \brief \ref named-templ-param "Named parameter" for setting 
1288
    /// \brief \ref named-templ-param "Named parameter" for setting
1289 1289
    /// ReachedMap type
... ...
@@ -1293,3 +1293,3 @@
1293 1293
    struct DefReachedMap : public DfsVisit< Digraph, Visitor,
1294
					    DefReachedMapTraits<T> > {
1294
                                            DefReachedMapTraits<T> > {
1295 1295
      typedef DfsVisit< Digraph, Visitor, DefReachedMapTraits<T> > Create;
... ...
@@ -1298,4 +1298,4 @@
1298 1298

	
1299
  public:      
1300
    
1299
  public:
1300

	
1301 1301
    /// \brief Constructor.
... ...
@@ -1307,6 +1307,6 @@
1307 1307
    ///
1308
    DfsVisit(const Digraph& digraph, Visitor& visitor) 
1308
    DfsVisit(const Digraph& digraph, Visitor& visitor)
1309 1309
      : _digraph(&digraph), _visitor(&visitor),
1310
	_reached(0), local_reached(false) {}
1311
    
1310
        _reached(0), local_reached(false) {}
1311

	
1312 1312
    /// \brief Destructor.
... ...
@@ -1327,4 +1327,4 @@
1327 1327
      if(local_reached) {
1328
	delete _reached;
1329
	local_reached=false;
1328
        delete _reached;
1329
        local_reached=false;
1330 1330
      }
... ...
@@ -1355,6 +1355,6 @@
1355 1355
      for (NodeIt u(*_digraph) ; u != INVALID ; ++u) {
1356
	_reached->set(u, false);
1356
        _reached->set(u, false);
1357 1357
      }
1358 1358
    }
1359
    
1359

	
1360 1360
    /// \brief Adds a new source node.
... ...
@@ -1364,15 +1364,15 @@
1364 1364
      if(!(*_reached)[s]) {
1365
	  _reached->set(s,true);
1366
	  _visitor->start(s);
1367
	  _visitor->reach(s);
1368
	  Arc e; 
1369
	  _digraph->firstOut(e, s);
1370
	  if (e != INVALID) {
1371
	    _stack[++_stack_head] = e;
1372
	  } else {
1373
	    _visitor->leave(s);
1374
	  }
1375
	}
1365
          _reached->set(s,true);
1366
          _visitor->start(s);
1367
          _visitor->reach(s);
1368
          Arc e;
1369
          _digraph->firstOut(e, s);
1370
          if (e != INVALID) {
1371
            _stack[++_stack_head] = e;
1372
          } else {
1373
            _visitor->leave(s);
1374
          }
1375
        }
1376 1376
    }
1377
    
1377

	
1378 1378
    /// \brief Processes the next arc.
... ...
@@ -1384,3 +1384,3 @@
1384 1384
    /// \pre The stack must not be empty!
1385
    Arc processNextArc() { 
1385
    Arc processNextArc() {
1386 1386
      Arc e = _stack[_stack_head];
... ...
@@ -1388,21 +1388,21 @@
1388 1388
      if(!(*_reached)[m]) {
1389
	_visitor->discover(e);
1390
	_visitor->reach(m);
1391
	_reached->set(m, true);
1392
	_digraph->firstOut(_stack[++_stack_head], m);
1389
        _visitor->discover(e);
1390
        _visitor->reach(m);
1391
        _reached->set(m, true);
1392
        _digraph->firstOut(_stack[++_stack_head], m);
1393 1393
      } else {
1394
	_visitor->examine(e);
1395
	m = _digraph->source(e);
1396
	_digraph->nextOut(_stack[_stack_head]);
1394
        _visitor->examine(e);
1395
        m = _digraph->source(e);
1396
        _digraph->nextOut(_stack[_stack_head]);
1397 1397
      }
1398 1398
      while (_stack_head>=0 && _stack[_stack_head] == INVALID) {
1399
	_visitor->leave(m);
1400
	--_stack_head;
1401
	if (_stack_head >= 0) {
1402
	  _visitor->backtrack(_stack[_stack_head]);
1403
	  m = _digraph->source(_stack[_stack_head]);
1404
	  _digraph->nextOut(_stack[_stack_head]);
1405
	} else {
1406
	  _visitor->stop(m);	  
1407
	}
1399
        _visitor->leave(m);
1400
        --_stack_head;
1401
        if (_stack_head >= 0) {
1402
          _visitor->backtrack(_stack[_stack_head]);
1403
          m = _digraph->source(_stack[_stack_head]);
1404
          _digraph->nextOut(_stack[_stack_head]);
1405
        } else {
1406
          _visitor->stop(m);
1407
        }
1408 1408
      }
... ...
@@ -1417,3 +1417,3 @@
1417 1417
    /// empty.
1418
    Arc nextArc() { 
1418
    Arc nextArc() {
1419 1419
      return _stack_head >= 0 ? _stack[_stack_head] : INVALID;
... ...
@@ -1432,3 +1432,3 @@
1432 1432
    int queueSize() { return _stack_head + 1; }
1433
    
1433

	
1434 1434
    /// \brief Executes the algorithm.
... ...
@@ -1442,3 +1442,3 @@
1442 1442
    }
1443
    
1443

	
1444 1444
    /// \brief Executes the algorithm until \c dest is reached.
... ...
@@ -1450,6 +1450,6 @@
1450 1450
    void start(Node dest) {
1451
      while ( !emptyQueue() && _digraph->target(_stack[_stack_head]) != dest ) 
1452
	processNextArc();
1451
      while ( !emptyQueue() && _digraph->target(_stack[_stack_head]) != dest )
1452
        processNextArc();
1453 1453
    }
1454
    
1454

	
1455 1455
    /// \brief Executes the algorithm until a condition is met.
... ...
@@ -1492,3 +1492,3 @@
1492 1492
    /// \brief Runs %DFSVisit algorithm to visit all nodes in the digraph.
1493
    
1493

	
1494 1494
    /// This method runs the %DFS algorithm in order to
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -36,3 +36,3 @@
36 36
  /// \brief Default OperationTraits for the Dijkstra algorithm class.
37
  ///  
37
  ///
38 38
  /// It defines all computational operations and constants which are
... ...
@@ -56,3 +56,3 @@
56 56
  /// \brief Widest path OperationTraits for the Dijkstra algorithm class.
57
  ///  
57
  ///
58 58
  /// It defines all computational operations and constants which are
... ...
@@ -74,3 +74,3 @@
74 74
  };
75
  
75

	
76 76
  ///Default traits class of Dijkstra class.
... ...
@@ -83,3 +83,3 @@
83 83
  {
84
    ///The digraph type the algorithm runs on. 
84
    ///The digraph type the algorithm runs on.
85 85
    typedef GR Digraph;
... ...
@@ -105,6 +105,6 @@
105 105

	
106
    ///This function instantiates a \c HeapCrossRef. 
107
    /// \param G is the digraph, to which we would like to define the 
106
    ///This function instantiates a \c HeapCrossRef.
107
    /// \param G is the digraph, to which we would like to define the
108 108
    /// HeapCrossRef.
109
    static HeapCrossRef *createHeapCrossRef(const GR &G) 
109
    static HeapCrossRef *createHeapCrossRef(const GR &G)
110 110
    {
... ...
@@ -112,3 +112,3 @@
112 112
    }
113
    
113

	
114 114
    ///The heap type used by Dijkstra algorithm.
... ...
@@ -121,3 +121,3 @@
121 121

	
122
    static Heap *createHeap(HeapCrossRef& R) 
122
    static Heap *createHeap(HeapCrossRef& R)
123 123
    {
... ...
@@ -128,3 +128,3 @@
128 128
    ///arcs of the shortest paths.
129
    /// 
129
    ///
130 130
    ///The type of the map that stores the last
... ...
@@ -135,7 +135,7 @@
135 135
    ///Instantiates a PredMap.
136
 
137
    ///This function instantiates a \c PredMap. 
136

	
137
    ///This function instantiates a \c PredMap.
138 138
    ///\param G is the digraph, to which we would like to define the PredMap.
139 139
    ///\todo The digraph alone may be insufficient for the initialization
140
    static PredMap *createPredMap(const GR &G) 
140
    static PredMap *createPredMap(const GR &G)
141 141
    {
... ...
@@ -145,3 +145,3 @@
145 145
    ///The type of the map that stores whether a nodes is processed.
146
 
146

	
147 147
    ///The type of the map that stores whether a nodes is processed.
... ...
@@ -154,4 +154,4 @@
154 154
    ///Instantiates a ProcessedMap.
155
 
156
    ///This function instantiates a \c ProcessedMap. 
155

	
156
    ///This function instantiates a \c ProcessedMap.
157 157
    ///\param g is the digraph, to which
... ...
@@ -167,3 +167,3 @@
167 167
    ///The type of the map that stores the dists of the nodes.
168
 
168

	
169 169
    ///The type of the map that stores the dists of the nodes.
... ...
@@ -173,4 +173,4 @@
173 173
    ///Instantiates a DistMap.
174
 
175
    ///This function instantiates a \ref DistMap. 
174

	
175
    ///This function instantiates a \ref DistMap.
176 176
    ///\param G is the digraph, to which we would like to define the \ref DistMap
... ...
@@ -181,5 +181,5 @@
181 181
  };
182
  
182

	
183 183
  ///%Dijkstra algorithm class.
184
  
184

	
185 185
  /// \ingroup shortest_path
... ...
@@ -204,3 +204,3 @@
204 204
  ///of LM is not used directly by Dijkstra, it is only passed to \ref
205
  ///DijkstraDefaultTraits.  
205
  ///DijkstraDefaultTraits.
206 206
  ///\tparam TR Traits class to set
... ...
@@ -216,4 +216,4 @@
216 216
  template <typename GR=ListDigraph,
217
	    typename LM=typename GR::template ArcMap<int>,
218
	    typename TR=DijkstraDefaultTraits<GR,LM> >
217
            typename LM=typename GR::template ArcMap<int>,
218
            typename TR=DijkstraDefaultTraits<GR,LM> >
219 219
#endif
... ...
@@ -230,3 +230,3 @@
230 230
      virtual const char* what() const throw() {
231
	return "lemon::Dijkstra::UninitializedParameter";
231
        return "lemon::Dijkstra::UninitializedParameter";
232 232
      }
... ...
@@ -245,3 +245,3 @@
245 245
    typedef typename Digraph::OutArcIt OutArcIt;
246
    
246

	
247 247
    ///The type of the length of the arcs.
... ...
@@ -290,28 +290,28 @@
290 290
    ///Creates the maps if necessary.
291
    
291

	
292 292
    ///\todo Better memory allocation (instead of new).
293
    void create_maps() 
293
    void create_maps()
294 294
    {
295 295
      if(!_pred) {
296
	local_pred = true;
297
	_pred = Traits::createPredMap(*G);
296
        local_pred = true;
297
        _pred = Traits::createPredMap(*G);
298 298
      }
299 299
      if(!_dist) {
300
	local_dist = true;
301
	_dist = Traits::createDistMap(*G);
300
        local_dist = true;
301
        _dist = Traits::createDistMap(*G);
302 302
      }
303 303
      if(!_processed) {
304
	local_processed = true;
305
	_processed = Traits::createProcessedMap(*G);
304
        local_processed = true;
305
        _processed = Traits::createProcessedMap(*G);
306 306
      }
307 307
      if (!_heap_cross_ref) {
308
	local_heap_cross_ref = true;
309
	_heap_cross_ref = Traits::createHeapCrossRef(*G);
308
        local_heap_cross_ref = true;
309
        _heap_cross_ref = Traits::createHeapCrossRef(*G);
310 310
      }
311 311
      if (!_heap) {
312
	local_heap = true;
313
	_heap = Traits::createHeap(*_heap_cross_ref);
312
        local_heap = true;
313
        _heap = Traits::createHeap(*_heap_cross_ref);
314 314
      }
315 315
    }
316
    
316

	
317 317
  public :
... ...
@@ -319,3 +319,3 @@
319 319
    typedef Dijkstra Create;
320
 
320

	
321 321
    ///\name Named template parameters
... ...
@@ -329,3 +329,3 @@
329 329
      {
330
	throw UninitializedParameter();
330
        throw UninitializedParameter();
331 331
      }
... ...
@@ -337,7 +337,7 @@
337 337
    template <class T>
338
    struct DefPredMap 
339
      : public Dijkstra< Digraph,	LengthMap, DefPredMapTraits<T> > {
340
      typedef Dijkstra< Digraph,	LengthMap, DefPredMapTraits<T> > Create;
338
    struct DefPredMap
339
      : public Dijkstra< Digraph,        LengthMap, DefPredMapTraits<T> > {
340
      typedef Dijkstra< Digraph,        LengthMap, DefPredMapTraits<T> > Create;
341 341
    };
342
    
342

	
343 343
    template <class T>
... ...
@@ -347,3 +347,3 @@
347 347
      {
348
	throw UninitializedParameter();
348
        throw UninitializedParameter();
349 349
      }
... ...
@@ -355,7 +355,7 @@
355 355
    template <class T>
356
    struct DefDistMap 
357
      : public Dijkstra< Digraph, LengthMap, DefDistMapTraits<T> > { 
356
    struct DefDistMap
357
      : public Dijkstra< Digraph, LengthMap, DefDistMapTraits<T> > {
358 358
      typedef Dijkstra< Digraph, LengthMap, DefDistMapTraits<T> > Create;
359 359
    };
360
    
360

	
361 361
    template <class T>
... ...
@@ -363,5 +363,5 @@
363 363
      typedef T ProcessedMap;
364
      static ProcessedMap *createProcessedMap(const Digraph &G) 
364
      static ProcessedMap *createProcessedMap(const Digraph &G)
365 365
      {
366
	throw UninitializedParameter();
366
        throw UninitializedParameter();
367 367
      }
... ...
@@ -373,12 +373,12 @@
373 373
    template <class T>
374
    struct DefProcessedMap 
375
      : public Dijkstra< Digraph,	LengthMap, DefProcessedMapTraits<T> > { 
376
      typedef Dijkstra< Digraph,	LengthMap, DefProcessedMapTraits<T> > Create;
374
    struct DefProcessedMap
375
      : public Dijkstra< Digraph,        LengthMap, DefProcessedMapTraits<T> > {
376
      typedef Dijkstra< Digraph,        LengthMap, DefProcessedMapTraits<T> > Create;
377 377
    };
378
    
378

	
379 379
    struct DefDigraphProcessedMapTraits : public Traits {
380 380
      typedef typename Digraph::template NodeMap<bool> ProcessedMap;
381
      static ProcessedMap *createProcessedMap(const Digraph &G) 
381
      static ProcessedMap *createProcessedMap(const Digraph &G)
382 382
      {
383
	return new ProcessedMap(G);
383
        return new ProcessedMap(G);
384 384
      }
... ...
@@ -392,3 +392,3 @@
392 392
    template <class T>
393
    struct DefProcessedMapToBeDefaultMap 
393
    struct DefProcessedMapToBeDefaultMap
394 394
      : public Dijkstra< Digraph, LengthMap, DefDigraphProcessedMapTraits> {
... ...
@@ -402,7 +402,7 @@
402 402
      static HeapCrossRef *createHeapCrossRef(const Digraph &) {
403
	throw UninitializedParameter();
403
        throw UninitializedParameter();
404 404
      }
405
      static Heap *createHeap(HeapCrossRef &) 
405
      static Heap *createHeap(HeapCrossRef &)
406 406
      {
407
	throw UninitializedParameter();
407
        throw UninitializedParameter();
408 408
      }
... ...
@@ -412,3 +412,3 @@
412 412
    ///
413
    ///\ref named-templ-param "Named parameter" for setting heap and cross 
413
    ///\ref named-templ-param "Named parameter" for setting heap and cross
414 414
    ///reference type
... ...
@@ -417,4 +417,4 @@
417 417
    struct DefHeap
418
      : public Dijkstra< Digraph,	LengthMap, DefHeapTraits<H, CR> > { 
419
      typedef Dijkstra< Digraph,	LengthMap, DefHeapTraits<H, CR> > Create;
418
      : public Dijkstra< Digraph,        LengthMap, DefHeapTraits<H, CR> > {
419
      typedef Dijkstra< Digraph,        LengthMap, DefHeapTraits<H, CR> > Create;
420 420
    };
... ...
@@ -426,7 +426,7 @@
426 426
      static HeapCrossRef *createHeapCrossRef(const Digraph &G) {
427
	return new HeapCrossRef(G);
427
        return new HeapCrossRef(G);
428 428
      }
429
      static Heap *createHeap(HeapCrossRef &R) 
429
      static Heap *createHeap(HeapCrossRef &R)
430 430
      {
431
	return new Heap(R);
431
        return new Heap(R);
432 432
      }
... ...
@@ -436,5 +436,5 @@
436 436
    ///
437
    ///\ref named-templ-param "Named parameter" for setting heap and cross 
438
    ///reference type. It can allocate the heap and the cross reference 
439
    ///object if the cross reference's constructor waits for the digraph as 
437
    ///\ref named-templ-param "Named parameter" for setting heap and cross
438
    ///reference type. It can allocate the heap and the cross reference
439
    ///object if the cross reference's constructor waits for the digraph as
440 440
    ///parameter and the heap's constructor waits for the cross reference.
... ...
@@ -442,4 +442,4 @@
442 442
    struct DefStandardHeap
443
      : public Dijkstra< Digraph,	LengthMap, DefStandardHeapTraits<H, CR> > { 
444
      typedef Dijkstra< Digraph,	LengthMap, DefStandardHeapTraits<H, CR> > 
443
      : public Dijkstra< Digraph,        LengthMap, DefStandardHeapTraits<H, CR> > {
444
      typedef Dijkstra< Digraph,        LengthMap, DefStandardHeapTraits<H, CR> >
445 445
      Create;
... ...
@@ -451,4 +451,4 @@
451 451
    };
452
    
453
    /// \brief \ref named-templ-param "Named parameter" for setting 
452

	
453
    /// \brief \ref named-templ-param "Named parameter" for setting
454 454
    /// OperationTraits type
... ...
@@ -463,3 +463,3 @@
463 463
    };
464
    
464

	
465 465
    ///@}
... ...
@@ -471,6 +471,6 @@
471 471

	
472
  public:      
473
    
472
  public:
473

	
474 474
    ///Constructor.
475
    
475

	
476 476
    ///\param _G the digraph the algorithm will run on.
... ...
@@ -485,5 +485,5 @@
485 485
    { }
486
    
486

	
487 487
    ///Destructor.
488
    ~Dijkstra() 
488
    ~Dijkstra()
489 489
    {
... ...
@@ -500,3 +500,3 @@
500 500
    ///\return <tt> (*this) </tt>
501
    Dijkstra &lengthMap(const LengthMap &m) 
501
    Dijkstra &lengthMap(const LengthMap &m)
502 502
    {
... ...
@@ -513,7 +513,7 @@
513 513
    ///\return <tt> (*this) </tt>
514
    Dijkstra &predMap(PredMap &m) 
514
    Dijkstra &predMap(PredMap &m)
515 515
    {
516 516
      if(local_pred) {
517
	delete _pred;
518
	local_pred=false;
517
        delete _pred;
518
        local_pred=false;
519 519
      }
... ...
@@ -530,7 +530,7 @@
530 530
    ///\return <tt> (*this) </tt>
531
    Dijkstra &distMap(DistMap &m) 
531
    Dijkstra &distMap(DistMap &m)
532 532
    {
533 533
      if(local_dist) {
534
	delete _dist;
535
	local_dist=false;
534
        delete _dist;
535
        local_dist=false;
536 536
      }
... ...
@@ -550,4 +550,4 @@
550 550
      if(local_heap_cross_ref) {
551
	delete _heap_cross_ref;
552
	local_heap_cross_ref=false;
551
        delete _heap_cross_ref;
552
        local_heap_cross_ref=false;
553 553
      }
... ...
@@ -555,4 +555,4 @@
555 555
      if(local_heap) {
556
	delete _heap;
557
	local_heap=false;
556
        delete _heap;
557
        local_heap=false;
558 558
      }
... ...
@@ -594,8 +594,8 @@
594 594
      for ( NodeIt u(*G) ; u!=INVALID ; ++u ) {
595
	_pred->set(u,INVALID);
596
	_processed->set(u,false);
597
	_heap_cross_ref->set(u,Heap::PRE_HEAP);
595
        _pred->set(u,INVALID);
596
        _processed->set(u,false);
597
        _heap_cross_ref->set(u,Heap::PRE_HEAP);
598 598
      }
599 599
    }
600
    
600

	
601 601
    ///Adds a new source node.
... ...
@@ -612,9 +612,9 @@
612 612
      if(_heap->state(s) != Heap::IN_HEAP) {
613
	_heap->push(s,dst);
613
        _heap->push(s,dst);
614 614
      } else if(OperationTraits::less((*_heap)[s], dst)) {
615
	_heap->set(s,dst);
616
	_pred->set(s,INVALID);
615
        _heap->set(s,dst);
616
        _pred->set(s,INVALID);
617 617
      }
618 618
    }
619
    
619

	
620 620
    ///Processes the next node in the priority heap
... ...
@@ -628,3 +628,3 @@
628 628
    {
629
      Node v=_heap->top(); 
629
      Node v=_heap->top();
630 630
      Value oldvalue=_heap->prio();
... ...
@@ -632,22 +632,22 @@
632 632
      finalizeNodeData(v,oldvalue);
633
      
633

	
634 634
      for(OutArcIt e(*G,v); e!=INVALID; ++e) {
635
	Node w=G->target(e); 
636
	switch(_heap->state(w)) {
637
	case Heap::PRE_HEAP:
638
	  _heap->push(w,OperationTraits::plus(oldvalue, (*length)[e])); 
639
	  _pred->set(w,e);
640
	  break;
641
	case Heap::IN_HEAP:
642
	  {
643
	    Value newvalue = OperationTraits::plus(oldvalue, (*length)[e]);
644
	    if ( OperationTraits::less(newvalue, (*_heap)[w]) ) {
645
	      _heap->decrease(w, newvalue); 
646
	      _pred->set(w,e);
647
	    }
648
	  }
649
	  break;
650
	case Heap::POST_HEAP:
651
	  break;
652
	}
635
        Node w=G->target(e);
636
        switch(_heap->state(w)) {
637
        case Heap::PRE_HEAP:
638
          _heap->push(w,OperationTraits::plus(oldvalue, (*length)[e]));
639
          _pred->set(w,e);
640
          break;
641
        case Heap::IN_HEAP:
642
          {
643
            Value newvalue = OperationTraits::plus(oldvalue, (*length)[e]);
644
            if ( OperationTraits::less(newvalue, (*_heap)[w]) ) {
645
              _heap->decrease(w, newvalue);
646
              _pred->set(w,e);
647
            }
648
          }
649
          break;
650
        case Heap::POST_HEAP:
651
          break;
652
        }
653 653
      }
... ...
@@ -657,3 +657,3 @@
657 657
    ///Next node to be processed.
658
    
658

	
659 659
    ///Next node to be processed.
... ...
@@ -663,6 +663,6 @@
663 663
    Node nextNode()
664
    { 
664
    {
665 665
      return !_heap->empty()?_heap->top():INVALID;
666 666
    }
667
 
667

	
668 668
    ///\brief Returns \c false if there are nodes
... ...
@@ -678,3 +678,3 @@
678 678
    int queueSize() { return _heap->size(); }
679
    
679

	
680 680
    ///Executes the algorithm.
... ...
@@ -697,3 +697,3 @@
697 697
    }
698
    
698

	
699 699
    ///Executes the algorithm until \c dest is reached.
... ...
@@ -717,3 +717,3 @@
717 717
    }
718
    
718

	
719 719
    ///Executes the algorithm until a condition is met.
... ...
@@ -738,5 +738,5 @@
738 738
    }
739
    
739

	
740 740
    ///Runs %Dijkstra algorithm from node \c s.
741
    
741

	
742 742
    ///This method runs the %Dijkstra algorithm from a root node \c s
... ...
@@ -759,5 +759,5 @@
759 759
    }
760
    
760

	
761 761
    ///Finds the shortest path between \c s and \c t.
762
    
762

	
763 763
    ///Finds the shortest path between \c s and \c t.
... ...
@@ -779,3 +779,3 @@
779 779
    }
780
    
780

	
781 781
    ///@}
... ...
@@ -787,3 +787,3 @@
787 787
    ///either run() or start() must be called.
788
    
788

	
789 789
    ///@{
... ...
@@ -791,6 +791,6 @@
791 791
    ///Gives back the shortest path.
792
    
792

	
793 793
    ///Gives back the shortest path.
794 794
    ///\pre The \c t should be reachable from the source.
795
    Path path(Node t) 
795
    Path path(Node t)
796 796
    {
... ...
@@ -834,4 +834,4 @@
834 834
    Node predNode(Node v) const { return (*_pred)[v]==INVALID ? INVALID:
835
				  G->source((*_pred)[v]); }
836
    
835
                                  G->source((*_pred)[v]); }
836

	
837 837
    ///Returns a reference to the NodeMap of distances.
... ...
@@ -841,3 +841,3 @@
841 841
    const DistMap &distMap() const { return *_dist;}
842
 
842

	
843 843
    ///Returns a reference to the shortest path tree map.
... ...
@@ -848,3 +848,3 @@
848 848
    const PredMap &predMap() const { return *_pred;}
849
 
849

	
850 850
    ///Checks if a node is reachable from the root.
... ...
@@ -864,3 +864,3 @@
864 864
    bool processed(Node v) { return (*_heap_cross_ref)[v] == Heap::POST_HEAP; }
865
    
865

	
866 866
    ///@}
... ...
@@ -871,3 +871,3 @@
871 871

	
872
 
872

	
873 873
  ///Default traits class of Dijkstra function.
... ...
@@ -880,3 +880,3 @@
880 880
  {
881
    ///The digraph type the algorithm runs on. 
881
    ///The digraph type the algorithm runs on.
882 882
    typedef GR Digraph;
... ...
@@ -903,7 +903,7 @@
903 903

	
904
    ///This function instantiates a \ref HeapCrossRef. 
905
    /// \param G is the digraph, to which we would like to define the 
904
    ///This function instantiates a \ref HeapCrossRef.
905
    /// \param G is the digraph, to which we would like to define the
906 906
    /// HeapCrossRef.
907 907
    /// \todo The digraph alone may be insufficient for the initialization
908
    static HeapCrossRef *createHeapCrossRef(const GR &G) 
908
    static HeapCrossRef *createHeapCrossRef(const GR &G)
909 909
    {
... ...
@@ -911,3 +911,3 @@
911 911
    }
912
    
912

	
913 913
    ///The heap type used by Dijkstra algorithm.
... ...
@@ -919,5 +919,5 @@
919 919
    typedef BinHeap<typename LM::Value, typename GR::template NodeMap<int>,
920
		    std::less<Value> > Heap;
920
                    std::less<Value> > Heap;
921 921

	
922
    static Heap *createHeap(HeapCrossRef& R) 
922
    static Heap *createHeap(HeapCrossRef& R)
923 923
    {
... ...
@@ -928,3 +928,3 @@
928 928
    ///arcs of the shortest paths.
929
    /// 
929
    ///
930 930
    ///The type of the map that stores the last
... ...
@@ -935,4 +935,4 @@
935 935
    ///Instantiates a PredMap.
936
 
937
    ///This function instantiates a \ref PredMap. 
936

	
937
    ///This function instantiates a \ref PredMap.
938 938
    ///\param g is the digraph, to which we would like to define the PredMap.
... ...
@@ -940,5 +940,5 @@
940 940
#ifdef DOXYGEN
941
    static PredMap *createPredMap(const GR &g) 
941
    static PredMap *createPredMap(const GR &g)
942 942
#else
943
    static PredMap *createPredMap(const GR &) 
943
    static PredMap *createPredMap(const GR &)
944 944
#endif
... ...
@@ -948,3 +948,3 @@
948 948
    ///The type of the map that stores whether a nodes is processed.
949
 
949

	
950 950
    ///The type of the map that stores whether a nodes is processed.
... ...
@@ -957,4 +957,4 @@
957 957
    ///Instantiates a ProcessedMap.
958
 
959
    ///This function instantiates a \ref ProcessedMap. 
958

	
959
    ///This function instantiates a \ref ProcessedMap.
960 960
    ///\param g is the digraph, to which
... ...
@@ -970,3 +970,3 @@
970 970
    ///The type of the map that stores the dists of the nodes.
971
 
971

	
972 972
    ///The type of the map that stores the dists of the nodes.
... ...
@@ -976,4 +976,4 @@
976 976
    ///Instantiates a DistMap.
977
 
978
    ///This function instantiates a \ref DistMap. 
977

	
978
    ///This function instantiates a \ref DistMap.
979 979
    ///\param g is the digraph, to which we would like to define the \ref DistMap
... ...
@@ -988,3 +988,3 @@
988 988
  };
989
  
989

	
990 990
  /// Default traits used by \ref DijkstraWizard
... ...
@@ -1020,3 +1020,3 @@
1020 1020
    /// Constructor.
1021
    
1021

	
1022 1022
    /// This constructor does not require parameters, therefore it initiates
... ...
@@ -1024,6 +1024,6 @@
1024 1024
    DijkstraWizardBase() : _g(0), _length(0), _pred(0),
1025
			   _dist(0), _source(INVALID) {}
1025
                           _dist(0), _source(INVALID) {}
1026 1026

	
1027 1027
    /// Constructor.
1028
    
1028

	
1029 1029
    /// This constructor requires some parameters,
... ...
@@ -1035,4 +1035,4 @@
1035 1035
    DijkstraWizardBase(const GR &g,const LM &l, Node s=INVALID) :
1036
      _g(reinterpret_cast<void*>(const_cast<GR*>(&g))), 
1037
      _length(reinterpret_cast<void*>(const_cast<LM*>(&l))), 
1036
      _g(reinterpret_cast<void*>(const_cast<GR*>(&g))),
1037
      _length(reinterpret_cast<void*>(const_cast<LM*>(&l))),
1038 1038
      _pred(0), _dist(0), _source(s) {}
... ...
@@ -1040,3 +1040,3 @@
1040 1040
  };
1041
  
1041

	
1042 1042
  /// A class to make the usage of Dijkstra algorithm easier
... ...
@@ -1058,3 +1058,3 @@
1058 1058
  /// It does not have own \ref run method. When its \ref run method is called
1059
  /// it initiates a plain \ref Dijkstra class, and calls the \ref 
1059
  /// it initiates a plain \ref Dijkstra class, and calls the \ref
1060 1060
  /// Dijkstra::run method of it.
... ...
@@ -1075,3 +1075,3 @@
1075 1075
    typedef typename Digraph::OutArcIt OutArcIt;
1076
    
1076

	
1077 1077
    ///The type of the map that stores the arc lengths.
... ...
@@ -1104,3 +1104,3 @@
1104 1104
    ///Runs Dijkstra algorithm from a given node.
1105
    
1105

	
1106 1106
    ///Runs Dijkstra algorithm from a given node.
... ...
@@ -1110,4 +1110,4 @@
1110 1110
      if(Base::_source==INVALID) throw UninitializedParameter();
1111
      Dijkstra<Digraph,LengthMap,TR> 
1112
	dij(*reinterpret_cast<const Digraph*>(Base::_g),
1111
      Dijkstra<Digraph,LengthMap,TR>
1112
        dij(*reinterpret_cast<const Digraph*>(Base::_g),
1113 1113
            *reinterpret_cast<const LengthMap*>(Base::_length));
... ...
@@ -1134,3 +1134,3 @@
1134 1134
    };
1135
    
1135

	
1136 1136
    ///\brief \ref named-templ-param "Named parameter"
... ...
@@ -1142,3 +1142,3 @@
1142 1142
    template<class T>
1143
    DijkstraWizard<DefPredMapBase<T> > predMap(const T &t) 
1143
    DijkstraWizard<DefPredMapBase<T> > predMap(const T &t)
1144 1144
    {
... ...
@@ -1147,3 +1147,3 @@
1147 1147
    }
1148
    
1148

	
1149 1149
    template<class T>
... ...
@@ -1154,3 +1154,3 @@
1154 1154
    };
1155
    
1155

	
1156 1156
    ///\brief \ref named-templ-param "Named parameter"
... ...
@@ -1162,3 +1162,3 @@
1162 1162
    template<class T>
1163
    DijkstraWizard<DefDistMapBase<T> > distMap(const T &t) 
1163
    DijkstraWizard<DefDistMapBase<T> > distMap(const T &t)
1164 1164
    {
... ...
@@ -1167,3 +1167,3 @@
1167 1167
    }
1168
    
1168

	
1169 1169
    /// Sets the source node, from which the Dijkstra algorithm runs.
... ...
@@ -1172,3 +1172,3 @@
1172 1172
    /// \param s is the source node.
1173
    DijkstraWizard<TR> &source(Node s) 
1173
    DijkstraWizard<TR> &source(Node s)
1174 1174
    {
... ...
@@ -1177,5 +1177,5 @@
1177 1177
    }
1178
    
1178

	
1179 1179
  };
1180
  
1180

	
1181 1181
  ///Function type interface for Dijkstra algorithm.
Ignore white space 6 line context
1
/* -*- C++ -*-
1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3
 * This file is a part of LEMON, a generic C++ optimization library
3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
... ...
@@ -26,3 +26,3 @@
26 26
///\file
27
///\brief A simple two dimensional vector and a bounding box implementation 
27
///\brief A simple two dimensional vector and a bounding box implementation
28 28
///
... ...
@@ -61,4 +61,4 @@
61 61
      ///Second coordinate
62
      T y;     
63
      
62
      T y;
63

	
64 64
      ///Default constructor
... ...
@@ -72,3 +72,3 @@
72 72
      ///The dimension of the vector.
73
      ///This function always returns 2. 
73
      ///This function always returns 2.
74 74
      int size() const { return 2; }
... ...
@@ -94,3 +94,3 @@
94 94
      }
95
  
95

	
96 96
      ///Increment the left hand side by \c u
... ...
@@ -101,3 +101,3 @@
101 101
      }
102
  
102

	
103 103
      ///Decrement the left hand side by \c u
... ...
@@ -122,3 +122,3 @@
122 122
      }
123
  
123

	
124 124
      ///Return the scalar product of two vectors
... ...
@@ -127,3 +127,3 @@
127 127
      }
128
  
128

	
129 129
      ///Return the sum of two vectors
... ...
@@ -171,3 +171,3 @@
171 171

	
172
  ///Return a Point 
172
  ///Return a Point
173 173

	
... ...
@@ -261,3 +261,3 @@
261 261

	
262
  
262

	
263 263

	
... ...
@@ -272,3 +272,3 @@
272 272
    public:
273
      
273

	
274 274
      ///Default constructor: creates an empty bounding box
... ...
@@ -278,5 +278,5 @@
278 278
      BoundingBox(Point<T> a) { bottom_left=top_right=a; _empty = false; }
279
      
279

	
280 280
      ///Construct an instance from two points
281
      
281

	
282 282
      ///Construct an instance from two points.
... ...
@@ -288,7 +288,7 @@
288 288
      {
289
	bottom_left=a;
290
	top_right=b;
291
	_empty = false;
289
        bottom_left=a;
290
        top_right=b;
291
        _empty = false;
292 292
      }
293
      
293

	
294 294
      ///Construct an instance from four numbers
... ...
@@ -301,12 +301,12 @@
301 301
      ///\warning The left side must be no more than the right side and
302
      ///bottom must be no more than the top. 
302
      ///bottom must be no more than the top.
303 303
      BoundingBox(T l,T b,T r,T t)
304 304
      {
305
	bottom_left=Point<T>(l,b);
306
	top_right=Point<T>(r,t);
307
	_empty = false;
305
        bottom_left=Point<T>(l,b);
306
        top_right=Point<T>(r,t);
307
        _empty = false;
308 308
      }
309
      
309

	
310 310
      ///Return \c true if the bounding box is empty.
311
      
311

	
312 312
      ///Return \c true if the bounding box is empty (i.e. return \c false
... ...
@@ -315,3 +315,3 @@
315 315
      ///
316
      ///The coordinates of an empty bounding box are not defined. 
316
      ///The coordinates of an empty bounding box are not defined.
317 317
      bool empty() const {
... ...
@@ -319,3 +319,3 @@
319 319
      }
320
      
320

	
321 321
      ///Make the BoundingBox empty
... ...
@@ -338,3 +338,3 @@
338 338
      void bottomLeft(Point<T> p) {
339
	bottom_left = p;
339
        bottom_left = p;
340 340
      }
... ...
@@ -354,3 +354,3 @@
354 354
      void topRight(Point<T> p) {
355
	top_right = p;
355
        top_right = p;
356 356
      }
... ...
@@ -370,6 +370,6 @@
370 370
      void bottomRight(Point<T> p) {
371
	top_right.x = p.x;
372
	bottom_left.y = p.y;
371
        top_right.x = p.x;
372
        bottom_left.y = p.y;
373 373
      }
374
 
374

	
375 375
      ///Give back the top left corner of the box
... ...
@@ -387,4 +387,4 @@
387 387
      void topLeft(Point<T> p) {
388
	top_right.y = p.y;
389
	bottom_left.x = p.x;
388
        top_right.y = p.y;
389
        bottom_left.x = p.x;
390 390
      }
... ...
@@ -404,3 +404,3 @@
404 404
      void bottom(T t) {
405
	bottom_left.y = t;
405
        bottom_left.y = t;
406 406
      }
... ...
@@ -420,3 +420,3 @@
420 420
      void top(T t) {
421
	top_right.y = t;
421
        top_right.y = t;
422 422
      }
... ...
@@ -430,3 +430,3 @@
430 430
      }
431
 
431

	
432 432
      ///Set the left side of the box
... ...
@@ -436,3 +436,3 @@
436 436
      void left(T t) {
437
	bottom_left.x = t;
437
        bottom_left.x = t;
438 438
      }
... ...
@@ -452,3 +452,3 @@
452 452
      void right(T t) {
453
	top_right.x = t;
453
        top_right.x = t;
454 454
      }
... ...
@@ -480,3 +480,3 @@
480 480
      }
481
  
481

	
482 482
      ///Increments a bounding box with a point
... ...
@@ -498,5 +498,5 @@
498 498
      }
499
    
499

	
500 500
      ///Increments a bounding box to contain another bounding box
501
      
501

	
502 502
      ///Increments a bounding box to contain another bounding box.
... ...
@@ -506,3 +506,3 @@
506 506
          this->add(u.bottomLeft());
507
	  this->add(u.topRight());
507
          this->add(u.topRight());
508 508
        }
... ...
@@ -510,3 +510,3 @@
510 510
      }
511
  
511

	
512 512
      ///Intersection of two bounding boxes
... ...
@@ -518,11 +518,11 @@
518 518
        if (this->_empty || u._empty) {
519
	  b._empty = true;
520
	} else {
521
	  b.bottom_left.x = std::max(this->bottom_left.x,u.bottom_left.x);
522
	  b.bottom_left.y = std::max(this->bottom_left.y,u.bottom_left.y);
523
	  b.top_right.x = std::min(this->top_right.x,u.top_right.x);
524
	  b.top_right.y = std::min(this->top_right.y,u.top_right.y);
525
	  b._empty = b.bottom_left.x > b.top_right.x ||
526
	             b.bottom_left.y > b.top_right.y;
527
	} 
519
          b._empty = true;
520
        } else {
521
          b.bottom_left.x = std::max(this->bottom_left.x,u.bottom_left.x);
522
          b.bottom_left.y = std::max(this->bottom_left.y,u.bottom_left.y);
523
          b.top_right.x = std::min(this->top_right.x,u.top_right.x);
524
          b.top_right.y = std::min(this->top_right.y,u.top_right.y);
525
          b._empty = b.bottom_left.x > b.top_right.x ||
526
                     b.bottom_left.y > b.top_right.y;
527
        }
528 528
        return b;
... ...
@@ -539,3 +539,3 @@
539 539
  template<class M>
540
  class XMap 
540
  class XMap
541 541
  {
... ...
@@ -551,3 +551,3 @@
551 551
  };
552
    
552

	
553 553
  ///Returns an \ref XMap class
... ...
@@ -558,4 +558,4 @@
558 558
  ///\relates XMap
559
  template<class M> 
560
  inline XMap<M> xMap(M &m) 
559
  template<class M>
560
  inline XMap<M> xMap(M &m)
561 561
  {
... ...
@@ -564,4 +564,4 @@
564 564

	
565
  template<class M> 
566
  inline XMap<M> xMap(const M &m) 
565
  template<class M>
566
  inline XMap<M> xMap(const M &m)
567 567
  {
... ...
@@ -576,3 +576,3 @@
576 576
  template<class M>
577
  class ConstXMap 
577
  class ConstXMap
578 578
  {
... ...
@@ -587,3 +587,3 @@
587 587
  };
588
    
588

	
589 589
  ///Returns a \ref ConstXMap class
... ...
@@ -594,4 +594,4 @@
594 594
  ///\relates ConstXMap
595
  template<class M> 
596
  inline ConstXMap<M> xMap(const M &m) 
595
  template<class M>
596
  inline ConstXMap<M> xMap(const M &m)
597 597
  {
... ...
@@ -601,3 +601,3 @@
601 601
  ///Map of y-coordinates of a \ref Point "Point"-map
602
    
602

	
603 603
  ///\ingroup maps
... ...
@@ -606,3 +606,3 @@
606 606
  template<class M>
607
  class YMap 
607
  class YMap
608 608
  {
... ...
@@ -625,4 +625,4 @@
625 625
  ///\relates YMap
626
  template<class M> 
627
  inline YMap<M> yMap(M &m) 
626
  template<class M>
627
  inline YMap<M> yMap(M &m)
628 628
  {
... ...
@@ -631,4 +631,4 @@
631 631

	
632
  template<class M> 
633
  inline YMap<M> yMap(const M &m) 
632
  template<class M>
633
  inline YMap<M> yMap(const M &m)
634 634
  {
... ...
@@ -643,3 +643,3 @@
643 643
  template<class M>
644
  class ConstYMap 
644
  class ConstYMap
645 645
  {
... ...
@@ -654,3 +654,3 @@
654 654
  };
655
    
655

	
656 656
  ///Returns a \ref ConstYMap class
... ...
@@ -661,4 +661,4 @@
661 661
  ///\relates ConstYMap
662
  template<class M> 
663
  inline ConstYMap<M> yMap(const M &m) 
662
  template<class M>
663
  inline ConstYMap<M> yMap(const M &m)
664 664
  {
... ...
@@ -675,3 +675,3 @@
675 675
  template<class M>
676
  class NormSquareMap 
676
  class NormSquareMap
677 677
  {
... ...
@@ -686,3 +686,3 @@
686 686
  };
687
    
687

	
688 688
  ///Returns a \ref NormSquareMap class
... ...
@@ -693,4 +693,4 @@
693 693
  ///\relates NormSquareMap
694
  template<class M> 
695
  inline NormSquareMap<M> normSquareMap(const M &m) 
694
  template<class M>
695
  inline NormSquareMap<M> normSquareMap(const M &m)
696 696
  {
... ...
@@ -702,3 +702,3 @@
702 702
  } //namespce dim2
703
  
703

	
704 704
} //namespace lemon

Changeset was too big and was cut off... Show full diff

0 comments (0 inline)