Skip to content

Commit 372d53f

Browse files
author
yiji
committed
remove inline function modifiers
1 parent 2c95853 commit 372d53f

File tree

1 file changed

+26
-32
lines changed

1 file changed

+26
-32
lines changed

include/boost/graph/link_cut_trees.hpp

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,27 @@ namespace boost
2020
class link_cut_trees
2121
{
2222
public:
23-
inline link_cut_trees(ElementParentMap p, ElementChildMap l, ElementChildMap r) : parent(p), left(l), right(r) {}
23+
link_cut_trees(ElementParentMap p, ElementChildMap l, ElementChildMap r) : parent(p), left(l), right(r) {}
2424

25-
inline link_cut_trees(const link_cut_trees &c)
25+
link_cut_trees(const link_cut_trees &c)
2626
: parent(c.parent), left(c.left), right(c.right) {}
2727

2828
template <class Element>
29-
inline void make_tree(Element x)
29+
void make_tree(Element x)
3030
{
31-
make_path(x);
31+
put(parent, x, x);
32+
put(right, x, x);
33+
put(left, x, x);
3234
}
3335

3436
template <class Element>
35-
inline Element find_root(Element x)
37+
Element find_root(Element x)
3638
{
3739
return find_tail(expose(x));
3840
}
3941

4042
template <class Element>
41-
inline void link(Element x, Element y)
43+
void link(Element x, Element y)
4244
{
4345
BOOST_ASSERT(find_root(x) == x); // Element x must be a tree root
4446
Element r = expose(x);
@@ -47,7 +49,7 @@ namespace boost
4749
}
4850

4951
template <class Element>
50-
inline void cut(Element x)
52+
void cut(Element x)
5153
{
5254
expose(x);
5355
std::pair<Element, Element> uv = split(x);
@@ -56,7 +58,7 @@ namespace boost
5658
}
5759

5860
template <class Element>
59-
inline Element lowest_common_ancestor(Element x, Element y)
61+
Element lowest_common_ancestor(Element x, Element y)
6062
{
6163
BOOST_ASSERT(find_root(x) == find_root(y)); // Elements x and y must have same root
6264
expose(x);
@@ -68,7 +70,7 @@ namespace boost
6870
ElementChildMap left, right;
6971

7072
template <class Element>
71-
inline Element get_parent(Element x) const
73+
Element get_parent(Element x) const
7274
{
7375
Element x_parent = get(parent, x);
7476
if (get(left, x_parent) == x || get(right, x_parent) == x)
@@ -77,19 +79,19 @@ namespace boost
7779
}
7880

7981
template <class Element>
80-
inline Element get_successor(Element x) const
82+
Element get_successor(Element x) const
8183
{
8284
return get(parent, x);
8385
}
8486

8587
template <class Element>
86-
inline void put_successor(Element x, Element x_successor)
88+
void put_successor(Element x, Element x_successor)
8789
{
8890
put(parent, x, x_successor);
8991
}
9092

9193
template <class Element>
92-
inline void rotate(const Element x, const ElementChildMap &side)
94+
void rotate(const Element x, const ElementChildMap &side)
9395
{
9496
const ElementChildMap &opposite = (&side == &left) ? right : left;
9597
const Element pivot = get(side, x);
@@ -120,7 +122,7 @@ namespace boost
120122
}
121123

122124
template <class Element>
123-
inline ElementChildMap& get_side(Element x)
125+
ElementChildMap& get_side(Element x)
124126
{
125127
Element x_parent = get_parent(x);
126128
if (get(left, x_parent) == x)
@@ -129,7 +131,7 @@ namespace boost
129131
}
130132

131133
template <class Element>
132-
inline void splay(Element x)
134+
void splay(Element x)
133135
{
134136
for (Element x_parent = get_parent(x); x != x_parent; x_parent = get_parent(x))
135137
{
@@ -153,7 +155,7 @@ namespace boost
153155
}
154156

155157
template <class Element>
156-
inline Element expose(Element x)
158+
Element expose(Element x)
157159
{
158160
Element r = x;
159161
while (true)
@@ -172,22 +174,14 @@ namespace boost
172174
}
173175

174176
template <class Element>
175-
inline void make_path(Element x)
176-
{
177-
put(parent, x, x);
178-
put(right, x, x);
179-
put(left, x, x);
180-
}
181-
182-
template <class Element>
183-
inline Element find_path(Element x)
177+
Element find_path(Element x)
184178
{
185179
splay(x);
186180
return x;
187181
}
188182

189183
template <class Element>
190-
inline Element find_tail(Element x)
184+
Element find_tail(Element x)
191185
{
192186
while (get(right, x) != x)
193187
x = get(right, x);
@@ -196,7 +190,7 @@ namespace boost
196190
}
197191

198192
template <class Element>
199-
inline Element join(Element u, Element v, Element w)
193+
Element join(Element u, Element v, Element w)
200194
{
201195
if (u != v)
202196
put(parent, u, v);
@@ -208,7 +202,7 @@ namespace boost
208202
}
209203

210204
template <class Element>
211-
inline std::pair<Element, Element> split(Element x)
205+
std::pair<Element, Element> split(Element x)
212206
{
213207
splay(x);
214208
Element x_left = get(left, x);
@@ -242,33 +236,33 @@ namespace boost
242236
id_to_vertex(inverse_id) {}
243237

244238
template <class Vertex>
245-
inline void make_tree(Vertex x)
239+
void make_tree(Vertex x)
246240
{
247241
const Index x_id = get(id, x);
248242
LCT::make_tree(x_id);
249243
id_to_vertex[x_id] = x;
250244
}
251245

252246
template <class Vertex>
253-
inline Vertex find_root(Vertex x)
247+
Vertex find_root(Vertex x)
254248
{
255249
return id_to_vertex[LCT::find_root(get(id, x))];
256250
}
257251

258252
template <class Vertex>
259-
inline void link(Vertex x, Vertex y)
253+
void link(Vertex x, Vertex y)
260254
{
261255
LCT::link(get(id, x), get(id, y));
262256
}
263257

264258
template <class Vertex>
265-
inline void cut(Vertex x)
259+
void cut(Vertex x)
266260
{
267261
LCT::cut(get(id, x));
268262
}
269263

270264
template <class Vertex>
271-
inline Vertex lowest_common_ancestor(Vertex x, Vertex y)
265+
Vertex lowest_common_ancestor(Vertex x, Vertex y)
272266
{
273267
return id_to_vertex[LCT::lowest_common_ancestor(get(id, x), get(id, y))];
274268
}

0 commit comments

Comments
 (0)