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>
134 void init(uint64_t n, uint64_t seed = 0) noexcept {
192 std::map<std::pair<uint64_t, uint64_t>, numeric::integer>
m_alpha;
199 std::vector<numeric::integer>
m_fn;
214 uint64_t
forest(uint64_t m, uint64_t q, uint64_t nt) noexcept;
230 const numeric::integer&
237 std::vector<numeric::integer>{
294 std::pair<uint64_t,uint64_t>
365 void init(uint64_t n, uint64_t seed = 0) noexcept {
Uniformly random generation of unlabelled free trees.
Definition: rand_ulab_free_trees.hpp:73
_rand_ulab_free_trees & operator=(const _rand_ulab_free_trees &g) noexcept=default
Copy assignment operator.
const numeric::integer & get_fn(const uint64_t n) noexcept
Computes and returns the value .
void init_fn() noexcept
Initialiases m_fn with values from the OEIS (see ).
Definition: rand_ulab_free_trees.hpp:234
const numeric::integer & get_alpha_mq(const uint64_t m, const uint64_t q) noexcept
Computes and return the value .
~_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:199
graphs::free_tree get_tree() noexcept
Generates uniformly at random a free unlabelled tree.
void init(uint64_t n, uint64_t seed=0) noexcept
Sets the size of the unlabelled trees to generate.
Definition: rand_ulab_free_trees.hpp:134
_rand_ulab_free_trees(_rand_ulab_free_trees &&Gen)=default
Move constructor.
_rand_ulab_free_trees(uint64_t n, uint64_t seed=0) noexcept
Constructor with size of tree and seed for the random number generator.
Definition: rand_ulab_free_trees.hpp:91
_rand_ulab_free_trees() noexcept
Empty constructor.
Definition: rand_ulab_free_trees.hpp:78
uint64_t forest(uint64_t m, uint64_t q, uint64_t nt) noexcept
Generates uniformly at random a forest of m nodes.
std::pair< uint64_t, uint64_t > choose_jd_from_alpha(const uint64_t m, const uint64_t q) noexcept
Chooses uniformly at random a pair , according to some probability.
void bicenter(uint64_t n) noexcept
Generates a tree of n nodes with two centroids.
_rand_ulab_free_trees(const _rand_ulab_free_trees &Gen)=default
Copy constructor.
std::map< std::pair< uint64_t, uint64_t >, numeric::integer > m_alpha
Values .
Definition: rand_ulab_free_trees.hpp:192
void clear() noexcept
Clears the memory used.
Definition: rand_ulab_free_trees.hpp:160
Uniformly random generation of unlabelled rooted trees.
Definition: rand_ulab_rooted_trees.hpp:67
void init(uint64_t n, uint64_t seed=0) noexcept
Sets the size of the unlabelled trees to generate.
Definition: rand_ulab_rooted_trees.hpp:126
void clear() noexcept
Clears the memory used.
Definition: rand_ulab_rooted_trees.hpp:166
Base class for tree generators.
Definition: tree_generator.hpp:123
void init(uint64_t n) noexcept
Initializes the tree generator.
Definition: tree_generator.hpp:159
void clear() noexcept
Clears the memory used by the generator.
Definition: tree_generator.hpp:165
graphs::free_tree get_tree() noexcept
Retrieve the generated tree.
Definition: tree_generator.hpp:195
Uniformly random generation of unlabelled free trees.
Definition: rand_ulab_free_trees.hpp:322
void init(uint64_t n, uint64_t seed=0) noexcept
Initializes the generator with the number of nodes and a seed.
Definition: rand_ulab_free_trees.hpp:365
rand_ulab_free_trees & operator=(const rand_ulab_free_trees &g) noexcept=default
Copy assignment operator.
rand_ulab_free_trees(const rand_ulab_free_trees &Gen)=default
Copy constructor.
rand_ulab_free_trees(uint64_t n, uint64_t seed=0) noexcept
Constructor with size of tree and seed for the random number generator.
Definition: rand_ulab_free_trees.hpp:337
~rand_ulab_free_trees()=default
Default destructor.
void clear() noexcept
Clear the memory used by the generator.
Definition: rand_ulab_free_trees.hpp:371
_rand_ulab_free_trees m_Gen
See _rand_ulab_free_trees.
Definition: rand_ulab_free_trees.hpp:391
rand_ulab_free_trees() noexcept
Empty constructor.
Definition: rand_ulab_free_trees.hpp:327
graphs::free_tree __get_tree() noexcept
Returns an unlabelled free tree chosen uniformly at random.
Definition: rand_ulab_free_trees.hpp:387
graphs::free_tree yield_tree() noexcept
Yields a tree, advancing the generator if necessary.
Definition: rand_ulab_free_trees.hpp:376
rand_ulab_free_trees(rand_ulab_free_trees &&Gen)=default
Move constructor.
Free tree graph class.
Definition: free_tree.hpp:60
Arbitrary precision integer.
Definition: integer.hpp:60
Main namespace of the library.
Definition: basic_types.hpp:50