49#include <lal/graphs/free_tree.hpp>
50#include <lal/generate/rand_ulab_rooted_trees.hpp>
51#include <lal/generate/tree_generator.hpp>
52#include <lal/numeric/integer.hpp>
123 void init(uint32_t seed = 0) noexcept;
158 std::map<std::pair<uint32_t, uint32_t>, numeric::integer>
m_alpha;
165 std::vector<numeric::integer>
m_fn;
180 uint32_t
forest(uint32_t m, uint32_t q, uint32_t nt) noexcept;
196 const numeric::integer&
210 const numeric::integer&
get_fn(const uint32_t n) noexcept;
224 std::pair<uint32_t,uint32_t>
Uniformly random generation of unlabelled free trees.
Definition rand_ulab_free_trees.hpp:73
const numeric::integer & get_alpha_mq(const uint32_t m, const uint32_t q) noexcept
Computes and return the value .
void init_fn() noexcept
Initialiases m_fn with 31 values from the OEIS (see OEIS_A000055).
~_rand_ulab_free_trees()=default
Default destructor.
std::vector< numeric::integer > m_fn
The number of free unlabelled trees.
Definition rand_ulab_free_trees.hpp:165
graphs::free_tree get_tree() noexcept
Generates uniformly at random a free unlabelled tree.
_rand_ulab_free_trees(_rand_ulab_free_trees &&Gen)=default
Move constructor.
uint32_t forest(uint32_t m, uint32_t q, uint32_t nt) noexcept
Generates uniformly at random a forest of m nodes.
_rand_ulab_free_trees(uint32_t n, uint32_t seed=0) noexcept
Constructor with size of tree and seed for the random number generator.
void init(uint32_t seed=0) noexcept
Sets the size of the unlabelled trees to generate.
const numeric::integer & get_fn(const uint32_t n) noexcept
Computes and returns the value .
std::map< std::pair< uint32_t, uint32_t >, numeric::integer > m_alpha
Values .
Definition rand_ulab_free_trees.hpp:158
void clear() noexcept
Clears the memory occupied.
void bicenter(uint32_t n) noexcept
Generates a tree of n nodes with two centroids.
std::pair< uint32_t, uint32_t > choose_jd_from_alpha(const uint32_t m, const uint32_t q) noexcept
Chooses uniformly at random a pair , according to some probability.
Uniformly random generation of unlabelled rooted trees.
Definition rand_ulab_rooted_trees.hpp:67
Base class for tree generators.
Definition tree_generator.hpp:87
Uniformly random generation of unlabelled free trees.
Definition rand_ulab_free_trees.hpp:252
rand_ulab_free_trees(const rand_ulab_free_trees &Gen)=default
Copy constructor.
~rand_ulab_free_trees()=default
Default destructor.
rand_ulab_free_trees(uint32_t n, uint32_t seed=0) noexcept
Constructor with size of tree and seed for the random number generator.
Definition rand_ulab_free_trees.hpp:264
_rand_ulab_free_trees m_Gen
See _rand_ulab_free_trees.
Definition rand_ulab_free_trees.hpp:296
graphs::free_tree __get_tree() noexcept
Returns an unlabelled free tree chosen uniformly at random.
Definition rand_ulab_free_trees.hpp:292
graphs::free_tree yield_tree() noexcept
Yields a tree, advancing the generator if necessary.
Definition rand_ulab_free_trees.hpp:281
rand_ulab_free_trees(rand_ulab_free_trees &&Gen)=default
Move constructor.
Free tree graph class.
Definition free_tree.hpp:59
Main namespace of the library.
Definition definitions.hpp:48