PandA-2024.02
Public Member Functions | Protected Member Functions | Protected Attributes | Friends
graph Struct Reference

General class used to describe a graph in PandA. More...

#include <graph.hpp>

Inheritance diagram for graph:
Inheritance graph
[legend]
Collaboration diagram for graph:
Collaboration graph
[legend]

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_collectioncollection
 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...
 

Detailed Description

General class used to describe a graph in PandA.

Definition at line 771 of file graph.hpp.

Constructor & Destructor Documentation

◆ graph() [1/2]

graph::graph ( graphs_collection g,
const int  _selector 
)
inline

Standard constructor.

Parameters
gis the bulk graph.
_selectoris the selector used to filter the bulk graph.

Definition at line 876 of file graph.hpp.

◆ graph() [2/2]

graph::graph ( graphs_collection g,
const int  _selector,
const CustomUnorderedSet< boost::graph_traits< graphs_collection >::vertex_descriptor > &  vertices 
)
inline

Sub-graph constructor.

Parameters
gis the bulk graph.
_selectoris the selector used to filter the bulk graph.
verticesis the set of vertexes on which the graph is filtered.

Definition at line 891 of file graph.hpp.

References VERTEX().

Here is the call graph for this function:

◆ ~graph()

virtual graph::~graph ( )
virtualdefault

Destructor.

Member Function Documentation

◆ BreadthFirstSearch()

void graph::BreadthFirstSearch ( const boost::graph_traits< graphs_collection >::vertex_descriptor  node,
boost::bfs_visitor<> *  vis 
) const
inline

Compute the breadth first search.

Definition at line 976 of file graph.hpp.

◆ CGetEdge()

boost::graph_traits<graphs_collection>::edge_descriptor graph::CGetEdge ( const boost::graph_traits< graphs_collection >::vertex_descriptor  source,
const boost::graph_traits< graphs_collection >::vertex_descriptor  target 
) const
inline

Returns the edge connecting two vertices; throw error if it does not exist.

Parameters
sourceis the source of the edge to be returned
targetis the target of the edge to be returned
Returns
the edge connecting source with target

Definition at line 1106 of file graph.hpp.

References THROW_ASSERT, and test_panda::type.

◆ CGetEdgeInfo() [1/2]

const EdgeInfoConstRef graph::CGetEdgeInfo ( typename boost::graph_traits< graphs_collection >::vertex_descriptor  source,
typename boost::graph_traits< graphs_collection >::vertex_descriptor  target 
) const
inlineprotected

Get the edge property.

Parameters
sourceis the source vertex of the edge
targetis the target vertex of the edge
Returns
the associated property

Definition at line 811 of file graph.hpp.

References THROW_ASSERT.

Referenced by BBGraph::CGetBBEdgeInfo(), CdfcGraph::CGetCdfcEdgeInfo(), CallGraph::CGetFunctionEdgeInfo(), OpGraph::CGetOpEdgeInfo(), and StateTransitionGraph::CGetTransitionInfo().

Here is the caller graph for this function:

◆ CGetEdgeInfo() [2/2]

EdgeInfoConstRef graph::CGetEdgeInfo ( typename boost::graph_traits< graphs_collection >::edge_descriptor  edge) const
inlineprotected

Get the edge property.

Parameters
edgeis the edge whose property is asked
Returns
the associated property

Definition at line 838 of file graph.hpp.

References THROW_ASSERT.

◆ CGetGraphInfo()

const GraphInfoConstRef graph::CGetGraphInfo ( ) const
inline

FIXME: this method should become protected and called by equivalent method in subclasses Get the graph property.

Returns
the property associated with the graph

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().

Here is the caller graph for this function:

◆ CGetNodeInfo()

const NodeInfoConstRef graph::CGetNodeInfo ( typename boost::graph_traits< graphs_collection >::vertex_descriptor  node) const
inlineprotected

Get the node property.

Parameters
nodeis the node whose property is asked
Returns
the associated property

Definition at line 781 of file graph.hpp.

References THROW_ASSERT.

Referenced by BBGraph::CGetBBNodeInfo(), DesignFlowGraph::CGetDesignFlowStepInfo(), OpGraph::CGetOpNodeInfo(), and StateTransitionGraph::CGetStateInfo().

Here is the caller graph for this function:

◆ ExistsEdge()

bool graph::ExistsEdge ( const boost::graph_traits< graphs_collection >::vertex_descriptor  source,
const boost::graph_traits< graphs_collection >::vertex_descriptor  target 
) const
inline

Check if an edge exists.

Parameters
sourceis the source vertex
targetis the target vertex
Returns
true if source-target exists

Definition at line 1090 of file graph.hpp.

Referenced by SDCScheduling::AddDelayConstraints(), and SDCScheduling::InternalExec().

Here is the caller graph for this function:

◆ GetEdgeInfo() [1/2]

EdgeInfoRef graph::GetEdgeInfo ( typename boost::graph_traits< graphs_collection >::vertex_descriptor  source,
typename boost::graph_traits< graphs_collection >::vertex_descriptor  target 
)
inlineprotected

Get the edge property.

Parameters
sourceis the source vertex of the edge
targetis the target vertex of the edge
Returns
the associated property

Definition at line 794 of file graph.hpp.

References THROW_ASSERT.

Referenced by BBGraph::GetBBEdgeInfo(), and StateTransitionGraph::GetTransitionInfo().

Here is the caller graph for this function:

