Skip to content

Commit

Permalink
Merge pull request #17 from ava57r/ivf
Browse files Browse the repository at this point in the history
[faiss v1.7.1] Added high-level IVFFlatIndex impl
  • Loading branch information
Enet4 committed Jun 3, 2021
2 parents c872866 + 06a6063 commit b9f95ea
Show file tree
Hide file tree
Showing 3 changed files with 390 additions and 7 deletions.
41 changes: 34 additions & 7 deletions faiss-sys/src/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,18 +694,39 @@ extern "C" {
index: *mut FaissIndexFlat1D,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct FaissIndexIVFFlat_H {
_unused: [u8; 0],
}
pub type FaissIndexIVFFlat = FaissIndexIVFFlat_H;
pub type FaissIndexIVFFlat = FaissIndex_H;
extern "C" {
pub fn faiss_IndexIVFFlat_free(obj: *mut FaissIndexIVFFlat);
}
extern "C" {
pub fn faiss_IndexIVFFlat_cast(arg1: *mut FaissIndex) -> *mut FaissIndexIVFFlat;
}
extern "C" {
pub fn faiss_IndexIVFFlat_nprobe(arg1: *const FaissIndexIVFFlat) -> usize;
}
extern "C" {
pub fn faiss_IndexIVFFlat_nlist(arg1: *const FaissIndexIVFFlat) -> usize;
}
extern "C" {
pub fn faiss_IndexIVFFlat_set_nprobe(arg1: *mut FaissIndexIVFFlat, arg2: usize);
}
extern "C" {
pub fn faiss_IndexIVFFlat_quantizer(arg1: *const FaissIndexIVFFlat) -> *mut FaissIndex;
}
extern "C" {
pub fn faiss_IndexIVFFlat_quantizer_trains_alone(
arg1: *const FaissIndexIVFFlat,
) -> ::std::os::raw::c_char;
}
extern "C" {
pub fn faiss_IndexIVFFlat_own_fields(arg1: *const FaissIndexIVFFlat) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn faiss_IndexIVFFlat_set_own_fields(
arg1: *mut FaissIndexIVFFlat,
arg2: ::std::os::raw::c_int,
);
}
extern "C" {
#[doc = " Inverted file with stored vectors. Here the inverted file"]
#[doc = " pre-selects the vectors to be searched, but they are not otherwise"]
Expand Down Expand Up @@ -766,6 +787,9 @@ extern "C" {
extern "C" {
pub fn faiss_IndexIVF_nprobe(arg1: *const FaissIndexIVF) -> usize;
}
extern "C" {
pub fn faiss_IndexIVF_set_nprobe(arg1: *mut FaissIndexIVF, arg2: usize);
}
extern "C" {
pub fn faiss_IndexIVF_quantizer(arg1: *const FaissIndexIVF) -> *mut FaissIndex;
}
Expand All @@ -777,6 +801,9 @@ extern "C" {
extern "C" {
pub fn faiss_IndexIVF_own_fields(arg1: *const FaissIndexIVF) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn faiss_IndexIVF_set_own_fields(arg1: *mut FaissIndexIVF, arg2: ::std::os::raw::c_int);
}
extern "C" {
#[doc = " moves the entries from another dataset to self. On output,"]
#[doc = " other is empty. add_id is added to all moved ids (for"]
Expand Down Expand Up @@ -834,7 +861,7 @@ extern "C" {
pub fn faiss_IndexIVF_get_list_size(index: *const FaissIndexIVF, list_no: usize) -> usize;
}
extern "C" {
#[doc = " intialize a direct map"]
#[doc = " initialize a direct map"]
#[doc = ""]
#[doc = " @param new_maintain_direct_map if true, create a direct map,"]
#[doc = " else clear it"]
Expand Down
Loading

0 comments on commit b9f95ea

Please sign in to comment.