You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by al...@apache.org on 2020/08/24 22:20:09 UTC

[incubator-datasketches-cpp] 02/02: removed unused files

This is an automated email from the ASF dual-hosted git repository.

alsay pushed a commit to branch tuple_sketch
in repository https://gitbox.apache.org/repos/asf/incubator-datasketches-cpp.git

commit 9649970392e66300101b251b7cc592bae2029063
Author: AlexanderSaydakov <Al...@users.noreply.github.com>
AuthorDate: Mon Aug 24 15:19:49 2020 -0700

    removed unused files
---
 tuple/include/theta_to_tuple_sketch_adapter.hpp    | 77 ------------------
 .../include/theta_to_tuple_sketch_adapter_impl.hpp | 93 ----------------------
 tuple/test/mixed_union_test.cpp                    | 74 -----------------
 3 files changed, 244 deletions(-)

diff --git a/tuple/include/theta_to_tuple_sketch_adapter.hpp b/tuple/include/theta_to_tuple_sketch_adapter.hpp
deleted file mode 100644
index 2a3cb7e..0000000
--- a/tuple/include/theta_to_tuple_sketch_adapter.hpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * 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 THETA_TO_TUPLE_SKETCH_ADAPTER_HPP_
-#define THETA_TO_TUPLE_SKETCH_ADAPTER_HPP_
-
-#include <memory>
-
-#include "theta_sketch_experimental.hpp"
-
-namespace datasketches {
-
-template<typename Summary, typename Allocator = std::allocator<uint64_t>>
-class theta_to_tuple_sketch_adapter {
-public:
-  theta_to_tuple_sketch_adapter(const update_theta_sketch_experimental<Allocator>& sketch, const Summary& summary);
-  theta_to_tuple_sketch_adapter(const compact_theta_sketch_experimental<Allocator>& sketch, const Summary& summary);
-  bool is_empty() const;
-  bool is_ordered() const;
-  uint16_t get_seed_hash() const;
-  uint64_t get_theta64() const;
-
-  class const_iterator;
-  const_iterator begin();
-  const_iterator end();
-
-private:
-  const theta_sketch_experimental<Allocator>* sketch_ptr;
-  Summary summary;
-};
-
-template<typename Summary, typename Allocator>
-class theta_to_tuple_sketch_adapter<Summary, Allocator>::const_iterator {
-public:
-  using Entry = std::pair<uint64_t, Summary>;
-  using theta_const_iterator = typename theta_sketch_experimental<Allocator>::const_iterator;
-
-  using iterator_category = std::forward_iterator_tag;
-  using value_type = Entry;
-  using difference_type = std::ptrdiff_t;
-  using pointer = Entry*;
-  using reference = Entry&;
-
-  const_iterator(const theta_const_iterator& it, const Summary& summary);
-  const_iterator& operator++();
-  const_iterator operator++(int);
-  bool operator==(const const_iterator& other) const;
-  bool operator!=(const const_iterator& other) const;
-  Entry& operator*() const;
-
-private:
-  theta_const_iterator it;
-  Summary summary;
-  mutable Entry entry;
-};
-
-} /* namespace datasketches */
-
-#include "theta_to_tuple_sketch_adapter_impl.hpp"
-
-#endif
diff --git a/tuple/include/theta_to_tuple_sketch_adapter_impl.hpp b/tuple/include/theta_to_tuple_sketch_adapter_impl.hpp
deleted file mode 100644
index 3318700..0000000
--- a/tuple/include/theta_to_tuple_sketch_adapter_impl.hpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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.
- */
-
-namespace datasketches {
-
-template<typename Summary, typename Allocator>
-theta_to_tuple_sketch_adapter<Summary, Allocator>::theta_to_tuple_sketch_adapter(const update_theta_sketch_experimental<Allocator>& sketch, const Summary& summary):
-sketch_ptr(&sketch), summary(summary) {}
-
-template<typename Summary, typename Allocator>
-theta_to_tuple_sketch_adapter<Summary, Allocator>::theta_to_tuple_sketch_adapter(const compact_theta_sketch_experimental<Allocator>& sketch, const Summary& summary):
-sketch_ptr(&sketch), summary(summary) {}
-
-template<typename Summary, typename Allocator>
-bool theta_to_tuple_sketch_adapter<Summary, Allocator>::is_empty() const {
-  return sketch_ptr->is_empty();
-}
-
-template<typename Summary, typename Allocator>
-bool theta_to_tuple_sketch_adapter<Summary, Allocator>::is_ordered() const {
-  return sketch_ptr->is_ordered();
-}
-
-template<typename Summary, typename Allocator>
-uint16_t theta_to_tuple_sketch_adapter<Summary, Allocator>::get_seed_hash() const {
-  return sketch_ptr->get_seed_hash();
-}
-
-template<typename Summary, typename Allocator>
-uint64_t theta_to_tuple_sketch_adapter<Summary, Allocator>::get_theta64() const {
-  return sketch_ptr->get_theta64();
-}
-
-template<typename Summary, typename Allocator>
-auto theta_to_tuple_sketch_adapter<Summary, Allocator>::begin() -> const_iterator {
-  return const_iterator(sketch_ptr->begin(), summary);
-}
-
-template<typename Summary, typename Allocator>
-auto theta_to_tuple_sketch_adapter<Summary, Allocator>::end() -> const_iterator {
-  return const_iterator(sketch_ptr->end(), summary);
-}
-
-template<typename Summary, typename Allocator>
-theta_to_tuple_sketch_adapter<Summary, Allocator>::const_iterator::const_iterator(const theta_const_iterator& it, const Summary& summary):
-it(it), summary(summary), entry(0, summary) {}
-
-template<typename Summary, typename Allocator>
-auto theta_to_tuple_sketch_adapter<Summary, Allocator>::const_iterator::operator++() -> const_iterator& {
-  ++it;
-  return *this;
-}
-
-template<typename Summary, typename Allocator>
-auto theta_to_tuple_sketch_adapter<Summary, Allocator>::const_iterator::operator++(int) -> const_iterator {
-  const_iterator tmp(*this);
-  operator++();
-  return tmp;
-}
-
-template<typename Summary, typename Allocator>
-bool theta_to_tuple_sketch_adapter<Summary, Allocator>::const_iterator::operator==(const const_iterator& other) const {
-  return this->it == other.it;
-}
-
-template<typename Summary, typename Allocator>
-bool theta_to_tuple_sketch_adapter<Summary, Allocator>::const_iterator::operator!=(const const_iterator& other) const {
-  return this->it != other.it;
-}
-
-template<typename Summary, typename Allocator>
-auto theta_to_tuple_sketch_adapter<Summary, Allocator>::const_iterator::operator*() const -> Entry& {
-  entry = Entry(*it, summary); // fresh entry every time
-  return entry;
-}
-
-} /* namespace datasketches */
diff --git a/tuple/test/mixed_union_test.cpp b/tuple/test/mixed_union_test.cpp
deleted file mode 100644
index d0edcf2..0000000
--- a/tuple/test/mixed_union_test.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * 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.
- */
-
-#include <iostream>
-
-#include <catch.hpp>
-#include <tuple_union.hpp>
-#include <theta_sketch_experimental.hpp>
-#include <theta_to_tuple_sketch_adapter.hpp>
-
-namespace datasketches {
-
-TEST_CASE("mixed_union float: empty", "[tuple union]") {
-  auto update_sketch = update_theta_sketch_experimental<>::builder().build();
-
-  auto u = tuple_union<float>::builder().build();
-  u.update(theta_to_tuple_sketch_adapter<float>(update_sketch, 0));
-  auto result = u.get_result();
-//  std::cout << result.to_string(true);
-  REQUIRE(result.is_empty());
-  REQUIRE(result.get_num_retained() == 0);
-  REQUIRE(!result.is_estimation_mode());
-  REQUIRE(result.get_estimate() == 0);
-}
-
-TEST_CASE("mixed_union float: full overlap", "[tuple union]") {
-  auto u = tuple_union<float>::builder().build();
-
-  // theta update
-  auto update_theta = update_theta_sketch_experimental<>::builder().build();
-  for (unsigned i = 0; i < 10; ++i) update_theta.update(i);
-  u.update(theta_to_tuple_sketch_adapter<float>(update_theta, 1));
-
-  // theta compact
-  auto compact_theta = update_theta.compact();
-  u.update(theta_to_tuple_sketch_adapter<float>(compact_theta, 1));
-
-  // tuple update
-  auto update_tuple = update_tuple_sketch<float>::builder().build();
-  for (unsigned i = 0; i < 10; ++i) update_tuple.update(i, 1);
-  u.update(update_tuple);
-
-  // tuple compact
-  auto compact_tuple = update_tuple.compact();
-  u.update(compact_tuple);
-
-  auto result = u.get_result();
-//  std::cout << result.to_string(true);
-  REQUIRE_FALSE(result.is_empty());
-  REQUIRE(result.get_num_retained() == 10);
-  REQUIRE(!result.is_estimation_mode());
-  REQUIRE(result.get_estimate() == 10);
-  for (const auto& entry: result) {
-    REQUIRE(entry.second == 4);
-  }
-}
-
-} /* namespace datasketches */


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org