◆ GetEdgeInfo() [2/2]

EdgeInfoRef graph::GetEdgeInfo ( typename boost::graph_traits< graphs_collection >::edge_descriptor  edge) const
inlineprotected

Get the edge property.

Parameters
edgeis the edge whose property is asked
Returns
the associated property

Definition at line 826 of file graph.hpp.

References THROW_ASSERT.

◆ GetGraphInfo()

GraphInfoRef graph::GetGraphInfo ( )
inline

FIXME: this method should become protected and called by equivalent method in subclasses Get the graph property.

Returns
the property associated with the graph

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().

Here is the caller graph for this function:

◆ GetNodeInfo()

NodeInfoRef graph::GetNodeInfo ( typename boost::graph_traits< graphs_collection >::vertex_descriptor  node)
inline

FIXME: this method should become protected and called by equivalent method in subclasses Get the node property.

Parameters
nodeis the vertex whose property is asked
Returns
the associated property

Definition at line 1039 of file graph.hpp.

References THROW_ASSERT.

Referenced by BBGraph::GetBBNodeInfo(), DesignFlowGraph::GetDesignFlowStepInfo(), OpGraph::GetOpNodeInfo(), and StateTransitionGraph::GetStateInfo().

Here is the caller graph for this function:

◆ GetSelector() [1/3]

int graph::GetSelector ( ) const
inline

◆ GetSelector() [2/3]

int graph::GetSelector ( const edge_descriptor  e) const
inline

Return the selectors associated with an edge.

Parameters
eis the edge
Returns
the associated selector

Definition at line 932 of file graph.hpp.

References graphs_collection::GetSelector().

Here is the call graph for this function:

◆ GetSelector() [3/3]

int graph::GetSelector ( const boost::graph_traits< graphs_collection >::vertex_descriptor  source,
const boost::graph_traits< graphs_collection >::vertex_descriptor  target 
) const
inline

Return the selectors associated with an edge.

Parameters
sourceis the source of an edge
targetis the target of an edge
Returns
the associated selector

Definition at line 943 of file graph.hpp.

References graphs_collection::GetSelector().

Here is the call graph for this function:

◆ GetStronglyConnectedComponents()

void graph::GetStronglyConnectedComponents ( std::map< size_t, UnorderedSetStdStable< boost::graph_traits< graphs_collection >::vertex_descriptor >> &  strongly_connected_components) const
inline

Compute the strongly connected components of the graph.

Parameters
strongly_connected_componentsis 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().

Here is the caller graph for this function:

◆ InternalWriteDot() [1/2]

template<typename VertexWriterTemplate , typename EdgeWriterTemplate , typename GraphWriterTemplate >
void graph::InternalWriteDot ( const std::string &  file_name,
const VertexWriterConstRef  vertex_writer,
const EdgeWriterConstRef  edge_writer,
const GraphWriterConstRef  graph_writer 
) const
inlineprotected

Print the graph in dot format.

Parameters
file_nameis the name of the file to be created
node_writeris the functor used to print the node labels
edge_writeris the functor used to print the edge labels
graph_writeris the functor used to print the graph properties

Definition at line 859 of file graph.hpp.

◆ InternalWriteDot() [2/2]

template<typename VertexWriterTemplate , typename EdgeWriterTemplate >
void graph::InternalWriteDot ( const std::string &  file_name,
const VertexWriterConstRef  vertex_writer,
const EdgeWriterConstRef  edge_writer 
) const
inline

Print the graph in dot format FIXME: this method should become protected and called by WriteDot.

Parameters
file_nameis the name of the file to be created
node_writeris the functor used to print the node labels
edge_writeris the functor used to print the edge labels

Definition at line 1076 of file graph.hpp.

◆ is_in_subset()

bool graph::is_in_subset ( const boost::graph_traits< graph >::vertex_descriptor  v) const
inline

return true in case the vertex is a vertex of the subgraph.

Definition at line 913 of file graph.hpp.

◆ IsReachable()

bool graph::IsReachable ( const boost::graph_traits< graphs_collection >::vertex_descriptor  x,
const boost::graph_traits< graphs_collection >::vertex_descriptor  y 
) const
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().

Here is the caller graph for this function:

◆ ReverseTopologicalSort()

void graph::ReverseTopologicalSort ( std::deque< boost::graph_traits< graphs_collection >::vertex_descriptor > &  sorted_vertices) const
inline

Compute the reverse topological order of the graph.

Parameters
sorted_verticesis where results will be store

Definition at line 987 of file graph.hpp.

◆ TopologicalSort()

void graph::TopologicalSort ( std::list< boost::graph_traits< graphs_collection >::vertex_descriptor > &  sorted_vertices) const
inline

Compute the topological order of the graph.

Parameters
sorted_verticesis 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().

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ VERTEX

boost::graph_traits<graph>::vertex_descriptor VERTEX ( const boost::graph_traits< graph >::vertices_size_type  i,
const graph g 
)
friend

this function can access the bulk graph

Parameters
iis the index of the vertex.
gis the graph for which the vertex is asked.
Returns
the vertex with the index i of the graph g.

Definition at line 1368 of file graph.hpp.

Field Documentation

◆ collection

graphs_collection* graph::collection
protected

◆ selector

const int graph::selector
protected

selector

Definition at line 849 of file graph.hpp.


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

Generated on Mon Feb 12 2024 13:03:54 for PandA-2024.02 by doxygen 1.8.13