sdf/base/algo/components.cc File Reference
#include "components.h"
#include "dfs.h"
Functions | |
static void | treeVisitChildren (SDFgraph *g, SDFactor **pi, SDFactor *u, SDFgraphComponent &comp) |
static SDFgraphComponents | getComponents (SDFgraph *g, SDFactor **pi) |
SDFgraphComponents | stronglyConnectedComponents (SDFgraph *g) |
bool | actorInComponent (SDFactor *a, SDFgraphComponent &component) |
bool | isStronglyConnectedGraph (SDFgraph *g) |
SDFgraph * | componentToSDFgraph (SDFgraphComponent &component) |
Function Documentation
bool actorInComponent | ( | SDFactor * | a, | |
SDFgraphComponent & | component | |||
) |
actorInComponent () The function check wether an actor is in a component. If so, the function returns true. Else it returns false.
References SDFcomponent::getId().
SDFgraph* componentToSDFgraph | ( | SDFgraphComponent & | component | ) |
componentToSDFgraph () The function returns an SDF graph containing all actors and channels inside the component.
References a, actorInComponent(), c, SDFgraph::clone(), g, SDFchannel::getDstActor(), SDFchannel::getDstPort(), SDFcomponent::getId(), SDFcomponent::getName(), SDFcomponent::getParent(), SDFchannel::getSrcActor(), SDFchannel::getSrcPort(), SDFactor::removePort(), and v.
Referenced by SDFstateSpaceThroughputAnalysis::analyze(), and distributeInitialTokensInComponent().
static SDFgraphComponents getComponents | ( | SDFgraph * | g, | |
SDFactor ** | pi | |||
) | [static] |
getComponents () The function determines the strongly connected components in the graph. To do this, it performs depth-first walk on the forest given by 'pi'.
References SDFgraph::getActor(), SDFgraph::nrActors(), and treeVisitChildren().
Referenced by stronglyConnectedComponents().
bool isStronglyConnectedGraph | ( | SDFgraph * | g | ) |
isStronglyConnectedGraph () The function checks that the graph is a strongly connnected component.
References c, and stronglyConnectedComponents().
SDFgraphComponents stronglyConnectedComponents | ( | SDFgraph * | g | ) |
stronglyConnectedComponents () The function determines the strongly connected components in the graph.
References ASSERT, dfs(), getComponents(), SDFgraph::nrActors(), and pi.
static void treeVisitChildren | ( | SDFgraph * | g, | |
SDFactor ** | pi, | |||
SDFactor * | u, | |||
SDFgraphComponent & | comp | |||
) | [static] |
treeVisitChildren () The function visits all children of the actor 'u'. The parent-child relation is given via the vector 'pi'. Each child is added to the component 'comp'.
References SDFgraph::getActor(), SDFcomponent::getId(), SDFgraph::nrActors(), and v.
Referenced by getComponents().