DOLFIN
DOLFIN C++ interface
BoostGraphOrdering.h
1 // Copyright (C) 2012 Garth N. Wells
2 //
3 // This file is part of DOLFIN.
4 //
5 // DOLFIN is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // DOLFIN is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
17 //
18 // First added: 2012-07-06
19 // Last changed: 2012-11-12
20 
21 #ifndef __DOLFIN_BOOST_GRAPH_ORDERING_H
22 #define __DOLFIN_BOOST_GRAPH_ORDERING_H
23 
24 #include <set>
25 #include <utility>
26 #include <vector>
27 #include "Graph.h"
28 
29 namespace dolfin
30 {
31 
33 
35  {
36 
37  public:
38 
41  static std::vector<int> compute_cuthill_mckee(const Graph& graph,
42  bool reverse=false);
43 
46  static std::vector<int>
47  compute_cuthill_mckee(const std::set<std::pair<std::size_t, std::size_t>>& edges,
48  std::size_t size, bool reverse=false);
49 
50  private:
51 
52  // Build Boost undirected graph
53  template<typename T, typename X>
54  static T build_undirected_graph(const X& graph);
55 
56  // Build Boost directed graph
57  template<typename T, typename X>
58  static T build_directed_graph(const X& graph);
59 
60  // Build Boost compressed sparse row graph
61  template<typename T, typename X>
62  static T build_csr_directed_graph(const X& graph);
63 
64  };
65 
66 }
67 
68 #endif
Definition: adapt.h:29
This class computes graph re-orderings. It uses Boost Graph.
Definition: BoostGraphOrdering.h:34
static std::vector< int > compute_cuthill_mckee(const Graph &graph, bool reverse=false)
Definition: BoostGraphOrdering.cpp:35
std::vector< graph_set_type > Graph
Vector of unordered Sets.
Definition: Graph.h:39