-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhypergraph_traits.hpp
More file actions
87 lines (70 loc) · 3.59 KB
/
hypergraph_traits.hpp
File metadata and controls
87 lines (70 loc) · 3.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Copyright (c) 2024-2026 Jakub Musiał
// This file is part of the CPP-GL project (https://github.com/SpectraL519/cpp-gl).
// Licensed under the MIT License. See the LICENSE file in the project root for full license information.
#pragma once
#include "directional_tags.hpp"
#include "hypergraph_elements.hpp"
#include "impl/impl_tags.hpp"
#include "impl/layout_tags.hpp"
namespace hgl {
template <
type_traits::c_hypergraph_directional_tag DirectionalTag = undirected_t,
type_traits::c_properties VertexProperties = types::empty_properties,
type_traits::c_properties HyperedgeProperties = types::empty_properties,
type_traits::c_hypergraph_impl_tag ImplTag = impl::list_t<impl::hyperedge_major_t>>
struct hypergraph_traits {
using directional_tag = DirectionalTag;
using implementation_tag = ImplTag;
using vertex_type = vertex_descriptor<VertexProperties>;
using vertex_properties_type = typename vertex_type::properties_type;
using hyperedge_type = hyperedge_descriptor<HyperedgeProperties>;
using hyperedge_properties_type = typename hyperedge_type::properties_type;
};
template <
type_traits::c_hypergraph_layout_tag LayoutTag = impl::hyperedge_major_t,
type_traits::c_hypergraph_directional_tag DirectionalTag = undirected_t,
type_traits::c_properties VertexProperties = types::empty_properties,
type_traits::c_properties HyperedgeProperties = types::empty_properties>
using list_hypergraph_traits =
hypergraph_traits<DirectionalTag, VertexProperties, HyperedgeProperties, impl::list_t<LayoutTag>>;
template <
type_traits::c_hypergraph_layout_tag LayoutTag = impl::hyperedge_major_t,
type_traits::c_hypergraph_directional_tag DirectionalTag = undirected_t,
type_traits::c_properties VertexProperties = types::empty_properties,
type_traits::c_properties HyperedgeProperties = types::empty_properties>
using matrix_hypergraph_traits = hypergraph_traits<
DirectionalTag,
VertexProperties,
HyperedgeProperties,
impl::matrix_t<LayoutTag>>;
template <
type_traits::c_properties VertexProperties = types::empty_properties,
type_traits::c_properties HyperedgeProperties = types::empty_properties,
type_traits::c_hypergraph_impl_tag ImplTag = impl::list_t<impl::hyperedge_major_t>>
using undirected_hypergraph_traits =
hypergraph_traits<undirected_t, VertexProperties, HyperedgeProperties, ImplTag>;
template <
type_traits::c_properties VertexProperties = types::empty_properties,
type_traits::c_properties HyperedgeProperties = types::empty_properties,
type_traits::c_hypergraph_impl_tag ImplTag = impl::list_t<impl::hyperedge_major_t>>
using bf_directed_hypergraph_traits =
hypergraph_traits<bf_directed_t, VertexProperties, HyperedgeProperties, ImplTag>;
namespace type_traits {
template <typename TraitsType>
concept c_list_hypergraph_traits =
c_instantiation_of<TraitsType, hypergraph_traits>
and c_hypergraph_list_impl<typename TraitsType::implementation_tag>;
template <typename TraitsType>
concept c_matrix_hypergraph_traits =
c_instantiation_of<TraitsType, hypergraph_traits>
and c_hypergraph_matrix_impl<typename TraitsType::implementation_tag>;
template <typename TraitsType>
concept c_undirected_hypergraph_traits =
c_instantiation_of<TraitsType, hypergraph_traits>
and std::same_as<typename TraitsType::hyperedge_directional_tag, undirected_t>;
template <typename TraitsType>
concept c_bf_directed_hypergraph_traits =
c_instantiation_of<TraitsType, hypergraph_traits>
and std::same_as<typename TraitsType::hyperedge_directional_tag, bf_directed_t>;
} // namespace type_traits
} // namespace hgl