|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Random tree generation. More...
#include <memory>#include <tpl_tree_node.H>#include <tpl_binNodeUtils.H>#include <ah-errors.H>#include <ah-random.H>Go to the source code of this file.
Classes | |
| class | RandTree< T > |
| Generator for uniformly random trees. More... | |
Random tree generation.
This file provides the RandTree class for generating uniformly random trees with n nodes. Uses the recursive bijection between binary trees and general trees for generation.
The algorithm generates random binary trees by:
This produces uniformly distributed random trees. The positions come from a Gsl_Compatible_Rng, which gives the numbers of the gsl_rng_mt19937 of GSL: a seed gives the tree that it gave when they came from GSL.
Definition in file random_tree.H.