Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
treeify.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2#ifndef INKSCAPE_UTIL_TREEIFY_H
3#define INKSCAPE_UTIL_TREEIFY_H
4
5#include <functional>
6#include <vector>
7
8namespace Inkscape::Util {
9
11{
12 std::vector<int> preorder;
13 std::vector<int> num_children;
14};
15
21TreeifyResult treeify(int N, std::function<bool(int, int)> const &contains);
22
23} // namespace Inkscape::Util
24
25#endif // INKSCAPE_UTIL_TREEIFY_H
26/*
27 Local Variables:
28 mode:c++
29 c-file-style:"stroustrup"
30 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
31 indent-tabs-mode:nil
32 fill-column:99
33 End:
34*/
35// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
Miscellaneous supporting code.
Definition document.h:93
TreeifyResult treeify(int N, std::function< bool(int, int)> const &contains)
Given a collection of nodes 0 ... N - 1 and a containment function, attempt to organise the nodes int...
Definition treeify.cpp:9
size_t N
std::vector< int > preorder
The preorder traversal of the nodes, a permutation of {0, ..., N - 1}.
Definition treeify.h:12
std::vector< int > num_children
For each node, the number of direct children.
Definition treeify.h:13