Operation
Types
ComputableDAGs.AppliedOperation — Type
AppliedOperationAn abstract base class for already applied operations. An applied operation can be reversed iff it is the last applied operation on the DAG. Every applied operation stores a Diff from when it was initially applied to be able to revert the operation.
See also: revert_operation!.
ComputableDAGs.NodeReduction — Type
NodeReduction <: OperationThe NodeReduction operation. Represents the reduction of two or more nodes with one another. Only one of the input nodes is kept, while all others are deleted and their parents are accumulated in the kept node's parents instead.
After the node reduction is applied, the graph has length(nr.input) - 1 fewer nodes.
Requirements for successful application
A vector of nodes can be reduced if:
- All nodes are in the graph.
- All nodes have the same task type.
- All nodes have the same set of children.
See also: can_reduce
ComputableDAGs.NodeSplit — Type
NodeSplit <: OperationThe NodeSplit operation. Represents the split of its input node into one node for each of its parents. It is the reverse operation to the NodeReduction.
Requirements for successful application
A node can be split if:
- It is in the graph.
- It has at least 2 parents.
See also: can_split
ComputableDAGs.Operation — Type
OperationAn abstract base class for operations. An operation can be applied to a DAG, changing its nodes and edges.
Possible operations on a DAG can be retrieved using operations.
See also: push_operation!, pop_operation!
Find
ComputableDAGs.generate_operations — Method
generate_operations(dag::DAG)Generate all possible operations on the graph. Used initially when the graph is freshly assembled or parsed. Uses multithreading for speedup.
Safely inserts all the found operations into the graph and its nodes.
sourceComputableDAGs.nr_insertion! — Method
nr_insertion!(dag::DAG, operations::PossibleOperations, node_reductions::Vector{Vector{NodeReduction}})Insert the node reductions into the graph and the nodes' caches. Employs multithreading for speedup.
sourceComputableDAGs.ns_insertion! — Method
ns_insertion!(operations::PossibleOperations, node_splits::Vector{Vector{NodeSplits}})Insert the node splits into the graph and the nodes' caches. Employs multithreading for speedup.
sourceApply
ComputableDAGs.apply_all! — Method
ComputableDAGs.apply_operation! — Method
apply_operation!(dag::DAG, operation::NodeReduction)Apply the given NodeReduction to the graph. Generic wrapper around node_reduction!.
Return an AppliedNodeReduction object generated from the graph's Diff.
ComputableDAGs.apply_operation! — Method
apply_operation!(dag::DAG, operation::NodeSplit)Apply the given NodeSplit to the graph. Generic wrapper around node_split!.
Return an AppliedNodeSplit object generated from the graph's Diff.
ComputableDAGs.apply_operation! — Method
apply_operation!(dag::DAG, operation::Operation)Fallback implementation of apply_operation! for unimplemented operation types, throwing an error.
sourceComputableDAGs.node_reduction! — Method
node_reduction!(dag::DAG, nodes::Vector{Node})Reduce the given nodes together into one node, return the applied difference to the graph.
For details see NodeReduction.
ComputableDAGs.node_split! — Method
ComputableDAGs.revert_diff! — Method
revert_diff!(dag::DAG, diff::Diff)Revert the given diff on the graph. Used to revert the individual AppliedOperations with revert_operation!.
ComputableDAGs.revert_operation! — Method
revert_operation!(dag::DAG, operation::AppliedNodeReduction)Revert the applied node reduction on the graph. Return the original NodeReduction operation.
ComputableDAGs.revert_operation! — Method
ComputableDAGs.revert_operation! — Method
revert_operation!(dag::DAG, operation::AppliedOperation)Fallback implementation of operation reversion for unimplemented operation types, throwing an error.
sourceGet
ComputableDAGs.operations — Method
Clean
ComputableDAGs.clean_node! — Method
clean_node!(dag::DAG, node_id::UUID)Sort this node's parent and child sets, then find reductions and splits involving it. Needs to be called after the node was changed in some way.
sourceComputableDAGs.find_reductions! — Method
find_reductions!(dag::DAG, node::Node)Find node reductions involving the given node. The function pushes the found NodeReduction (if any) everywhere it needs to be and returns nothing.
ComputableDAGs.find_splits! — Method
Utility
Base.delete! — Method
delete!(operations::PossibleOperations, op::NodeReduction)Delete the given node reduction from the possible operations.
sourceBase.delete! — Method
delete!(operations::PossibleOperations, op::NodeSplit)Delete the given node split from the possible operations.
sourceBase.isempty — Method
isempty(operations::PossibleOperations)Return whether operations is empty, i.e. all of its fields are empty.
Base.length — Method
length(operations::PossibleOperations)Return a named tuple with the number of each of the operation types as a named tuple. The fields are named the same as the PossibleOperations'.
ComputableDAGs.can_reduce — Method
can_reduce(n1::Node, n2::Node)Return whether the given two nodes can be reduced. See NodeReduction for the requirements.