pub struct CachedKernel { /* private fields */ }Expand description
Cached kernel wrapper that automatically handles caching
Implementations§
Source§impl CachedKernel
impl CachedKernel
Sourcepub fn new(
kernel: Box<dyn Kernel>,
cache: Arc<dyn ThreadSafeKernelCache>,
) -> Self
pub fn new( kernel: Box<dyn Kernel>, cache: Arc<dyn ThreadSafeKernelCache>, ) -> Self
Create a new cached kernel
Sourcepub fn compute_by_indices(&self, i: usize, j: usize) -> Result<Float>
pub fn compute_by_indices(&self, i: usize, j: usize) -> Result<Float>
Compute kernel value with caching by indices
Sourcepub fn cache_stats(&self) -> CacheStatistics
pub fn cache_stats(&self) -> CacheStatistics
Get cache statistics
Sourcepub fn clear_cache(&self)
pub fn clear_cache(&self)
Clear cache
Trait Implementations§
Source§impl Debug for CachedKernel
impl Debug for CachedKernel
Auto Trait Implementations§
impl !RefUnwindSafe for CachedKernel
impl !UnwindSafe for CachedKernel
impl Freeze for CachedKernel
impl Send for CachedKernel
impl Sync for CachedKernel
impl Unpin for CachedKernel
impl UnsafeUnpin for CachedKernel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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