pub struct ComplexEvalCache { /* private fields */ }Expand description
Thread-safe cache for complex number evaluation results.
Used for caching quantum amplitude calculations and complex-valued expression evaluations.
Implementations§
Source§impl ComplexEvalCache
impl ComplexEvalCache
Sourcepub fn with_capacity(max_size: usize) -> Self
pub fn with_capacity(max_size: usize) -> Self
Create a new complex evaluation cache with specified maximum size
Sourcepub fn get_or_compute<F>(
&self,
expr_hash: u64,
params_hash: u64,
compute: F,
) -> Complex64
pub fn get_or_compute<F>( &self, expr_hash: u64, params_hash: u64, compute: F, ) -> Complex64
Get or compute a complex evaluation result
Sourcepub fn get_or_try_compute<F, E>(
&self,
expr_hash: u64,
params_hash: u64,
compute: F,
) -> Result<Complex64, E>
pub fn get_or_try_compute<F, E>( &self, expr_hash: u64, params_hash: u64, compute: F, ) -> Result<Complex64, E>
Get or compute with Result return type
Sourcepub fn stats(&self) -> CacheStats
pub fn stats(&self) -> CacheStats
Get cache statistics
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ComplexEvalCache
impl !RefUnwindSafe for ComplexEvalCache
impl Send for ComplexEvalCache
impl Sync for ComplexEvalCache
impl Unpin for ComplexEvalCache
impl UnwindSafe for ComplexEvalCache
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