sdf/base/algo/graph.cc File Reference
#include "graph.h"
Functions | |
void | sdfToGraph (SDFgraph *g, v_uint &nodeId, v_uint &actorId, vector< v_uint > &graph, const bool transpose) |
void | sdfComponentToGraph (SDFgraph *g, SDFgraphComponent &component, v_uint &nodeId, v_uint &actorId, vector< v_uint > &graph, const bool transpose) |
Function Documentation
void sdfComponentToGraph | ( | SDFgraph * | g, | |
SDFgraphComponent & | component, | |||
v_uint & | nodeId, | |||
v_uint & | actorId, | |||
vector< v_uint > & | graph, | |||
const bool | transpose | |||
) |
sdfToGraph () The function converts a component S of an SDF graph G(A,C) to an graph G'(N,E). For each actor a in S (i.e. also a in A), a node u in N is present in the graph G'. The actor a and node n are related to each other via the arrays nodeId (u = nodeId[a]) and actorId (a = actorId[u]). For each channel (a,b) in C an edge (u,v) in E is created in the graph (graph[u][v] = graph[nodeId[a]][nodeId[b]] = 1). If no edge exists between two actors a and b, the corresponding graph[u][v] = 0. Note: that in multiple channels in the SDF graph are translated into a single edge in the graph.
References a, actorInComponent(), SDFgraph::channelsBegin(), SDFgraph::channelsEnd(), SDFchannel::getDstActor(), SDFcomponent::getId(), SDFchannel::getSrcActor(), SDFgraph::nrActors(), and v.
Referenced by findSimpleCycle(), findSimpleCycles(), and mcmSimpleCycles().
void sdfToGraph | ( | SDFgraph * | g, | |
v_uint & | nodeId, | |||
v_uint & | actorId, | |||
vector< v_uint > & | graph, | |||
const bool | transpose | |||
) |
sdfToGraph () The function converts a SDF graph G(A,C) to an graph G'(N,E). For each actor a in A, a node u in N is present in the graph G'. The actor a and node n are related to each other via the arrays nodeId (u = nodeId[a]) and actorId (a = actorId[u]). For each channel (a,b) in C an edge (u,v) in E is created in the graph (graph[u][v] = graph[nodeId[a]][nodeId[b]] = 1). If no edge exists between two actors a and b, the corresponding graph[u][v] = 0. Note: that in multiple channels in the SDF graph are translated into a single edge in the graph.
References a, SDFgraph::actorsBegin(), SDFgraph::actorsEnd(), SDFgraph::channelsBegin(), SDFgraph::channelsEnd(), SDFchannel::getDstActor(), SDFcomponent::getId(), SDFchannel::getSrcActor(), SDFgraph::nrActors(), and v.