pasta::bit_vector  v1.0.0
Compact and Fast Rank and Select Data Structure for Bit Vectors
find_l2_wide_with.hpp
1/*******************************************************************************
2 * This file is part of pasta::bit_vector.
3 *
4 * Copyright (C) 2021 Florian Kurpicz <florian@kurpicz.org>
5 *
6 * pasta::bit_vector is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * pasta::bit_vector is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with pasta::bit_vector. If not, see <http://www.gnu.org/licenses/>.
18 *
19 ******************************************************************************/
20
21#pragma once
22
23namespace pasta {
24
25//! \addtogroup pasta_bit_vector_configuration
26//! \{
27
28/*!
29 * \brief Enum used to specify whether intrinsic functions should be used.
30 *
31 * Note that this does not necessarily mean that intrinsic functions are
32 * faster. Please refer to the benchmarks for real world practical results
33 * obtained in experiments.
34 */
35enum class FindL2WideWith {
36 LINEAR_SEARCH,
37 BINARY_SEARCH,
38}; // enum class FindL2WideWith
39
40/*! \brief Helper function indicating whether a linear search
41 * function should be used.
42 *
43 * \param find_with FindL2WideWith indicating whether intrinsics
44 * should be used.
45 * \return \c true if intrinsics should be used and \c false otherwise.
46 */
47constexpr bool use_linear_search(FindL2WideWith const find_with) {
48 return find_with == FindL2WideWith::LINEAR_SEARCH;
49}
50
51/*! \brief Helper function indicating whether a binary search
52 * function should be used.
53 *
54 * \param find_with FindL2WideWith indicating whether intrinsics
55 * should be used.
56 * \return \c true if intrinsics should be used and \c false otherwise.
57 */
58constexpr bool use_binary_search(FindL2WideWith const find_with) {
59 return find_with == FindL2WideWith::BINARY_SEARCH;
60}
61
62//! \‍)
63
64} // namespace pasta
65
66/******************************************************************************/
constexpr bool use_binary_search(FindL2WideWith const find_with)
Helper function indicating whether a binary search function should be used.
Definition: find_l2_wide_with.hpp:58
constexpr bool use_linear_search(FindL2WideWith const find_with)
Helper function indicating whether a linear search function should be used.
Definition: find_l2_wide_with.hpp:47
FindL2WideWith
Enum used to specify whether intrinsic functions should be used.
Definition: find_l2_wide_with.hpp:35