TTK
Loading...
Searching...
No Matches
geoPHUtils.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <boost/version.hpp>
6#if((BOOST_VERSION / 100) % 1000) >= 81
7#include <boost/unordered/unordered_flat_map.hpp>
8#include <boost/unordered/unordered_flat_set.hpp>
9#else
10#include <boost/unordered/unordered_map.hpp>
11#include <boost/unordered/unordered_set.hpp>
12#endif
13
14#if((BOOST_VERSION / 100) % 1000) >= 84
15#include <boost/unordered/concurrent_flat_map.hpp>
16#define TTK_CONCURRENT_HASHTABLE_AVAILABLE
17#endif
18
19#ifdef TTK_ENABLE_TBB
20#include <tbb/concurrent_vector.h>
21#include <tbb/global_control.h>
22#endif
23
24#ifdef TTK_ENABLE_OPENMP
25#include <omp.h>
26#endif
27
28#ifdef __cpp_lib_execution
29#include <execution>
30#endif
31
32#if defined(TTK_ENABLE_OPENMP) and defined(TTK_ENABLE_TBB) \
33 and defined(TTK_CONCURRENT_HASHTABLE_AVAILABLE)
34#define TTK_GPH_PARALLEL
35#endif
36
37#include <dset.h>
38
39namespace ttk::gph {
40 using id_t = int;
41
42 template <unsigned DIM>
43 using PointD = std::conditional_t<DIM == 0,
44 std::vector<rpd::value_t>,
45 std::array<rpd::value_t, DIM>>;
46
47 template <unsigned DIM>
48 using PointCloud = std::vector<PointD<DIM>>;
49
50#if((BOOST_VERSION / 100) % 1000) >= 81
51 template <typename X, typename Y>
52 using HashMap = boost::unordered_flat_map<X, Y>;
53 template <typename X>
54 using HashSet = boost::unordered_flat_set<X>;
55#else
56 template <typename X, typename Y>
57 using HashMap = boost::unordered_map<X, Y>;
58 template <typename X>
59 using HashSet = boost::unordered_set<X>;
60#endif
61
62#if((BOOST_VERSION / 100) % 1000) >= 84
63 template <typename X, typename Y>
64 using ConcurrentHashMap = boost::concurrent_flat_map<X, Y>;
65#endif
66
67} // namespace ttk::gph
std::vector< PointD< DIM > > PointCloud
Definition geoPHUtils.h:48
boost::unordered_map< X, Y > HashMap
Definition geoPHUtils.h:57
std::conditional_t< DIM==0, std::vector< rpd::value_t >, std::array< rpd::value_t, DIM > > PointD
Definition geoPHUtils.h:43
boost::unordered_set< X > HashSet
Definition geoPHUtils.h:59