pub struct KernelMatrixCache { /* private fields */ }Expand description
Kernel matrix cache for efficient matrix operations
Stores entire kernel matrices to avoid recomputation.
§Example
use tensorlogic_sklears_kernels::{LinearKernel, KernelMatrixCache};
let kernel = LinearKernel::new();
let mut cache = KernelMatrixCache::new();
let data = vec![
vec![1.0, 2.0],
vec![3.0, 4.0],
vec![5.0, 6.0],
];
// Compute and cache
let matrix1 = cache.get_or_compute(&data, &kernel).unwrap();
// Retrieve from cache
let matrix2 = cache.get_or_compute(&data, &kernel).unwrap();
assert_eq!(matrix1.len(), matrix2.len());Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KernelMatrixCache
impl RefUnwindSafe for KernelMatrixCache
impl Send for KernelMatrixCache
impl Sync for KernelMatrixCache
impl Unpin for KernelMatrixCache
impl UnwindSafe for KernelMatrixCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more