Teuchos - Trilinos Tools Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_Graph.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef TEUCHOS_GRAPH_HPP
11 #define TEUCHOS_GRAPH_HPP
12 
13 #include <vector>
14 #include <iosfwd>
15 
16 namespace Teuchos {
17 
18 typedef std::vector<int> NodeEdges;
19 typedef std::vector<NodeEdges> Graph;
20 
21 Graph make_graph_with_nnodes(int nnodes);
22 int get_nnodes(Graph const& g);
23 void add_edge(Graph& g, int i, int j);
24 NodeEdges const& get_edges(Graph const& g, int i);
25 NodeEdges& get_edges(Graph& g, int i);
26 int count_edges(const Graph& g, int i);
27 Graph make_transpose(Graph const& g);
28 int at(Graph const& g, int i, int j);
29 
30 std::ostream& operator<<(std::ostream& os, Graph const& g);
31 
32 }
33 
34 #endif