SDSL  3.0.0
Succinct Data Structure Library
rmq_support.hpp
Go to the documentation of this file.
1 // Copyright (c) 2016, the SDSL Project Authors. All rights reserved.
2 // Please see the AUTHORS file for details. Use of this source code is governed
3 // by a BSD license that can be found in the LICENSE file.
8 #ifndef INCLUDED_SDSL_RMQ_SUPPORT
9 #define INCLUDED_SDSL_RMQ_SUPPORT
10 
13 template <class RandomAccessContainer, bool Minimum> // for range minimum queries
15 {
16  static inline bool strict_compare(const typename RandomAccessContainer::value_type v1,
17  const typename RandomAccessContainer::value_type v2)
18  {
19  return v1 < v2;
20  }
21  static inline bool compare(const typename RandomAccessContainer::value_type v1,
22  const typename RandomAccessContainer::value_type v2)
23  {
24  return v1 <= v2;
25  }
26 };
27 
28 template <class RandomAccessContainer> // for range maximum queries
29 struct min_max_trait<RandomAccessContainer, false>
30 {
31  static inline bool strict_compare(const typename RandomAccessContainer::value_type v1,
32  const typename RandomAccessContainer::value_type v2)
33  {
34  return v1 > v2;
35  }
36  static inline bool compare(const typename RandomAccessContainer::value_type v1,
37  const typename RandomAccessContainer::value_type v2)
38  {
39  return v1 >= v2;
40  }
41 };
42 
46 
47 #endif
rmq_succinct_sada.hpp contains the class rmq_succinct_sada which supports range minimum or range maxi...
rmq_succinct_sct.hpp contains the class rmq_succinct_sct which supports range minimum or range maximu...
rmq_support_sparse_table.hpp contains the class rmq_support_sparse_table.
static bool compare(const typename RandomAccessContainer::value_type v1, const typename RandomAccessContainer::value_type v2)
Definition: rmq_support.hpp:36
static bool strict_compare(const typename RandomAccessContainer::value_type v1, const typename RandomAccessContainer::value_type v2)
Definition: rmq_support.hpp:31
static bool strict_compare(const typename RandomAccessContainer::value_type v1, const typename RandomAccessContainer::value_type v2)
Definition: rmq_support.hpp:16
static bool compare(const typename RandomAccessContainer::value_type v1, const typename RandomAccessContainer::value_type v2)
Definition: rmq_support.hpp:21