Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
Signed-off-by: Keming <[email protected]>
  • Loading branch information
kemingy committed Jul 23, 2024
2 parents 7bbd3c6 + 9667902 commit 72c791e
Show file tree
Hide file tree
Showing 40 changed files with 164 additions and 2,225 deletions.
3 changes: 0 additions & 3 deletions crates/base/src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,6 @@ impl VectorOptions {
(VectorKind::BVecf32, DistanceKind::Cos, 1..65536) => Ok(()),
(VectorKind::BVecf32, DistanceKind::Dot, 1..65536) => Ok(()),
(VectorKind::BVecf32, DistanceKind::Jaccard, 1..65536) => Ok(()),
(VectorKind::Veci8, DistanceKind::L2, 1..65536) => Ok(()),
(VectorKind::Veci8, DistanceKind::Cos, 1..65536) => Ok(()),
(VectorKind::Veci8, DistanceKind::Dot, 1..65536) => Ok(()),
_ => Err(ValidationError::new("not valid vector options")),
}
}
Expand Down
6 changes: 0 additions & 6 deletions crates/base/src/operator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ mod vecf16_l2;
mod vecf32_cos;
mod vecf32_dot;
mod vecf32_l2;
mod veci8_cos;
mod veci8_dot;
mod veci8_l2;

pub use bvecf32_cos::BVecf32Cos;
pub use bvecf32_dot::BVecf32Dot;
Expand All @@ -28,9 +25,6 @@ pub use vecf16_l2::Vecf16L2;
pub use vecf32_cos::Vecf32Cos;
pub use vecf32_dot::Vecf32Dot;
pub use vecf32_l2::Vecf32L2;
pub use veci8_cos::Veci8Cos;
pub use veci8_dot::Veci8Dot;
pub use veci8_l2::Veci8L2;

use crate::distance::*;
use crate::scalar::*;
Expand Down
17 changes: 0 additions & 17 deletions crates/base/src/operator/veci8_cos.rs

This file was deleted.

17 changes: 0 additions & 17 deletions crates/base/src/operator/veci8_dot.rs

This file was deleted.

17 changes: 0 additions & 17 deletions crates/base/src/operator/veci8_l2.rs

This file was deleted.

8 changes: 0 additions & 8 deletions crates/base/src/vector/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ pub mod bvecf32;
pub mod svecf32;
pub mod vecf16;
pub mod vecf32;
pub mod veci8;

pub use bvecf32::{BVecf32Borrowed, BVecf32Owned, BVECF32_WIDTH};
pub use svecf32::{SVecf32Borrowed, SVecf32Owned};
pub use vecf16::{Vecf16Borrowed, Vecf16Owned};
pub use vecf32::{Vecf32Borrowed, Vecf32Owned};
pub use veci8::{Veci8Borrowed, Veci8Owned};

use crate::scalar::ScalarLike;
use crate::scalar::F32;
Expand All @@ -22,7 +20,6 @@ pub enum VectorKind {
Vecf16,
SVecf32,
BVecf32,
Veci8,
}

pub trait VectorOwned: Clone + Serialize + for<'a> Deserialize<'a> + 'static {
Expand Down Expand Up @@ -71,7 +68,6 @@ pub enum OwnedVector {
Vecf16(Vecf16Owned),
SVecf32(SVecf32Owned),
BVecf32(BVecf32Owned),
Veci8(Veci8Owned),
}

impl OwnedVector {
Expand All @@ -81,7 +77,6 @@ impl OwnedVector {
OwnedVector::Vecf16(x) => BorrowedVector::Vecf16(x.as_borrowed()),
OwnedVector::SVecf32(x) => BorrowedVector::SVecf32(x.as_borrowed()),
OwnedVector::BVecf32(x) => BorrowedVector::BVecf32(x.as_borrowed()),
OwnedVector::Veci8(x) => BorrowedVector::Veci8(x.as_borrowed()),
}
}
}
Expand All @@ -104,7 +99,6 @@ pub enum BorrowedVector<'a> {
Vecf16(Vecf16Borrowed<'a>),
SVecf32(SVecf32Borrowed<'a>),
BVecf32(BVecf32Borrowed<'a>),
Veci8(Veci8Borrowed<'a>),
}

impl PartialEq for BorrowedVector<'_> {
Expand All @@ -115,7 +109,6 @@ impl PartialEq for BorrowedVector<'_> {
(Vecf16(lhs), Vecf16(rhs)) => lhs == rhs,
(SVecf32(lhs), SVecf32(rhs)) => lhs == rhs,
(BVecf32(lhs), BVecf32(rhs)) => lhs == rhs,
(Veci8(lhs), Veci8(rhs)) => lhs == rhs,
_ => false,
}
}
Expand All @@ -129,7 +122,6 @@ impl PartialOrd for BorrowedVector<'_> {
(Vecf16(lhs), Vecf16(rhs)) => lhs.partial_cmp(rhs),
(SVecf32(lhs), SVecf32(rhs)) => lhs.partial_cmp(rhs),
(BVecf32(lhs), BVecf32(rhs)) => lhs.partial_cmp(rhs),
(Veci8(lhs), Veci8(rhs)) => lhs.partial_cmp(rhs),
_ => None,
}
}
Expand Down
Loading

0 comments on commit 72c791e

Please sign in to comment.