PandA-2024.02
|
General class used to describe a graph in PandA. More...
#include <graph.hpp>
Public Member Functions | |
virtual | ~graph ()=default |
Destructor. More... | |
bool | is_in_subset (const boost::graph_traits< graph >::vertex_descriptor v) const |
return true in case the vertex is a vertex of the subgraph. More... | |
int | GetSelector () const |
Return the selector of this graph. More... | |
int | GetSelector (const edge_descriptor e) const |
Return the selectors associated with an edge. More... | |
int | GetSelector (const boost::graph_traits< graphs_collection >::vertex_descriptor source, const boost::graph_traits< graphs_collection >::vertex_descriptor target) const |
Return the selectors associated with an edge. More... | |
void | GetStronglyConnectedComponents (std::map< size_t, UnorderedSetStdStable< boost::graph_traits< graphs_collection >::vertex_descriptor >> &strongly_connected_components) const |
Compute the strongly connected components of the graph. More... | |
void | BreadthFirstSearch (const boost::graph_traits< graphs_collection >::vertex_descriptor node, boost::bfs_visitor<> *vis) const |
Compute the breadth first search. More... | |
void | ReverseTopologicalSort (std::deque< boost::graph_traits< graphs_collection >::vertex_descriptor > &sorted_vertices) const |
Compute the reverse topological order of the graph. More... | |
void | TopologicalSort (std::list< boost::graph_traits< graphs_collection >::vertex_descriptor > &sorted_vertices) const |
Compute the topological order of the graph. More... | |
bool | IsReachable (const boost::graph_traits< graphs_collection >::vertex_descriptor x, const boost::graph_traits< graphs_collection >::vertex_descriptor y) const |
Compute if vertex y is reachable from x. More... | |
NodeInfoRef | GetNodeInfo (typename boost::graph_traits< graphs_collection >::vertex_descriptor node) |
FIXME: this method should become protected and called by equivalent method in subclasses Get the node property. More... | |
GraphInfoRef | GetGraphInfo () |
FIXME: this method should become protected and called by equivalent method in subclasses Get the graph property. More... | |
const GraphInfoConstRef | CGetGraphInfo () const |
FIXME: this method should become protected and called by equivalent method in subclasses Get the graph property. More... | |
template<typename VertexWriterTemplate , typename EdgeWriterTemplate > | |
void | InternalWriteDot (const std::string &file_name, const VertexWriterConstRef vertex_writer, const EdgeWriterConstRef edge_writer) const |
Print the graph in dot format FIXME: this method should become protected and called by WriteDot. More... | |
bool | ExistsEdge (const boost::graph_traits< graphs_collection >::vertex_descriptor source, const boost::graph_traits< graphs_collection >::vertex_descriptor target) const |
Check if an edge exists. More... | |
boost::graph_traits< graphs_collection >::edge_descriptor | CGetEdge (const boost::graph_traits< graphs_collection >::vertex_descriptor source, const boost::graph_traits< graphs_collection >::vertex_descriptor target) const |
Returns the edge connecting two vertices; throw error if it does not exist. More... | |
graph constructors | |
graph (graphs_collection *g, const int _selector) | |
Standard constructor. More... | |
graph (graphs_collection *g, const int _selector, const CustomUnorderedSet< boost::graph_traits< graphs_collection >::vertex_descriptor > &vertices) | |
Sub-graph constructor. More... | |
Protected Member Functions | |
const NodeInfoConstRef | CGetNodeInfo (typename boost::graph_traits< graphs_collection >::vertex_descriptor node) const |
Get the node property. More... | |
EdgeInfoRef | GetEdgeInfo (typename boost::graph_traits< graphs_collection >::vertex_descriptor source, typename boost::graph_traits< graphs_collection >::vertex_descriptor target) |
Get the edge property. More... | |
const EdgeInfoConstRef | CGetEdgeInfo (typename boost::graph_traits< graphs_collection >::vertex_descriptor source, typename boost::graph_traits< graphs_collection >::vertex_descriptor target) const |
Get the edge property. More... | |
EdgeInfoRef | GetEdgeInfo (typename boost::graph_traits< graphs_collection >::edge_descriptor edge) const |
Get the edge property. More... | |
EdgeInfoConstRef | CGetEdgeInfo (typename boost::graph_traits< graphs_collection >::edge_descriptor edge) const |
Get the edge property. More... | |
template<typename VertexWriterTemplate , typename EdgeWriterTemplate , typename GraphWriterTemplate > | |
void | InternalWriteDot (const std::string &file_name, const VertexWriterConstRef vertex_writer, const EdgeWriterConstRef edge_writer, const GraphWriterConstRef graph_writer) const |
Print the graph in dot format. More... | |
Protected Attributes | |
graphs_collection * | collection |
The graph collection. More... | |
const int | selector |
selector More... | |
Friends | |
boost::graph_traits< graph >::vertex_descriptor | VERTEX (const boost::graph_traits< graph >::vertices_size_type, const graph &) |
this function can access the bulk graph More... | |
|
inline |
|
inline |
|
virtualdefault |
Destructor.
|
inline |
|
inline |
Returns the edge connecting two vertices; throw error if it does not exist.
source | is the source of the edge to be returned |
target | is the target of the edge to be returned |
Definition at line 1106 of file graph.hpp.
References THROW_ASSERT, and test_panda::type.
|
inlineprotected |
Get the edge property.
source | is the source vertex of the edge |
target | is the target vertex of the edge |
Definition at line 811 of file graph.hpp.
References THROW_ASSERT.
Referenced by BBGraph::CGetBBEdgeInfo(), CdfcGraph::CGetCdfcEdgeInfo(), CallGraph::CGetFunctionEdgeInfo(), OpGraph::CGetOpEdgeInfo(), and StateTransitionGraph::CGetTransitionInfo().
|
inlineprotected |
Get the edge property.
edge | is the edge whose property is asked |
Definition at line 838 of file graph.hpp.
References THROW_ASSERT.
|
inline |
FIXME: this method should become protected and called by equivalent method in subclasses Get the graph property.
Definition at line 1062 of file graph.hpp.
References boost_CGetOpGraph_property.
Referenced by BBGraph::CGetBBGraphInfo(), CallGraph::CGetCallGraphInfo(), DesignFlowGraph::CGetDesignFlowGraphInfo(), StateTransitionGraph::CGetStateTransitionGraphInfo(), and CdfcGraph::WriteDot().
|
inlineprotected |
Get the node property.
node | is the node whose property is asked |
Definition at line 781 of file graph.hpp.
References THROW_ASSERT.
Referenced by BBGraph::CGetBBNodeInfo(), DesignFlowGraph::CGetDesignFlowStepInfo(), OpGraph::CGetOpNodeInfo(), and StateTransitionGraph::CGetStateInfo().
|
inline |
Check if an edge exists.
source | is the source vertex |
target | is the target vertex |
Definition at line 1090 of file graph.hpp.
Referenced by SDCScheduling::AddDelayConstraints(), and SDCScheduling::InternalExec().
|
inlineprotected |
Get the edge property.
source | is the source vertex of the edge |
target | is the target vertex of the edge |
Definition at line 794 of file graph.hpp.
References THROW_ASSERT.
Referenced by BBGraph::GetBBEdgeInfo(), and StateTransitionGraph::GetTransitionInfo().
|
inlineprotected |
Get the edge property.
edge | is the edge whose property is asked |
Definition at line 826 of file graph.hpp.
References THROW_ASSERT.
|
inline |
FIXME: this method should become protected and called by equivalent method in subclasses Get the graph property.
Definition at line 1051 of file graph.hpp.
References boost_CGetOpGraph_property.
Referenced by structural_manager::build_graph(), structural_manager::get_PI(), BBGraph::GetBBGraphInfo(), CallGraph::GetCallGraphInfo(), DesignFlowGraph::GetDesignFlowGraphInfo(), and StateTransitionGraph::GetStateTransitionGraphInfo().
|
inline |
FIXME: this method should become protected and called by equivalent method in subclasses Get the node property.
node | is the vertex whose property is asked |
Definition at line 1039 of file graph.hpp.
References THROW_ASSERT.
Referenced by BBGraph::GetBBNodeInfo(), DesignFlowGraph::GetDesignFlowStepInfo(), OpGraph::GetOpNodeInfo(), and StateTransitionGraph::GetStateInfo().
|
inline |
Return the selector of this graph.
Definition at line 922 of file graph.hpp.
Referenced by SDCScheduling::AddDelayConstraints(), OpGraph::GetSrcVertices(), AddBbEcfgEdges::InternalExec(), SDCScheduling::InternalExec(), cdfc_module_binding::InternalExec(), OpEdgeWriter::operator()(), BBEdgeWriter::operator()(), cg_edge_writer::operator()(), FunctionEdgeWriter::operator()(), DesignFlowEdgeWriter::operator()(), TransitionWriter::operator()(), cdfc_module_binding::update_slack_starting_time(), EdgeCWriter::writeRoutineInstructions_rec(), and CWriter::writeRoutineInstructions_rec().
|
inline |
Return the selectors associated with an edge.
e | is the edge |
Definition at line 932 of file graph.hpp.
References graphs_collection::GetSelector().
|
inline |
Return the selectors associated with an edge.
source | is the source of an edge |
target | is the target of an edge |
Definition at line 943 of file graph.hpp.
References graphs_collection::GetSelector().
|
inline |
Compute the strongly connected components of the graph.
strongly_connected_components | is where the set of vertices which compose the different strongly connected components will be stored; key is the index of the strongly connected component |
Definition at line 957 of file graph.hpp.
Referenced by FunctionCallOpt::detect_loops().
|
inlineprotected |
Print the graph in dot format.
file_name | is the name of the file to be created |
node_writer | is the functor used to print the node labels |
edge_writer | is the functor used to print the edge labels |
graph_writer | is the functor used to print the graph properties |
|
inline |
Print the graph in dot format FIXME: this method should become protected and called by WriteDot.
file_name | is the name of the file to be created |
node_writer | is the functor used to print the node labels |
edge_writer | is the functor used to print the edge labels |
|
inline |
Compute if vertex y is reachable from x.
Definition at line 1004 of file graph.hpp.
References lenet_tvm::target.
Referenced by rebuild_initialization2::look_for_ROMs().
|
inline |
|
inline |
Compute the topological order of the graph.
sorted_vertices | is where results will be store |
Definition at line 996 of file graph.hpp.
Referenced by CallGraphManager::AddCallPoint(), SDCScheduling::AddDelayConstraints(), Bit_Value::Initialize(), AddBbEcfgEdges::InternalExec(), bb_feedback_edges_computation::InternalExec(), and cdfc_module_binding::InternalExec().
|
protected |
The graph collection.
Definition at line 846 of file graph.hpp.
Referenced by OpGraph::CGetOperations(), OpGraph::CGetOutEdges(), DesignFlowGraph::GetDesignFlowStep(), CallGraph::WriteDot(), DesignFlowGraph::WriteDot(), CdfcGraph::WriteDot(), BBGraph::WriteDot(), StateTransitionGraph::WriteDot(), and OpGraph::WriteDot().