78 inline std::set <DepNode *, compNode> *
DepList ()
const
82 bool depends (
int xi,
bool =
false,
83 std::set <DepNode *, compNode> *already_visited = NULL)
const;
89 void print (
int = 0,
bool descend =
false)
const;
109 {
return (n0 -> Index () < n1 -> Index ());}
132 for (std::set <DepNode *, compNode>::iterator i =
vertices_.begin ();
155 bool depends (
int,
int,
bool =
false);
161 void print (
bool descend =
false);
int counter_
counter to assign numbering to all nodes
std::set< DepNode *, compNode > vertices_
set of variable nodes
enum dep_color color_
color used in DFS for checking cycles
int & Counter()
node index counter
dep_color
color used in DFS for checking cycles
bool checkCycles()
check for dependence cycles in graph
void erase(exprVar *)
delete element
int order_
order in which this variable should be updated, evaluated, etc.
enum dep_color & color()
return or set color of a node
void createOrder(DepGraph *)
assign numbering to all nodes of graph
vertex of a dependence graph.
void createOrder()
assign numbering to all nodes of graph
DepNode * lookup(int index)
search for node in vertex set
std::set< DepNode *, compNode > * DepList() const
return all variables it depends on
void insert(exprVar *)
insert new variable if new
structure for comparing nodes in the dependence graph
std::set< DepNode *, compNode > * depList()
index nodes on which this one depends (forward star in dependence graph)
bool depends(int, int, bool=false)
does w depend on x?
void replaceIndex(DepNode *oldVarNode, DepNode *newVarNode)
replace the index of a variable with another in the entire graph.
void print(int=0, bool descend=false) const
debugging procedure
std::set< DepNode *, compNode > & Vertices()
return vertex set
bool depends(int xi, bool=false, std::set< DepNode *, compNode > *already_visited=NULL) const
does this variable depend on variable with index xi?
int index_
index of variable associated with node
int Index() const
return index of this variable
bool operator()(const DepNode *n0, const DepNode *n1) const
structure for comparing nodes
int Order() const
return index of this variable
void replaceIndex(int oldVar, int newVar)
replace, throughout the whole graph, the index of a variable with another in the entire graph...
std::set< DepNode *, compNode > * depList_
index nodes on which this one depends (forward star in dependence graph)
DepNode(int ind)
fictitious constructor: only fill in index (such object is used in find() and then discarded) ...
void print(bool descend=false)
debugging procedure