/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #ifndef REQ_FLOAT_SKETCH_C_ADAPTER_H #define REQ_FLOAT_SKETCH_C_ADAPTER_H #ifdef __cplusplus extern "C" { #endif #include "ptr_with_size.h" static const unsigned DEFAULT_K = 12; void* req_float_sketch_new(unsigned k, bool hra); void req_float_sketch_delete(void* sketchptr); void req_float_sketch_update(void* sketchptr, float value); void req_float_sketch_merge(void* sketchptr1, void* sketchptr2); double req_float_sketch_get_rank(const void* sketchptr, float value, bool inclusive); float req_float_sketch_get_quantile(const void* sketchptr, double rank, bool inclusive); unsigned long long req_float_sketch_get_n(const void* sketchptr); char* req_float_sketch_to_string(const void* sketchptr); struct ptr_with_size req_float_sketch_serialize(const void* sketchptr, unsigned header_size); void* req_float_sketch_deserialize(const char* buffer, unsigned length); unsigned req_float_sketch_get_serialized_size_bytes(const void* sketchptr); void** req_float_sketch_get_pmf_or_cdf(const void* sketchptr, const float* split_points, unsigned num_split_points, bool is_cdf, bool scale, bool inclusive); void** req_float_sketch_get_quantiles(const void* sketchptr, const double* fractions, unsigned num_fractions, bool inclusive); #ifdef __cplusplus } #endif #endif