directed_graph.h
Go to the documentation of this file.
1 /*
2  * This file is part of the alglib project.
3  *
4  * (c) Divyanshu Kakwani <divkakwani@gmail.com>
5  *
6  * For the full copyright and license information, please view the LICENSE file
7  * that was distributed with this source code.
8  */
9 
11 #include <alglib/graph/edge.h>
12 
13 #pragma once
14 
15 namespace alglib {
16 namespace graph {
17 
18 template<typename vertex_t, typename attr_t = void,
19  template<typename, typename> class model = models::adj_list>
20 class directed_graph : public model<vertex_t, edge_t<vertex_t, attr_t>> {
21 
22  public:
24 
25  void add_edge(const vertex_t& u, const vertex_t& v, const attr_t& attr) {
26  model<vertex_t, edge_type>::add_edge(u, v, edge_type(u, v, attr));
27  }
28 
29 };
30 
31 
32 template<typename vertex_t,
33  template<typename, typename> class model>
34 class directed_graph<vertex_t, void, model> : public model<vertex_t, edge_t<vertex_t>> {
35 
36  public:
38 
39  void add_edge(const vertex_t& u, const vertex_t& v) {
40  model<vertex_t, edge_type>::add_edge(u, v, edge_type(u, v));
41  }
42 
43 };
44 
45 } // end of graph namespace
46 } // end of alglib namespace
47 
Definition: directed_graph.h:20
Definition: bimap.h:17
void add_edge(const vertex_t &u, const vertex_t &v, const attr_t &attr)
Definition: directed_graph.h:25
edge_t< vertex_t, attr_t > edge_type
Definition: directed_graph.h:23
Definition: edge.h:19
void add_edge(const vertex_t &u, const vertex_t &v)
Definition: directed_graph.h:39
edge_t< vertex_t, void > edge_type
Definition: directed_graph.h:37