scram::core::pdag
Functions
| Name | |
|---|---|
| template <class T > <br>std::vector< T * > | OrderArguments(Gate * gate)<br>Determines the order of traversal for gate arguments. |
| void | TopologicalOrder(Pdag * graph)<br>Assigns topological ordering to nodes of the PDAG. |
| void | LayeredTopologicalOrder(Pdag * graph)<br>Assigns layered topological ordering to nodes of the PDAG. |
| void | MarkCoherence(Pdag * graph)<br>Marks coherence of the whole graph. |
| template <typename T ,typename... Ts> <br>void | Transform(Pdag * graph, T && unary_op, Ts &&... unary_ops)<br>Applies graph transformations consecutively. |
Functions Documentation
function OrderArguments
template <class T >
std::vector< T * > OrderArguments(
Gate * gate
)Determines the order of traversal for gate arguments.
Parameters:
- gate The host gate parent.
Template Parameters:
- T Type of the arguments.
Return: An ordered, stable list of arguments.
This function does not assign the order of nodes.
function TopologicalOrder
void TopologicalOrder(
Pdag * graph
)Assigns topological ordering to nodes of the PDAG.
Parameters:
- graph The graph to be processed.
Postcondition: The root and descendant node order marks contain the ordering.
The ordering is assigned to the node order marks. The nodes are sorted in descending optimization value. The highest order value belongs to the root.
function LayeredTopologicalOrder
void LayeredTopologicalOrder(
Pdag * graph
)Assigns layered topological ordering to nodes of the PDAG.
Parameters:
- graph The graph to be processed.
Postcondition: The root and descendant node order marks contain the layered ordering.
Nodes at the same layer are assigned the same order value. The ordering is assigned to the node order marks. The highest order value belongs to the root node. The ordering ensures that all dependencies are assigned to lower layers.
function MarkCoherence
void MarkCoherence(
Pdag * graph
)Marks coherence of the whole graph.
Parameters:
- graph The graph to be processed.
Postcondition: Gate traversal marks are dirty.
function Transform
template <typename T ,
typename... Ts>
void Transform(
Pdag * graph,
T && unary_op,
Ts &&... unary_ops
)Applies graph transformations consecutively.
Parameters:
- graph The graph to be transformed.
- unary_op The first operation to be applied.
- unary_ops The rest of transformations to apply.
Updated on 2026-01-09 at 21:59:12 +0000
