Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Build_Spanning_Tree< GT > Class Template Reference

Build a spanning tree from an array of arcs. More...

#include <tpl_spanning_tree.H>

Public Member Functions

GT operator() (const DynArray< typename GT::Arc * > &arcs) const
 Construct spanning tree from array of arc pointers.
 
GT operator() (const DynArray< typename GT::Arc * > *arcs) const
 Construct spanning tree from pointer to array of arc pointers.
 

Detailed Description

template<class GT>
class Aleph::Build_Spanning_Tree< GT >

Build a spanning tree from an array of arcs.

This class constructs a spanning tree graph from an array of arcs that were previously computed by another algorithm (e.g., Kruskal, Prim).

Usage example:

// ... populate mst_arcs from MST algorithm ...
Build a spanning tree from an array of arcs.
DynList< T > maps(const C &c, Op op)
Classic map operation.
Template Parameters
GTGraph type.

Definition at line 465 of file tpl_spanning_tree.H.

Member Function Documentation

◆ operator()() [1/2]

template<class GT >
GT Aleph::Build_Spanning_Tree< GT >::operator() ( const DynArray< typename GT::Arc * > &  arcs) const
inline

Construct spanning tree from array of arc pointers.

Parameters
[in]arcsArray of arc pointers that form the spanning tree.
Returns
A new graph containing only the nodes and arcs from the spanning tree.
Exceptions
std::bad_allocIf memory allocation fails.

Definition at line 478 of file tpl_spanning_tree.H.

References arcs, and Aleph::maps().

◆ operator()() [2/2]

template<class GT >
GT Aleph::Build_Spanning_Tree< GT >::operator() ( const DynArray< typename GT::Arc * > *  arcs) const
inline

Construct spanning tree from pointer to array of arc pointers.

Parameters
[in]arcsPointer to array of arc pointers that form the spanning tree.
Returns
A new graph containing only the nodes and arcs from the spanning tree.
Exceptions
std::bad_allocIf memory allocation fails.
std::invalid_argumentIf arcs is nullptr.

Definition at line 493 of file tpl_spanning_tree.H.

References ah_invalid_argument_if, arcs, and Aleph::maps().


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