Loading...
Searching...
No Matches
VdfSparseInputPathFinder Class Reference

A class used for fast sparse traversals of VdfNetworks in the output-to-input direction when the goal is to find all possible paths from an output to a node. More...

#include <sparseInputPathFinder.h>

Public Types

typedef bool(* InputCallback) (const VdfInput &input)
 Callback to determine if input is a relevant path.
 

Static Public Member Functions

static VDF_API void Traverse (const VdfMaskedOutput &start, const VdfMaskedOutput &target, InputCallback inputCallback, std::vector< VdfConnectionConstVector > *paths)
 Traverses the network in the input direction sparsely, starting from start trying to find all possible paths into target.
 
static VDF_API void FindAllCyclePaths (const VdfMaskedOutput &start, InputCallback inputCallback, std::vector< VdfConnectionConstVector > *paths)
 Convenience method for a common usage of Traverse() where start == target.
 

Detailed Description

A class used for fast sparse traversals of VdfNetworks in the output-to-input direction when the goal is to find all possible paths from an output to a node.

A sparse traversal takes affects masks into account and avoids traversing nodes that don't have an affect on the outputs requested for the traversal. This is most often useful for dependency traversals.

Note that the main point here is to find all possible paths whereas the VdfSparseInputTraverser reports only the first path it finds.

Definition at line 45 of file sparseInputPathFinder.h.

Member Typedef Documentation

◆ InputCallback

typedef bool(* InputCallback) (const VdfInput &input)

Callback to determine if input is a relevant path.

Definition at line 51 of file sparseInputPathFinder.h.

Member Function Documentation

◆ FindAllCyclePaths()

static VDF_API void FindAllCyclePaths ( const VdfMaskedOutput start,
InputCallback  inputCallback,
std::vector< VdfConnectionConstVector > *  paths 
)
static

Convenience method for a common usage of Traverse() where start == target.

Finds all the paths in a cycle from start back to start.

Note, as in Traverse, the network must be fully connected before making this call.

◆ Traverse()

static VDF_API void Traverse ( const VdfMaskedOutput start,
const VdfMaskedOutput target,
InputCallback  inputCallback,
std::vector< VdfConnectionConstVector > *  paths 
)
static

Traverses the network in the input direction sparsely, starting from start trying to find all possible paths into target.

Will populate paths with the results.

Uses inputCallback in order to determine which paths are relevant and should be reported. The default implementation (used when inputCallback is NULL) will treat no path as relevant. This makes the VdfSparseInputPathFinder behave the same way as the sparse input traverser. Only when inputCallback returns true for a specific input a path will treated as a seperate path.


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