Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::dsp::graph::GraphPruner Class Reference

Helper class for pruning a graph. More...

#include <src/dsp/graph_pruner.h>

Static Public Member Functions

static bool prune_graph_to_terminals (Graph &graph, const std::vector< std::reference_wrapper< GraphNode > > &terminal_nodes)
 Prunes an existing graph to only include nodes that lead to specified terminals.

Detailed Description

Helper class for pruning a graph.

Definition at line 15 of file graph_pruner.h.

Member Function Documentation

◆ prune_graph_to_terminals()

bool zrythm::dsp::graph::GraphPruner::prune_graph_to_terminals ( Graph & graph,
const std::vector< std::reference_wrapper< GraphNode > > & terminal_nodes )
static

Prunes an existing graph to only include nodes that lead to specified terminals.

This is a utility method that can be called on any graph after it's built. It performs a backward traversal from the specified terminal nodes and removes all nodes that are not in the dependency chain.

Parameters
graphThe graph to prune (will be modified in-place)
terminal_nodesThe terminal nodes to preserve in pruned graph
Returns
Whether prune operation was successful

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