45#include <lal/graphs/free_tree.hpp>
46#include <lal/graphs/rooted_tree.hpp>
121 std::enable_if_t< std::is_base_of_v<graphs::tree, tree_t>,
bool > =
true
126 static constexpr bool is_free = std::is_base_of_v<graphs::free_tree, tree_t>;
129 using generated_tree_t = tree_t;
160 void init(const uint64_t n) noexcept {
205 t.calculate_tree_type();
216 t.calculate_size_subtrees();
Base class for tree generators.
Definition tree_generator.hpp:123
bool m_normalize_tree
Normalize the generated tree.
Definition tree_generator.hpp:303
void set_normalize_tree(const bool v) noexcept
Should trees be normalized?
Definition tree_generator.hpp:267
uint64_t m_n
Number of vertices.
Definition tree_generator.hpp:300
virtual tree_t yield_tree() noexcept=0
Yields a tree, advancing the generator if necessary.
void clear() noexcept
Clears the memory used by the generator.
Definition tree_generator.hpp:166
_tree_generator() noexcept=default
Default constructor.
void deactivate_all_postprocessing_actions() noexcept
Deactivates all postprocessing actions.
Definition tree_generator.hpp:255
static constexpr bool is_free
Helpful Boolean value to compact 'if constexpr' expressions.
Definition tree_generator.hpp:126
void set_calculate_size_subtrees(const bool v) noexcept
Should the size of the subtrees be calculated?
Definition tree_generator.hpp:275
void init(const uint64_t n) noexcept
Initializes the tree generator.
Definition tree_generator.hpp:160
_tree_generator(_tree_generator &&Gen) noexcept=default
Default move constructor.
_tree_generator & operator=(const _tree_generator &Gen)=default
Default copy assignment operator.
void activate_all_postprocessing_actions() noexcept
Activates all postprocessing actions.
Definition tree_generator.hpp:243
_tree_generator(const _tree_generator &Gen) noexcept=default
Default copy constructor.
virtual ~_tree_generator() noexcept=default
Default destructor.
void set_calculate_tree_type(const bool v) noexcept
Should the tree be classified into types?
Definition tree_generator.hpp:285
bool m_calculate_size_subtrees
Calculate the size of the subtrees of the generated rooted tree.
Definition tree_generator.hpp:305
virtual tree_t __get_tree() noexcept=0
Retrieve the generated tree.
tree_t get_tree() noexcept
Retrieve the generated tree.
Definition tree_generator.hpp:196
bool m_calculate_tree_type
Calculate the type of tree of the generated tree.
Definition tree_generator.hpp:307
Main namespace of the library.
Definition basic_types.hpp:48