datasketches 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/ext/datasketches/vo_wrapper.cpp +1 -1
  4. data/lib/datasketches/version.rb +1 -1
  5. data/vendor/datasketches-cpp/CMakeLists.txt +1 -0
  6. data/vendor/datasketches-cpp/LICENSE +35 -7
  7. data/vendor/datasketches-cpp/NOTICE +2 -2
  8. data/vendor/datasketches-cpp/common/CMakeLists.txt +2 -1
  9. data/vendor/datasketches-cpp/common/include/common_defs.hpp +1 -0
  10. data/vendor/datasketches-cpp/common/include/quantiles_sorted_view_impl.hpp +5 -7
  11. data/vendor/datasketches-cpp/common/include/xxhash64.h +202 -0
  12. data/vendor/datasketches-cpp/filters/CMakeLists.txt +43 -0
  13. data/vendor/datasketches-cpp/filters/include/bit_array_ops.hpp +180 -0
  14. data/vendor/datasketches-cpp/filters/include/bloom_filter.hpp +753 -0
  15. data/vendor/datasketches-cpp/filters/include/bloom_filter_builder_impl.hpp +132 -0
  16. data/vendor/datasketches-cpp/filters/include/bloom_filter_impl.hpp +908 -0
  17. data/vendor/datasketches-cpp/filters/test/CMakeLists.txt +60 -0
  18. data/vendor/datasketches-cpp/filters/test/bit_array_ops_test.cpp +107 -0
  19. data/vendor/datasketches-cpp/filters/test/bloom_filter_allocation_test.cpp +75 -0
  20. data/vendor/datasketches-cpp/filters/test/bloom_filter_deserialize_from_java_test.cpp +51 -0
  21. data/vendor/datasketches-cpp/filters/test/bloom_filter_serialize_for_java.cpp +45 -0
  22. data/vendor/datasketches-cpp/filters/test/bloom_filter_test.cpp +406 -0
  23. data/vendor/datasketches-cpp/tdigest/include/tdigest.hpp +51 -1
  24. data/vendor/datasketches-cpp/tdigest/include/tdigest_impl.hpp +38 -1
  25. data/vendor/datasketches-cpp/tdigest/test/tdigest_test.cpp +12 -3
  26. data/vendor/datasketches-cpp/theta/include/bit_packing.hpp +5 -5
  27. data/vendor/datasketches-cpp/theta/test/bit_packing_test.cpp +41 -39
  28. data/vendor/datasketches-cpp/version.cfg.in +1 -1
  29. metadata +17 -9
