emkornfield commented on code in PR #48345: URL: https://github.com/apache/arrow/pull/48345#discussion_r2722272179
########## cpp/src/arrow/util/alp/alp_wrapper.h: ########## @@ -0,0 +1,148 @@ +// 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. + +// High-level wrapper interface for ALP compression + +#pragma once + +#include <cstddef> +#include <optional> + +#include "arrow/util/alp/alp.h" + +namespace arrow { +namespace util { +namespace alp { + +// ---------------------------------------------------------------------- +// AlpWrapper + +/// \class AlpWrapper +/// \brief High-level interface for ALP compression +/// +/// AlpWrapper is an interface for Adaptive Lossless floating-Point Compression +/// (ALP) (https://dl.acm.org/doi/10.1145/3626717). For encoding, it samples +/// the data and applies decimal compression (Alp) to floating point values. +/// This class acts as a wrapper around the vector-based interfaces of +/// AlpSampler and Alp. +/// +/// \tparam T the floating point type (float or double) +template <typename T> +class AlpWrapper { + public: + /// \brief Encode floating point values using ALP decimal compression + /// + /// \param[in] decomp pointer to the input that is to be encoded + /// \param[in] decomp_size size of decomp in bytes. + /// This needs to be a multiple of sizeof(T). + /// \param[out] comp pointer to the memory region we will encode into. + /// The caller is responsible for ensuring this is big enough. Review Comment: might be useful to document how the caller can ensure this. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
