datasketches-cpp
theta_set_difference_base.hpp
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
20 #ifndef THETA_SET_DIFFERENCE_BASE_HPP_
21 #define THETA_SET_DIFFERENCE_BASE_HPP_
22 
23 #include "theta_comparators.hpp"
24 #include "theta_update_sketch_base.hpp"
25 
26 namespace datasketches {
27 
28 template<
29  typename Entry,
30  typename ExtractKey,
31  typename CompactSketch,
32  typename Allocator
33 >
34 class theta_set_difference_base {
35 public:
36  using comparator = compare_by_key<ExtractKey>;
37  using AllocU64 = typename std::allocator_traits<Allocator>::template rebind_alloc<uint64_t>;
38  using hash_table = theta_update_sketch_base<uint64_t, trivial_extract_key, AllocU64>;
39 
40  theta_set_difference_base(uint64_t seed, const Allocator& allocator = Allocator());
41 
42  template<typename FwdSketch, typename Sketch>
43  CompactSketch compute(FwdSketch&& a, const Sketch& b, bool ordered) const;
44 
45 private:
46  Allocator allocator_;
47  uint16_t seed_hash_;
48 };
49 
50 } /* namespace datasketches */
51 
52 #include "theta_set_difference_base_impl.hpp"
53 
54 #endif
DataSketches namespace.
Definition: binomial_bounds.hpp:38