LAL: Linear Arrangement Library 24.10.00
A library focused on algorithms on linear arrangements of graphs.
Loading...
Searching...
No Matches
lal::linarr::chunk Class Reference

Definition of a chunk. More...

#include <chunk.hpp>

Public Types

typedef std::vector< node >::const_iterator const_iterator
 Useful typedef for constant iterators.
 
typedef std::vector< node >::iterator iterator
 Useful typedef for non-constant iterators.
 

Public Member Functions

void add_node (const node u) noexcept
 Adds a new node to this chunk.
 
void unset_parent_node () noexcept
 Unsets the parent node of this chunk.
 
void set_parent_node (const node u) noexcept
 Sets the parent node of this chunk.
 
void unset_root_node () noexcept
 Unsets the root node of this chunk.
 
void set_root_node (const node u) noexcept
 Sets the root node of this chunk.
 
bool has_parent_node () const noexcept
 Does this chunk have a parent node?
 
node get_parent_node () const noexcept
 Retrieve the parent node of this chunk.
 
bool has_root_node () const noexcept
 Does this chunk have a parent node?
 
node get_root_node () const noexcept
 Retrieve the root node of this chunk.
 
const_iterator begin () const noexcept
 A pointer to the beginning of the node sequence.
 
iterator begin () noexcept
 A pointer to the beginning of the node sequence.
 
const_iterator end () const noexcept
 A pointer to the ending of the node sequence.
 
iterator end () noexcept
 A pointer to the ending of the node sequence.
 
const std::vector< node > & get_nodes () const noexcept
 Collection of nodes of this chunk.
 

Private Attributes

std::vector< nodem_nodes
 Collection of nodes in this chunk.
 
std::optional< nodem_parent
 The parent vertex of this chunk.
 
std::optional< nodem_root
 The root vertex of this chunk.
 

Detailed Description

Definition of a chunk.

A chunk is a collection of vertices with a parent node. This parent node is relative to the syntactic dependency tree this chunks is part of.

Member Function Documentation

◆ add_node()

void lal::linarr::chunk::add_node ( const node u)
inlinenoexcept

Adds a new node to this chunk.

Parameters
uNode to be added.

◆ get_nodes()

const std::vector< node > & lal::linarr::chunk::get_nodes ( ) const
inlinenodiscardnoexcept

Collection of nodes of this chunk.

See member m_nodes.

Returns
A constant reference to the collection of nodes.

◆ get_parent_node()

node lal::linarr::chunk::get_parent_node ( ) const
inlinenodiscardnoexcept

Retrieve the parent node of this chunk.

Returns
The parent node if it exists.
Precondition
Method has_parent_node must evaluate to true.

◆ get_root_node()

node lal::linarr::chunk::get_root_node ( ) const
inlinenodiscardnoexcept

Retrieve the root node of this chunk.

Returns
The root node if it exists.
Precondition
Method has_root_node must evaluate to true.

◆ set_parent_node()

void lal::linarr::chunk::set_parent_node ( const node u)
inlinenoexcept

Sets the parent node of this chunk.

Parameters
uNode parent of this chunk.
Postcondition
After calling this, method has_parent_node returns true.

◆ set_root_node()

void lal::linarr::chunk::set_root_node ( const node u)
inlinenoexcept

Sets the root node of this chunk.

Parameters
uRoot parent of this chunk.
Postcondition
After calling this, method has_root_node returns true.

◆ unset_parent_node()

void lal::linarr::chunk::unset_parent_node ( )
inlinenoexcept

Unsets the parent node of this chunk.

Postcondition
After calling this, method has_parent_node returns false.

◆ unset_root_node()

void lal::linarr::chunk::unset_root_node ( )
inlinenoexcept

Unsets the root node of this chunk.

Postcondition
After calling this, method has_root_node returns false.

The documentation for this class was generated from the following file: