Skip to content

Commit

Permalink
Merge pull request #59 from ava57r/pretransform-1
Browse files Browse the repository at this point in the history
improve PreTransformIndex
  • Loading branch information
Enet4 authored Oct 19, 2022
2 parents 05031d0 + d3fbfcb commit 38eaab6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/index/ivf_flat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
11 changes: 11 additions & 0 deletions src/index/pretransform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ where
})
}
}

pub fn prepend_transform<LT: NativeVectorTransform>(&mut self, ltrans: LT) -> Result<()> {
unsafe {
faiss_try(faiss_IndexPreTransform_prepend_transform(
self.inner,
ltrans.inner_ptr(),
))?;

Ok(())
}
}
}

impl IndexImpl {
Expand Down

0 comments on commit 38eaab6

Please sign in to comment.