gravatar
kpeter (Peter Kovacs)
kpeter@inf.elte.hu
Doc improvement in core.h (ticket #97)
0 1 0
default
1 file changed with 4 insertions and 0 deletions:
↑ Collapse diff ↑
Ignore white space 192 line context
1 1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3 3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
5 5
 * Copyright (C) 2003-2008
6 6
 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7 7
 * (Egervary Research Group on Combinatorial Optimization, EGRES).
8 8
 *
9 9
 * Permission to use, modify and distribute this software is granted
10 10
 * provided that this copyright notice appears in all copies. For
11 11
 * precise terms see the accompanying LICENSE file.
12 12
 *
13 13
 * This software is provided "AS IS" with no warranty of any kind,
14 14
 * express or implied, and with no claim as to its suitability for any
15 15
 * purpose.
16 16
 *
17 17
 */
18 18

	
19 19
#ifndef LEMON_CORE_H
20 20
#define LEMON_CORE_H
21 21

	
22 22
#include <vector>
23 23
#include <algorithm>
24 24

	
25 25
#include <lemon/bits/enable_if.h>
26 26
#include <lemon/bits/traits.h>
27 27

	
28 28
///\file
29 29
///\brief LEMON core utilities.
30
///
31
///This header file contains core utilities for LEMON.
32
///It is automatically included by all graph types, therefore it usually 
33
///do not have to be included directly.
30 34

	
31 35
namespace lemon {
32 36

	
33 37
  /// \brief Dummy type to make it easier to create invalid iterators.
34 38
  ///
35 39
  /// Dummy type to make it easier to create invalid iterators.
36 40
  /// See \ref INVALID for the usage.
37 41
  struct Invalid {
38 42
  public:
39 43
    bool operator==(Invalid) { return true;  }
40 44
    bool operator!=(Invalid) { return false; }
41 45
    bool operator< (Invalid) { return false; }
42 46
  };
43 47

	
44 48
  /// \brief Invalid iterators.
45 49
  ///
46 50
  /// \ref Invalid is a global type that converts to each iterator
47 51
  /// in such a way that the value of the target iterator will be invalid.
48 52
#ifdef LEMON_ONLY_TEMPLATES
49 53
  const Invalid INVALID = Invalid();
50 54
#else
51 55
  extern const Invalid INVALID;
52 56
#endif
53 57

	
54 58
  /// \addtogroup gutils
55 59
  /// @{
56 60

	
57 61
  ///Creates convenience typedefs for the digraph types and iterators
58 62

	
59 63
  ///This \c \#define creates convenience typedefs for the following types
60 64
  ///of \c Digraph: \c Node,  \c NodeIt, \c Arc, \c ArcIt, \c InArcIt,
61 65
  ///\c OutArcIt, \c BoolNodeMap, \c IntNodeMap, \c DoubleNodeMap,
62 66
  ///\c BoolArcMap, \c IntArcMap, \c DoubleArcMap.
63 67
  ///
64 68
  ///\note If the graph type is a dependent type, ie. the graph type depend
65 69
  ///on a template parameter, then use \c TEMPLATE_DIGRAPH_TYPEDEFS()
66 70
  ///macro.
67 71
#define DIGRAPH_TYPEDEFS(Digraph)                                       \
68 72
  typedef Digraph::Node Node;                                           \
69 73
  typedef Digraph::NodeIt NodeIt;                                       \
70 74
  typedef Digraph::Arc Arc;                                             \
71 75
  typedef Digraph::ArcIt ArcIt;                                         \
72 76
  typedef Digraph::InArcIt InArcIt;                                     \
73 77
  typedef Digraph::OutArcIt OutArcIt;                                   \
74 78
  typedef Digraph::NodeMap<bool> BoolNodeMap;                           \
75 79
  typedef Digraph::NodeMap<int> IntNodeMap;                             \
76 80
  typedef Digraph::NodeMap<double> DoubleNodeMap;                       \
77 81
  typedef Digraph::ArcMap<bool> BoolArcMap;                             \
78 82
  typedef Digraph::ArcMap<int> IntArcMap;                               \
79 83
  typedef Digraph::ArcMap<double> DoubleArcMap
80 84

	
81 85
  ///Creates convenience typedefs for the digraph types and iterators
82 86

	
83 87
  ///\see DIGRAPH_TYPEDEFS
84 88
  ///
85 89
  ///\note Use this macro, if the graph type is a dependent type,
86 90
  ///ie. the graph type depend on a template parameter.
87 91
#define TEMPLATE_DIGRAPH_TYPEDEFS(Digraph)                              \
88 92
  typedef typename Digraph::Node Node;                                  \
89 93
  typedef typename Digraph::NodeIt NodeIt;                              \
90 94
  typedef typename Digraph::Arc Arc;                                    \
91 95
  typedef typename Digraph::ArcIt ArcIt;                                \
92 96
  typedef typename Digraph::InArcIt InArcIt;                            \
93 97
  typedef typename Digraph::OutArcIt OutArcIt;                          \
94 98
  typedef typename Digraph::template NodeMap<bool> BoolNodeMap;         \
95 99
  typedef typename Digraph::template NodeMap<int> IntNodeMap;           \
96 100
  typedef typename Digraph::template NodeMap<double> DoubleNodeMap;     \
97 101
  typedef typename Digraph::template ArcMap<bool> BoolArcMap;           \
98 102
  typedef typename Digraph::template ArcMap<int> IntArcMap;             \
99 103
  typedef typename Digraph::template ArcMap<double> DoubleArcMap
100 104

	
101 105
  ///Creates convenience typedefs for the graph types and iterators
102 106

	
103 107
  ///This \c \#define creates the same convenience typedefs as defined
104 108
  ///by \ref DIGRAPH_TYPEDEFS(Graph) and six more, namely it creates
105 109
  ///\c Edge, \c EdgeIt, \c IncEdgeIt, \c BoolEdgeMap, \c IntEdgeMap,
106 110
  ///\c DoubleEdgeMap.
107 111
  ///
108 112
  ///\note If the graph type is a dependent type, ie. the graph type depend
109 113
  ///on a template parameter, then use \c TEMPLATE_DIGRAPH_TYPEDEFS()
110 114
  ///macro.
111 115
#define GRAPH_TYPEDEFS(Graph)                                           \
112 116
  DIGRAPH_TYPEDEFS(Graph);                                              \
113 117
  typedef Graph::Edge Edge;                                             \
114 118
  typedef Graph::EdgeIt EdgeIt;                                         \
115 119
  typedef Graph::IncEdgeIt IncEdgeIt;                                   \
116 120
  typedef Graph::EdgeMap<bool> BoolEdgeMap;                             \
117 121
  typedef Graph::EdgeMap<int> IntEdgeMap;                               \
118 122
  typedef Graph::EdgeMap<double> DoubleEdgeMap
119 123

	
120 124
  ///Creates convenience typedefs for the graph types and iterators
121 125

	
122 126
  ///\see GRAPH_TYPEDEFS
123 127
  ///
124 128
  ///\note Use this macro, if the graph type is a dependent type,
125 129
  ///ie. the graph type depend on a template parameter.
0 comments (0 inline)