45#include <lal/graphs/rooted_tree.hpp>
46#include <lal/linarr/chunking/chunk.hpp>
47#include <lal/detail/linarr/chunking/generic.hpp>
62template <
class arrangement_t>
92 std::size_t chunk_idx = 0;
141 if (p_root <
m_n - 1) {
171 std::size_t chunk_idx = 0;
Implementation of Anderson's algorithm for chunking.
Definition Anderson.hpp:63
void assign_chunk_indices(const node_t r, std::size_t &chunk_idx) noexcept
Assign chunk indices to all vertices of the subtree rooted at r.
Definition Anderson.hpp:116
const uint64_t m_n
Number of vertices of the tree.
Definition generic.hpp:147
const arrangement_t m_arr
Linear arrangement.
Definition generic.hpp:145
void relabel_chunks() noexcept
Relabels the chunks obtained in method assign_chunk_indices.
Definition Anderson.hpp:170
chunks_Anderson(const graphs::rooted_tree &rt, const arrangement_t &arr) noexcept
Constructor.
Definition Anderson.hpp:70
linarr::chunk_sequence m_sequence
The sequence of chunks obtained.
Definition generic.hpp:150
void chunk_input_tree() noexcept
Main method of this class.
Definition Anderson.hpp:82
void set_chunk_index(const node u, const std::size_t i) noexcept
Sets the chunk index of node u to index i.
Definition generic.hpp:104
void make_chunks() noexcept
Actually builds the sequence of chunks.
Definition Anderson.hpp:195
void set_parent_chunk(linarr::chunk &c) noexcept
Set the parent node of a chunks.
Definition generic.hpp:109
linarr::chunk & last_chunk() noexcept
Returns a reference to the last chunk in the sentence.
Definition generic.hpp:95
std::size_t node_to_chunk(const node u) const noexcept
Returns the chunk index of node u.
Definition generic.hpp:100
const graphs::rooted_tree & m_rt
Input rooted tree.
Definition generic.hpp:143
bool can_be_added(const node r, const node u) const noexcept
Can node u be added to the same chunk as r.
Definition Anderson.hpp:107
Basic algorithms existent in every definition of chunking.
Definition generic.hpp:61
const uint64_t m_n
Number of vertices of the tree.
Definition generic.hpp:147
const arrangement_t m_arr
Linear arrangement.
Definition generic.hpp:145
linarr::chunk_sequence m_sequence
The sequence of chunks obtained.
Definition generic.hpp:150
void set_chunk_index(const node u, const std::size_t i) noexcept
Sets the chunk index of node u to index i.
Definition generic.hpp:104
void set_parent_chunk(linarr::chunk &c) noexcept
Set the parent node of a chunks.
Definition generic.hpp:109
linarr::chunk & last_chunk() noexcept
Returns a reference to the last chunk in the sentence.
Definition generic.hpp:95
std::size_t node_to_chunk(const node u) const noexcept
Returns the chunk index of node u.
Definition generic.hpp:100
const graphs::rooted_tree & m_rt
Input rooted tree.
Definition generic.hpp:143
uint64_t get_out_degree(const node u) const noexcept
Returns the out-degree of a node.
Definition directed_graph.hpp:420
const neighbourhood & get_out_neighbors(const node u) const noexcept
Returns the out-neighbors of node u.
Definition directed_graph.hpp:390
bool has_edge(const node u, const node v) const noexcept
Returns true if the edge exists in the graph.
uint64_t get_num_nodes() const noexcept
Returns the number of ndoes.
Definition graph.hpp:207
Rooted tree graph class.
Definition rooted_tree.hpp:109
node get_root() const noexcept
Return the root of this tree.
Definition rooted_tree.hpp:637
void push_chunk() noexcept
Adds a new chunk to the collection.
Definition chunk_sequence.hpp:155
void init(const std::size_t n) noexcept
Initializes this chunk sequence.
Definition chunk_sequence.hpp:121
Definition of a chunk.
Definition chunk.hpp:64
void set_root_node(const node u) noexcept
Sets the root node of this chunk.
Definition chunk.hpp:114
void add_node(const node u) noexcept
Adds a new node to this chunk.
Definition chunk.hpp:78
Main namespace of the library.
Definition basic_types.hpp:48
uint64_t node
Node type. See Node / Vertex page for further details.
Definition basic_types.hpp:51
Typesafe node type.
Definition basic_types.hpp:70
Typesafe position type.
Definition basic_types.hpp:244