27 #ifndef MLN_UTIL_TREE_TO_FAST_HH
28 # define MLN_UTIL_TREE_TO_FAST_HH
37 # include <mln/util/tree.hh>
38 # include <mln/util/tree_fast.hh>
39 # include <mln/debug/trace.hh>
61 # ifndef MLN_INCLUDE_ONLY
70 tree_to_fast_(tree_node<T>* input, tree_fast<T>& tree,
71 unsigned p,
unsigned& i)
73 typename tree_node<T>::children_t child = input->children ();
74 typename tree_node<T>::children_t::iterator it = child.begin ();
76 for (; it != child.end (); ++it)
78 tree.add_child(p, (*it)->elt ());
80 impl::tree_to_fast_((*it), tree, i, i);
93 mln_trace(
"util::tree_to_fast");
96 tree_fast<T> tree (input.root ()->elt ());
98 impl::tree_to_fast_(input.root (), tree, 0, i);
103 # endif // ! MLN_INCLUDE_ONLY
110 #endif // ! MLN_UTIL_TREE_TO_FAST_HH