@@ -29,51 +29,53 @@ namespace datasketches {
29
29
  static const uint64_t IGOLDEN64 = 0x9e3779b97f4a7c13ULL;
30
30
 
31
31
  TEST_CASE("pack unpack bits") {
32
- for (uint8_t bits = 1; bits <= 63; ++bits) {
33
- int n = 8;
34
- const uint64_t mask = (1ULL << bits) - 1;
35
- std::vector<uint64_t> input(n, 0);
36
- const uint64_t igolden64 = IGOLDEN64;
37
- uint64_t value = 0xaa55aa55aa55aa55ULL; // arbitrary starting value
38
- for (int i = 0; i < n; ++i) {
39
- input[i] = value & mask;
40
- value += igolden64;
41
- }
42
- std::vector<uint8_t> bytes(n * sizeof(uint64_t), 0);
43
- uint8_t offset = 0;
44
- uint8_t* ptr = bytes.data();
45
- for (int i = 0; i < n; ++i) {
46
- offset = pack_bits(input[i], bits, ptr, offset);
47
- }
32
+ uint64_t value = 0xaa55aa55aa55aa55ULL; // arbitrary starting value
33
+ for (int m = 0; m < 10000; ++m) {
34
+ for (uint8_t bits = 1; bits <= 63; ++bits) {
35
+ int n = 8;
36
+ const uint64_t mask = (1ULL << bits) - 1;
37
+ std::vector<uint64_t> input(n, 0);
38
+ for (int i = 0; i < n; ++i) {
39
+ input[i] = value & mask;
40
+ value += IGOLDEN64;
41
+ }
42
+ std::vector<uint8_t> bytes(n * sizeof(uint64_t), 0);
43
+ uint8_t offset = 0;
44
+ uint8_t* ptr = bytes.data();
45
+ for (int i = 0; i < n; ++i) {
46
+ offset = pack_bits(input[i], bits, ptr, offset);
47
+ }
48
48
 
49
- std::vector<uint64_t> output(n, 0);
50
- offset = 0;
51
- const uint8_t* cptr = bytes.data();
52
- for (int i = 0; i < n; ++i) {
53
- offset = unpack_bits(output[i], bits, cptr, offset);
54
- }
55
- for (int i = 0; i < n; ++i) {
56
- REQUIRE(input[i] == output[i]);
49
+ std::vector<uint64_t> output(n, 0);
50
+ offset = 0;
51
+ const uint8_t* cptr = bytes.data();
52
+ for (int i = 0; i < n; ++i) {
53
+ offset = unpack_bits(output[i], bits, cptr, offset);
54
+ }
55
+ for (int i = 0; i < n; ++i) {
56
+ REQUIRE(input[i] == output[i]);
57
+ }
57
58
  }
58
59
  }
59
60
  }
60
61
 
61
62
  TEST_CASE("pack unpack blocks") {
62
- for (uint8_t bits = 1; bits <= 63; ++bits) {
63
- const uint64_t mask = (1ULL << bits) - 1;
64
- std::vector<uint64_t> input(8, 0);
65
- const uint64_t igolden64 = IGOLDEN64;
66
- uint64_t value = 0xaa55aa55aa55aa55ULL; // arbitrary starting value
67
- for (int i = 0; i < 8; ++i) {
68
- input[i] = value & mask;
69
- value += igolden64;
70
- }
71
- std::vector<uint8_t> bytes(8 * sizeof(uint64_t), 0);
72
- pack_bits_block8(input.data(), bytes.data(), bits);
73
- std::vector<uint64_t> output(8, 0);
74
- unpack_bits_block8(output.data(), bytes.data(), bits);
75
- for (int i = 0; i < 8; ++i) {
76
- REQUIRE((input[i] & mask) == output[i]);
63
+ uint64_t value = 0xaa55aa55aa55aa55ULL; // arbitrary starting value
64
+ for (int n = 0; n < 10000; ++n) {
65
+ for (uint8_t bits = 1; bits <= 63; ++bits) {
66
+ const uint64_t mask = (1ULL << bits) - 1;
67
+ std::vector<uint64_t> input(8, 0);
68
+ for (int i = 0; i < 8; ++i) {
69
+ input[i] = value & mask;
70
+ value += IGOLDEN64;
71
+ }
72
+ std::vector<uint8_t> bytes(bits, 0);
73
+ pack_bits_block8(input.data(), bytes.data(), bits);
74
+ std::vector<uint64_t> output(8, 0);
75
+ unpack_bits_block8(output.data(), bytes.data(), bits);
76
+ for (int i = 0; i < 8; ++i) {
77
+ REQUIRE(input[i] == output[i]);
78
+ }
77
79
  }
78
80
  }
79
81
  }
@@ -1 +1 @@
1
- 5.1.0
1
+ 5.2.0
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datasketches
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-08-02 00:00:00.000000000 Z
10
+ date: 2025-01-16 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rice
@@ -16,15 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: '4.1'
18
+ version: 4.3.3
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
- version: '4.1'
27
- description:
25
+ version: 4.3.3
28
26
  email: andrew@ankane.org
29
27
  executables: []
30
28
  extensions:
@@ -72,6 +70,7 @@ files:
72
70
  - vendor/datasketches-cpp/common/include/quantiles_sorted_view_impl.hpp
73
71
  - vendor/datasketches-cpp/common/include/serde.hpp
74
72
  - vendor/datasketches-cpp/common/include/version.hpp.in
73
+ - vendor/datasketches-cpp/common/include/xxhash64.h
75
74
  - vendor/datasketches-cpp/common/test/CMakeLists.txt
76
75
  - vendor/datasketches-cpp/common/test/catch_runner.cpp
77
76
  - vendor/datasketches-cpp/common/test/integration_test.cpp
@@ -124,6 +123,17 @@ files:
124
123
  - vendor/datasketches-cpp/fi/test/frequent_items_sketch_serialize_for_java.cpp
125
124
  - vendor/datasketches-cpp/fi/test/frequent_items_sketch_test.cpp
126
125
  - vendor/datasketches-cpp/fi/test/reverse_purge_hash_map_test.cpp
126
+ - vendor/datasketches-cpp/filters/CMakeLists.txt
127
+ - vendor/datasketches-cpp/filters/include/bit_array_ops.hpp
128
+ - vendor/datasketches-cpp/filters/include/bloom_filter.hpp
129
+ - vendor/datasketches-cpp/filters/include/bloom_filter_builder_impl.hpp
130
+ - vendor/datasketches-cpp/filters/include/bloom_filter_impl.hpp
131
+ - vendor/datasketches-cpp/filters/test/CMakeLists.txt
132
+ - vendor/datasketches-cpp/filters/test/bit_array_ops_test.cpp
133
+ - vendor/datasketches-cpp/filters/test/bloom_filter_allocation_test.cpp
134
+ - vendor/datasketches-cpp/filters/test/bloom_filter_deserialize_from_java_test.cpp
135
+ - vendor/datasketches-cpp/filters/test/bloom_filter_serialize_for_java.cpp
136
+ - vendor/datasketches-cpp/filters/test/bloom_filter_test.cpp
127
137
  - vendor/datasketches-cpp/hll/CMakeLists.txt
128
138
  - vendor/datasketches-cpp/hll/include/AuxHashMap-internal.hpp
129
139
  - vendor/datasketches-cpp/hll/include/AuxHashMap.hpp
@@ -319,7 +329,6 @@ homepage: https://github.com/ankane/datasketches-ruby
319
329
  licenses:
320
330
  - Apache-2.0
321
331
  metadata: {}
322
- post_install_message:
323
332
  rdoc_options: []
324
333
  require_paths:
325
334
  - lib
@@ -334,8 +343,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
334
343
  - !ruby/object:Gem::Version
335
344
  version: '0'
336
345
  requirements: []
337
- rubygems_version: 3.5.11
338
- signing_key:
346
+ rubygems_version: 3.6.2
339
347
  specification_version: 4
340
348
  summary: Sketch data structures for Ruby
341
349
  test_files: []