hnswlib 0.5.3 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/README.md +2 -2
- data/ext/hnswlib/hnswlibext.cpp +1 -2
- data/ext/hnswlib/hnswlibext.hpp +568 -576
- data/ext/hnswlib/src/bruteforce.h +5 -1
- data/ext/hnswlib/src/hnswalg.h +8 -7
- data/lib/hnswlib/version.rb +1 -1
- metadata +4 -3
@@ -29,7 +29,7 @@ namespace hnswlib {
|
|
29
29
|
}
|
30
30
|
|
31
31
|
~BruteforceSearch() {
|
32
|
-
free(data_);
|
32
|
+
if (data_) free(data_);
|
33
33
|
}
|
34
34
|
|
35
35
|
char *data_;
|
@@ -129,6 +129,10 @@ namespace hnswlib {
|
|
129
129
|
|
130
130
|
|
131
131
|
std::ifstream input(location, std::ios::binary);
|
132
|
+
|
133
|
+
if (!input.is_open())
|
134
|
+
throw std::runtime_error("Cannot open file");
|
135
|
+
|
132
136
|
std::streampos position;
|
133
137
|
|
134
138
|
readBinaryPOD(input, maxelements_);
|
data/ext/hnswlib/src/hnswalg.h
CHANGED
@@ -76,14 +76,15 @@ namespace hnswlib {
|
|
76
76
|
};
|
77
77
|
|
78
78
|
~HierarchicalNSW() {
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
79
|
+
if (data_level0_memory_) free(data_level0_memory_);
|
80
|
+
if (linkLists_) {
|
81
|
+
for (tableint i = 0; i < cur_element_count; i++) {
|
82
|
+
if (element_levels_[i] > 0)
|
83
|
+
if (linkLists_[i]) free(linkLists_[i]);
|
84
|
+
}
|
85
|
+
free(linkLists_);
|
84
86
|
}
|
85
|
-
|
86
|
-
delete visited_list_pool_;
|
87
|
+
if (visited_list_pool_) delete visited_list_pool_;
|
87
88
|
}
|
88
89
|
|
89
90
|
size_t max_elements_;
|
data/lib/hnswlib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hnswlib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yoshoku
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Hnswlib.rb provides Ruby bindings for the Hnswlib.
|
14
14
|
email:
|
@@ -41,6 +41,7 @@ metadata:
|
|
41
41
|
homepage_uri: https://github.com/yoshoku/hnswlib.rb
|
42
42
|
source_code_uri: https://github.com/yoshoku/hnswlib.rb
|
43
43
|
changelog_uri: https://github.com/yoshoku/hnswlib.rb/blob/main/CHANGELOG.md
|
44
|
+
rubygems_mfa_required: 'true'
|
44
45
|
post_install_message:
|
45
46
|
rdoc_options: []
|
46
47
|
require_paths:
|
@@ -56,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
57
|
- !ruby/object:Gem::Version
|
57
58
|
version: '0'
|
58
59
|
requirements: []
|
59
|
-
rubygems_version: 3.
|
60
|
+
rubygems_version: 3.2.33
|
60
61
|
signing_key:
|
61
62
|
specification_version: 4
|
62
63
|
summary: Ruby bindings for the Hnswlib.
|