faiss 0.5.1 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 439ff96f613cd71e2a32197194d3814cf5ea516bd31489fdc2bd7a98747ec8ff
4
- data.tar.gz: b2eaf07886acc74aaee4e6f1956a8c09f1d76da0ebaca14b6d4f3e889d728ef7
3
+ metadata.gz: 8ab397b95262fa87d28a4f08098de35f487b44e6240682ec8e98c4efc823c4df
4
+ data.tar.gz: 719490d3f20bad4531f588e9469d3fa9ec2362cc18f800e913725ffb6b0aeca0
5
5
  SHA512:
6
- metadata.gz: 03d9a8aa01c86c176437adfab3038b91eb9b9991b2446f4b442114fac8e16133f213eec779d8bdedf80f13c643e96ec2ae39cfa9e1de4313148d53efa565d5c8
7
- data.tar.gz: aa3ef7993a7411cbd480134e054528f069931c57ec55a8dd74c33642fa9debf203507f5744fa1ad178c04d142ac6efd482d63e6df1ced32e890fedd1def73769
6
+ metadata.gz: 56e16fad10a1ba95c9727f2e356470e984ca29b44406cf125b1ab529c83fee2c9bf15efa564a543cda331489dbdc56c9c44f4eda4ad53178979370987b6fbf9e
7
+ data.tar.gz: 691e9a843eaac7e699dafc15d5505f6febf783ae6d474ee0409cb01d1b1f1575477db13cb7290a4d2cc639692503099fa7d4ff767d3c3034838d05ea0476521a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.5.2 (2026-01-02)
2
+
3
+ - Fixed error with Rice 4.8
4
+
1
5
  ## 0.5.1 (2025-12-20)
2
6
 
3
7
  - Updated Faiss to 1.13.2
