datasketches-cpp
Loading...
Searching...
No Matches
array_tuple_union_impl.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
20namespace datasketches {
21
22template<typename Array, typename Policy, typename Allocator>
23array_tuple_union<Array, Policy, Allocator>::array_tuple_union(uint8_t lg_cur_size, uint8_t lg_nom_size, resize_factor rf, float p, uint64_t theta, uint64_t seed, const Policy& policy, const Allocator& allocator):
24Base(lg_cur_size, lg_nom_size, rf, p, theta, seed, policy, allocator)
25{}
26
27template<typename Array, typename Policy, typename Allocator>
28auto array_tuple_union<Array, Policy, Allocator>::get_result(bool ordered) const -> CompactSketch {
29 return CompactSketch(this->state_.get_policy().get_external_policy().get_num_values(), Base::get_result(ordered));
30}
31
32// builder
33
34template<typename Array, typename Policy, typename Allocator>
35array_tuple_union<Array, Policy, Allocator>::builder::builder(const Policy& policy, const Allocator& allocator):
36tuple_base_builder<builder, Policy, typename Array::allocator_type>(policy, allocator) {}
37
38template<typename Array, typename Policy, typename Allocator>
39auto array_tuple_union<Array, Policy, Allocator>::builder::build() const -> array_tuple_union {
40 return array_tuple_union(this->starting_lg_size(), this->lg_k_, this->rf_, this->p_, this->starting_theta(), this->seed_, this->policy_, this->allocator_);
41}
42
43} /* namespace datasketches */
DataSketches namespace.
Definition binomial_bounds.hpp:38