diff --git a/src/index/ivf_flat.rs b/src/index/ivf_flat.rs index e710162..05e2993 100644 --- a/src/index/ivf_flat.rs +++ b/src/index/ivf_flat.rs @@ -5,7 +5,7 @@ use super::*; use crate::error::Result; use crate::faiss_try; use std::mem; -use std::os::raw::{c_int, c_char}; +use std::os::raw::{c_char, c_int}; use std::ptr; /// Alias for the native implementation of a flat index. diff --git a/src/index/pretransform.rs b/src/index/pretransform.rs index eaa6255..5e706f9 100644 --- a/src/index/pretransform.rs +++ b/src/index/pretransform.rs @@ -64,6 +64,17 @@ where }) } } + + pub fn prepend_transform(&mut self, ltrans: LT) -> Result<()> { + unsafe { + faiss_try(faiss_IndexPreTransform_prepend_transform( + self.inner, + ltrans.inner_ptr(), + ))?; + + Ok(()) + } + } } impl IndexImpl {