GraphDom
Loading...
Searching...
No Matches
multiset_graph.h
1/*
2 * Copyright 2026 Michele Comparini
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef GRAPHDOM_MULTISET_GRAPH_IMPL_H
8#define GRAPHDOM_MULTISET_GRAPH_IMPL_H
9
10#include "../multiset_graph.h"
11
12template<typename VertexType>
14 const graphdom::multiset_graph<VertexType>* const graph_ptr,
15 typename graphdom::graph<VertexType>::template non_mixed_graph_vertex_container<VertexContainerPointerType>& vertex_container_reference,
16 const graphdom::edge_type non_mixed_graph_type) {
18 graph_ptr,
20 &vertex_container_reference
21 );
22}
23
24template<typename VertexType>
26 const graphdom::multiset_graph<VertexType>* const graph_ptr,
27 typename graphdom::graph<VertexType>::template mixed_graph_vertex_container<VertexContainerPointerType>& vertex_container_reference) {
29 graph_ptr,
31 &vertex_container_reference
32 );
33}
34
35template<typename VertexType>
37 const graphdom::multiset_graph<VertexType>* const graph_ptr,
38 const typename graphdom::graph<VertexType>::template non_mixed_graph_vertex_container<VertexContainerPointerType>& vertex_container_reference,
39 const graphdom::edge_type non_mixed_graph_type) {
41 graph_ptr,
43 &vertex_container_reference
44 );
45}
46
47template<typename VertexType>
49 const graphdom::multiset_graph<VertexType>* const graph_ptr,
50 const typename graphdom::graph<VertexType>::template mixed_graph_vertex_container<VertexContainerPointerType>& vertex_container_reference) {
52 graph_ptr,
54 &vertex_container_reference
55 );
56}
57
58template<typename VertexType>
62 return ptr.vertex_container_pointer;
63}
64
65template<typename VertexType>
68const typename graphdom::graph<VertexType>::adj_list_const_iterator& const_edge_itr) {
69 return std::get< typename graph<VertexType>::template adj_set<typename graph<VertexType>::vertex_container*>::iterator >( const_edge_itr.inner_iterator );
70}
71
72template<typename VertexType>
73typename graphdom::graph<VertexType>::adj_list_iterator
75 const graphdom::multiset_graph<VertexType>* const edge_multiset_vertex_graph_owner_ptr,
76 non_mixed_graph_vertex_container* const edge_begin_point_ptr,
77 const graphdom::edge_type edge_multiset_vertex_graph_owner_edges_type,
78 const typename adj_set::iterator inner_itr) {
79 return typename graphdom::graph<VertexType>::adj_list_iterator(
80 edge_multiset_vertex_graph_owner_ptr,
81 ( edge_multiset_vertex_graph_owner_edges_type == graphdom::edge_type::undirected ) ?
82 graph<VertexType>::graph_edges_type::undirected :
83 graph<VertexType>::graph_edges_type::directed,
84 edge_begin_point_ptr,
85 graph<VertexType>::edges_type_selection_type::none,
86 edge_multiset_vertex_graph_owner_edges_type,
87 inner_itr
88 );
89}
90
91template<typename VertexType>
92typename graphdom::graph<VertexType>::adj_list_iterator
94 const set_graph<VertexType>* const edge_multiset_vertex_graph_owner_ptr,
95 mixed_graph_vertex_container* const edge_begin_point_ptr,
96 typename adj_set::iterator inner_itr,
97 const graphdom::edge_type inner_itr_edge_type,
98 const bool inner_itr_is_limited_by_edge_type) {
99 return typename graphdom::graph<VertexType>::adj_list_iterator(
100 edge_multiset_vertex_graph_owner_ptr,
101 graph<VertexType>::graph_edges_type::mixed,
102 edge_begin_point_ptr,
103 inner_itr_is_limited_by_edge_type ?
104 ( ( inner_itr_edge_type == graphdom::edge_type::undirected ) ?
105 graph<VertexType>::edges_type_selection_type::undirected_edges :
106 graph<VertexType>::edges_type_selection_type::directed_edges ) :
107 graph<VertexType>::edges_type_selection_type::none,
108 inner_itr_edge_type,
109 inner_itr
110 );
111}
112
113#endif //GRAPHDOM_MULTISET_GRAPH_IMPL_H
Every valid instance of this class can be used to identify a specific vertex of a graph and to access...
Definition vertex_const_handle.h:35
Every graph created using this library is an instance of a concrete class publicly derived,...
Definition graph.h:43
Every valid instance of this class can be used to identify a specific vertex of a multiset graph and ...
Definition multiset_graph_vertex_handle.h:31
Every multiset graph created using this library is an instance of a concrete class publicly derived,...
Definition multiset_graph.h:19
edge_type
The enumerated type whose values represent the two types of edges of a graph.
Definition graph.h:21
@ undirected
This enum value means undirected edge.
Definition graph.h:22