data/ext/faiss/index.cpp CHANGED
@@ -31,13 +31,9 @@ namespace Rice::detail {
31
31
 
32
32
  explicit From_Ruby(Arg* arg) : arg_(arg) { }
33
33
 
34
- Convertible is_convertible(VALUE value) { return Convertible::Cast; }
34
+ double is_convertible(VALUE value) { return Convertible::Exact; }
35
35
 
36
36
  faiss::MetricType convert(VALUE x) {
37
- if (x == Qnil && this->arg_ && this->arg_->hasDefaultValue()) {
38
- return this->arg_->defaultValue<faiss::MetricType>();
39
- }
40
-
41
37
  auto s = Object(x).to_s().str();
42
38
  if (s == "inner_product") {
43
39
  return faiss::METRIC_INNER_PRODUCT;
@@ -64,7 +60,7 @@ namespace Rice::detail {
64
60
 
65
61
  explicit From_Ruby(Arg* arg) : arg_(arg) { }
66
62
 
67
- Convertible is_convertible(VALUE value) { return Convertible::Cast; }
63
+ double is_convertible(VALUE value) { return Convertible::Exact; }
68
64
 
69
65
  faiss::ScalarQuantizer::QuantizerType convert(VALUE x) {
70
66
  auto s = Object(x).to_s().str();
@@ -195,10 +191,12 @@ void init_index(Rice::Module& m) {
195
191
  .define_constructor(Rice::Constructor<faiss::IndexFlatIP, int64_t>());
196
192
 
197
193
  Rice::define_class_under<faiss::IndexHNSWFlat, faiss::Index>(m, "IndexHNSWFlat")
198
- .define_constructor(Rice::Constructor<faiss::IndexHNSWFlat, int, int, faiss::MetricType>(), Rice::Arg("_d"), Rice::Arg("_M"), Rice::Arg("_metric") = faiss::METRIC_L2);
194
+ .define_constructor(Rice::Constructor<faiss::IndexHNSWFlat, int, int>())
195
+ .define_constructor(Rice::Constructor<faiss::IndexHNSWFlat, int, int, faiss::MetricType>());
199
196
 
200
197
  Rice::define_class_under<faiss::IndexIVFFlat, faiss::Index>(m, "IndexIVFFlat")
201
- .define_constructor(Rice::Constructor<faiss::IndexIVFFlat, faiss::Index*, size_t, size_t, faiss::MetricType>(), Rice::Arg("_quantizer"), Rice::Arg("_d"), Rice::Arg("_nlist"), Rice::Arg("_metric") = faiss::METRIC_L2);
198
+ .define_constructor(Rice::Constructor<faiss::IndexIVFFlat, faiss::Index*, size_t, size_t>())
199
+ .define_constructor(Rice::Constructor<faiss::IndexIVFFlat, faiss::Index*, size_t, size_t, faiss::MetricType>());
202
200
 
203
201
  Rice::define_class_under<faiss::IndexLSH, faiss::Index>(m, "IndexLSH")
204
202
  .define_constructor(Rice::Constructor<faiss::IndexLSH, int64_t, int>());
@@ -213,7 +211,8 @@ void init_index(Rice::Module& m) {
213
211
  .define_constructor(Rice::Constructor<faiss::IndexIVFScalarQuantizer, faiss::Index*, size_t, size_t, faiss::ScalarQuantizer::QuantizerType>());
214
212
 
215
213
  Rice::define_class_under<faiss::IndexIVFPQ, faiss::Index>(m, "IndexIVFPQ")
216
- .define_constructor(Rice::Constructor<faiss::IndexIVFPQ, faiss::Index*, size_t, size_t, size_t, size_t, faiss::MetricType>(), Rice::Arg("_quantizer"), Rice::Arg("_d"), Rice::Arg("_nlist"), Rice::Arg("_M"), Rice::Arg("_nbits_per_idx"), Rice::Arg("_metric") = faiss::METRIC_L2);
214
+ .define_constructor(Rice::Constructor<faiss::IndexIVFPQ, faiss::Index*, size_t, size_t, size_t, size_t>())
215
+ .define_constructor(Rice::Constructor<faiss::IndexIVFPQ, faiss::Index*, size_t, size_t, size_t, size_t, faiss::MetricType>());
217
216
 
218
217
  Rice::define_class_under<faiss::IndexIVFPQR, faiss::Index>(m, "IndexIVFPQR")
219
218
  .define_constructor(Rice::Constructor<faiss::IndexIVFPQR, faiss::Index*, size_t, size_t, size_t, size_t, size_t, size_t>());
data/ext/faiss/numo.hpp CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Numo.hpp v0.2.1
2
+ * Numo.hpp v0.3.0
3
3
  * https://github.com/ankane/numo.hpp
4
4
  * BSD-2-Clause License
5
5
  */
@@ -460,12 +460,12 @@ public:
460
460
 
461
461
  explicit From_Ruby(Arg* arg) : arg_(arg) { }
462
462
 
463
- Convertible is_convertible(VALUE value) {
463
+ double is_convertible(VALUE value) {
464
464
  switch (rb_type(value)) {
465
465
  case RUBY_T_DATA:
466
466
  return Data_Type<numo::NArray>::is_descendant(value) ? Convertible::Exact : Convertible::None;
467
467
  case RUBY_T_ARRAY:
468
- return Convertible::Cast;
468
+ return Convertible::Exact;
469
469
  default:
470
470
  return Convertible::None;
471
471
  }
@@ -506,12 +506,12 @@ public:
506
506
 
507
507
  explicit From_Ruby(Arg* arg) : arg_(arg) { }
508
508
 
509
- Convertible is_convertible(VALUE value) {
509
+ double is_convertible(VALUE value) {
510
510
  switch (rb_type(value)) {
511
511
  case RUBY_T_DATA:
512
512
  return Data_Type<numo::SFloat>::is_descendant(value) ? Convertible::Exact : Convertible::None;
513
513
  case RUBY_T_ARRAY:
514
- return Convertible::Cast;
514
+ return Convertible::Exact;
515
515
  default:
516
516
  return Convertible::None;
517
517
  }
@@ -552,12 +552,12 @@ public:
552
552
 
553
553
  explicit From_Ruby(Arg* arg) : arg_(arg) { }
554
554
 
555
- Convertible is_convertible(VALUE value) {
555
+ double is_convertible(VALUE value) {
556
556
  switch (rb_type(value)) {
557
557
  case RUBY_T_DATA:
558
558
  return Data_Type<numo::DFloat>::is_descendant(value) ? Convertible::Exact : Convertible::None;
559
559
  case RUBY_T_ARRAY:
560
- return Convertible::Cast;
560
+ return Convertible::Exact;
561
561
  default:
562
562
  return Convertible::None;
563
563
  }
@@ -598,12 +598,12 @@ public:
598
598
 
599
599
  explicit From_Ruby(Arg* arg) : arg_(arg) { }
600
600
 
601
- Convertible is_convertible(VALUE value) {
601
+ double is_convertible(VALUE value) {
602
602
  switch (rb_type(value)) {
603
603
  case RUBY_T_DATA:
604
604
  return Data_Type<numo::Int8>::is_descendant(value) ? Convertible::Exact : Convertible::None;
605
605
  case RUBY_T_ARRAY:
606
- return Convertible::Cast;
606
+ return Convertible::Exact;
607
607
  default:
608
608
  return Convertible::None;
609
609
  }
@@ -644,12 +644,12 @@ public:
644
644
 
645
645
  explicit From_Ruby(Arg* arg) : arg_(arg) { }
646
646
 
647
- Convertible is_convertible(VALUE value) {
647
+ double is_convertible(VALUE value) {
648
648
  switch (rb_type(value)) {
649
649
  case RUBY_T_DATA:
650
650
  return Data_Type<numo::Int16>::is_descendant(value) ? Convertible::Exact : Convertible::None;
651
651
  case RUBY_T_ARRAY:
652
- return Convertible::Cast;
652
+ return Convertible::Exact;
653
653
  default:
654
654
  return Convertible::None;
655
655
  }
@@ -690,12 +690,12 @@ public:
690
690
 
691
691
  explicit From_Ruby(Arg* arg) : arg_(arg) { }
692
692
 
693
- Convertible is_convertible(VALUE value) {
693
+ double is_convertible(VALUE value) {
694
694
  switch (rb_type(value)) {
695
695
  case RUBY_T_DATA:
696
696
  return Data_Type<numo::Int32>::is_descendant(value) ? Convertible::Exact : Convertible::None;
697
697
  case RUBY_T_ARRAY:
698
- return Convertible::Cast;
698
+ return Convertible::Exact;
699
699
  default:
700
700
  return Convertible::None;
701
701
  }
@@ -736,12 +736,12 @@ public:
736
736
 
737
737
  explicit From_Ruby(Arg* arg) : arg_(arg) { }
738
738
 
739
- Convertible is_convertible(VALUE value) {
739
+ double is_convertible(VALUE value) {
740
740
  switch (rb_type(value)) {
741
741
  case RUBY_T_DATA:
742
742
  return Data_Type<numo::Int64>::is_descendant(value) ? Convertible::Exact : Convertible::None;
743
743
  case RUBY_T_ARRAY:
744
- return Convertible::Cast;
744
+ return Convertible::Exact;
745
745
  default:
746
746
  return Convertible::None;
747
747
  }
@@ -782,12 +782,12 @@ public:
782
782
 
783
783
  explicit From_Ruby(Arg* arg) : arg_(arg) { }
784
784
 
785
- Convertible is_convertible(VALUE value) {
785
+ double is_convertible(VALUE value) {
786
786
  switch (rb_type(value)) {
787
787
  case RUBY_T_DATA:
788
788
  return Data_Type<numo::UInt8>::is_descendant(value) ? Convertible::Exact : Convertible::None;
789
789
  case RUBY_T_ARRAY:
790
- return Convertible::Cast;
790
+ return Convertible::Exact;
791
791
  default:
792
792
  return Convertible::None;
793
793
  }
@@ -828,12 +828,12 @@ public:
828
828
 
829
829
  explicit From_Ruby(Arg* arg) : arg_(arg) { }
830
830
 
831
- Convertible is_convertible(VALUE value) {
831
+ double is_convertible(VALUE value) {
832
832
  switch (rb_type(value)) {
833
833
  case RUBY_T_DATA:
834
834
  return Data_Type<numo::UInt16>::is_descendant(value) ? Convertible::Exact : Convertible::None;
835
835
  case RUBY_T_ARRAY:
836
- return Convertible::Cast;
836
+ return Convertible::Exact;
837
837
  default:
838
838
  return Convertible::None;
839
839
  }
@@ -874,12 +874,12 @@ public:
874
874
 
875
875
  explicit From_Ruby(Arg* arg) : arg_(arg) { }
876
876
 
877
- Convertible is_convertible(VALUE value) {
877
+ double is_convertible(VALUE value) {
878
878
  switch (rb_type(value)) {
879
879
  case RUBY_T_DATA:
880
880
  return Data_Type<numo::UInt32>::is_descendant(value) ? Convertible::Exact : Convertible::None;
881
881
  case RUBY_T_ARRAY:
882
- return Convertible::Cast;
882
+ return Convertible::Exact;
883
883
  default:
884
884
  return Convertible::None;
885
885
  }
@@ -920,12 +920,12 @@ public:
920
920
 
921
921
  explicit From_Ruby(Arg* arg) : arg_(arg) { }
922
922
 
923
- Convertible is_convertible(VALUE value) {
923
+ double is_convertible(VALUE value) {
924
924
  switch (rb_type(value)) {
925
925
  case RUBY_T_DATA:
926
926
  return Data_Type<numo::UInt64>::is_descendant(value) ? Convertible::Exact : Convertible::None;
927
927
  case RUBY_T_ARRAY:
928
- return Convertible::Cast;
928
+ return Convertible::Exact;
929
929
  default:
930
930
  return Convertible::None;
931
931
  }
@@ -966,12 +966,12 @@ public:
966
966
 
967
967
  explicit From_Ruby(Arg* arg) : arg_(arg) { }
968
968
 
969
- Convertible is_convertible(VALUE value) {
969
+ double is_convertible(VALUE value) {
970
970
  switch (rb_type(value)) {
971
971
  case RUBY_T_DATA:
972
972
  return Data_Type<numo::SComplex>::is_descendant(value) ? Convertible::Exact : Convertible::None;
973
973
  case RUBY_T_ARRAY:
974
- return Convertible::Cast;
974
+ return Convertible::Exact;
975
975
  default:
976
976
  return Convertible::None;
977
977
  }
@@ -1012,12 +1012,12 @@ public:
1012
1012
 
1013
1013
  explicit From_Ruby(Arg* arg) : arg_(arg) { }
1014
1014
 
1015
- Convertible is_convertible(VALUE value) {
1015
+ double is_convertible(VALUE value) {
1016
1016
  switch (rb_type(value)) {
1017
1017
  case RUBY_T_DATA:
1018
1018
  return Data_Type<numo::DComplex>::is_descendant(value) ? Convertible::Exact : Convertible::None;
1019
1019
  case RUBY_T_ARRAY:
1020
- return Convertible::Cast;
1020
+ return Convertible::Exact;
1021
1021
  default:
1022
1022
  return Convertible::None;
1023
1023
  }
@@ -1058,12 +1058,12 @@ public:
1058
1058
 
1059
1059
  explicit From_Ruby(Arg* arg) : arg_(arg) { }
1060
1060
 
1061
- Convertible is_convertible(VALUE value) {
1061
+ double is_convertible(VALUE value) {
1062
1062
  switch (rb_type(value)) {
1063
1063
  case RUBY_T_DATA:
1064
1064
  return Data_Type<numo::Bit>::is_descendant(value) ? Convertible::Exact : Convertible::None;
1065
1065
  case RUBY_T_ARRAY:
1066
- return Convertible::Cast;
1066
+ return Convertible::Exact;
1067
1067
  default:
1068
1068
  return Convertible::None;
1069
1069
  }
@@ -1104,12 +1104,12 @@ public:
1104
1104
 
1105
1105
  explicit From_Ruby(Arg* arg) : arg_(arg) { }
1106
1106
 
1107
- Convertible is_convertible(VALUE value) {
1107
+ double is_convertible(VALUE value) {
1108
1108
  switch (rb_type(value)) {
1109
1109
  case RUBY_T_DATA:
1110
1110
  return Data_Type<numo::RObject>::is_descendant(value) ? Convertible::Exact : Convertible::None;
1111
1111
  case RUBY_T_ARRAY:
1112
- return Convertible::Cast;
1112
+ return Convertible::Exact;
1113
1113
  default:
1114
1114
  return Convertible::None;
1115
1115
  }
data/lib/faiss/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Faiss
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faiss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '4.7'
18
+ version: '4.8'
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: '4.7'
25
+ version: '4.8'
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: numo-narray
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -407,7 +407,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
407
407
  - !ruby/object:Gem::Version
408
408
  version: '0'
409
409
  requirements: []
410
- rubygems_version: 3.6.9
410
+ rubygems_version: 4.0.3
411
411
  specification_version: 4
412
412
  summary: Efficient similarity search and clustering for Ruby
413
413
  test_files: []