NeoPZ
TPZBoostGraph.h
Go to the documentation of this file.
1 
6 #ifndef TPZBOOSTGRAPH_H
7 #define TPZBOOSTGRAPH_H
8 #include "TPZRenumbering.h"
9 
10 #ifdef USING_BOOST
11 
12 #include "pzvec.h"
13 #include <boost/graph/adjacency_list.hpp>
14 #include <boost/graph/sloan_ordering.hpp>
15 #include <boost/graph/cuthill_mckee_ordering.hpp>
16 #include <boost/graph/properties.hpp>
17 #include <boost/graph/bandwidth.hpp>
18 #include <boost/graph/profile.hpp>
19 #include <boost/graph/wavefront.hpp>
20 #include <boost/graph/properties.hpp>
21 
26 typedef boost::adjacency_list<boost::setS,boost::vecS,boost::undirectedS,
27 boost::property<boost::vertex_color_t,boost::default_color_type,
28 boost::property<boost::vertex_degree_t,int,
29 boost::property<boost::vertex_priority_t,double > > > > Graph;
30 
31 typedef boost::graph_traits<Graph>::vertex_descriptor Vertex;
32 typedef boost::graph_traits<Graph>::vertices_size_type size_type;
33 
34 typedef std::pair<std::size_t, std::size_t> Pair;
35 
36 
48 class TPZBoostGraph : public TPZRenumbering {
49 
50 public:
51 
52  enum GraphType { KMC, KMCExpensive, Sloan };
53 
54 
55 
56  TPZBoostGraph(GraphType tp) : TPZRenumbering(), fGType(tp)
57  {
58  }
59 
61  TPZBoostGraph(int64_t NElements, int64_t NNodes);
62 
63  virtual ~TPZBoostGraph();
64 
65  void CompressedResequence(TPZVec<int64_t> &perm, TPZVec<int64_t> &inverseperm);
66 
71  void ResequenceOld(TPZVec<int> &perm, TPZVec<int> &inverseperm);
72  void Resequence(TPZVec<int64_t> &perm, TPZVec<int64_t> &inverseperm);
73  void setGType(GraphType M) { fGType = M; }
78  virtual void ClearDataStructures();
79 private:
81  TPZVec<Pair> m_Edges;
83  Graph m_Graph;
84  //Creating two iterators over the vertices
85  //graph_traits<Graph>::vertex_iterator ui, ui_end;
86 
88  boost::property_map<Graph,boost::vertex_degree_t>::type m_Degrees;
89  // = get(vertex_degree, G);
90  // for (boost::tie(ui, ui_end) = vertices(G); ui != ui_end; ++ui)
91  // deg[*ui] = degree(*ui, G);
92 
94  boost::property_map<Graph, boost::vertex_index_t>::type m_Index_map;
95  // = get(vertex_index, G);
96  TPZVec<int64_t> m_Connects;
97 
98  GraphType fGType;
99 };
100 
101 
102 
103 #endif // USING_BOOST
104 
105 #endif //TPZBOOSTGRAPH_H
Templated vector implementation.
Contains the TPZRenumbering class which defines the behavior to implementing node sequence numbering ...
This abstract class which defines the behavior which derived classes need to implement for implement...
virtual void ClearDataStructures()
This will reset all datastructures the object may contain.
virtual void Resequence(TPZVec< int64_t > &perm, TPZVec< int64_t > &iperm)