hnswlib 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/ext/hnswlib/hnswlibext.cpp +1 -2
- data/ext/hnswlib/hnswlibext.hpp +8 -0
- data/lib/hnswlib/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc8a40172623a3439b17c8b1854017c845bf4dc23f4e1714e9427e4b6b701c9b
|
4
|
+
data.tar.gz: 95fa48d791f000bf48809e7067efaba9a654ab0dd517c626f689c66af3668d0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07c449031cc7afbf80803ae15c8094589a146b59b1852ea72e88fcd39067def572bbdd58277e3a85c47c537e8dc6eef645f9f404a2b874e4e217b559adc38054
|
7
|
+
data.tar.gz: 4b71a7f4fe0ffb3c15124e32c9c8fbba9eb6f82e6f0b95f5d91dd35c6b10be8aeba25d7313eabeaa5078b051b3410195415843ecd600b58ec1b0b36532b7ae1d
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## [0.6.2] - 2022-06-25
|
2
|
+
|
3
|
+
- Refactor codes and configs with RuboCop and clang-format.
|
4
|
+
- Change to raise ArgumentError when non-array object is given to distance method.
|
5
|
+
|
1
6
|
## [0.6.1] - 2022-04-30
|
2
7
|
|
3
8
|
- Change the `search_knn` method of `BruteforceSearch` to output warning message instead of rasing RuntimeError
|
data/ext/hnswlib/hnswlibext.cpp
CHANGED
@@ -20,8 +20,7 @@
|
|
20
20
|
|
21
21
|
VALUE rb_mHnswlib;
|
22
22
|
|
23
|
-
extern "C"
|
24
|
-
void Init_hnswlibext(void) {
|
23
|
+
extern "C" void Init_hnswlibext(void) {
|
25
24
|
rb_mHnswlib = rb_define_module("Hnswlib");
|
26
25
|
RbHnswlibL2Space::define_class(rb_mHnswlib);
|
27
26
|
RbHnswlibInnerProductSpace::define_class(rb_mHnswlib);
|
data/ext/hnswlib/hnswlibext.hpp
CHANGED
@@ -70,6 +70,10 @@ private:
|
|
70
70
|
|
71
71
|
static VALUE _hnsw_l2space_distance(VALUE self, VALUE arr_a, VALUE arr_b) {
|
72
72
|
const int dim = NUM2INT(rb_iv_get(self, "@dim"));
|
73
|
+
if (!RB_TYPE_P(arr_a, T_ARRAY) || !RB_TYPE_P(arr_b, T_ARRAY)) {
|
74
|
+
rb_raise(rb_eArgError, "Expect input vector to be Ruby Array.");
|
75
|
+
return Qnil;
|
76
|
+
}
|
73
77
|
if (dim != RARRAY_LEN(arr_a) || dim != RARRAY_LEN(arr_b)) {
|
74
78
|
rb_raise(rb_eArgError, "Array size does not match to space dimensionality.");
|
75
79
|
return Qnil;
|
@@ -142,6 +146,10 @@ private:
|
|
142
146
|
|
143
147
|
static VALUE _hnsw_ipspace_distance(VALUE self, VALUE arr_a, VALUE arr_b) {
|
144
148
|
const int dim = NUM2INT(rb_iv_get(self, "@dim"));
|
149
|
+
if (!RB_TYPE_P(arr_a, T_ARRAY) || !RB_TYPE_P(arr_b, T_ARRAY)) {
|
150
|
+
rb_raise(rb_eArgError, "Expect input vector to be Ruby Array.");
|
151
|
+
return Qnil;
|
152
|
+
}
|
145
153
|
if (dim != RARRAY_LEN(arr_a) || dim != RARRAY_LEN(arr_b)) {
|
146
154
|
rb_raise(rb_eArgError, "Array size does not match to space dimensionality.");
|
147
155
|
return Qnil;
|
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.6.
|
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.
|