pub struct AdvancedMemoryPool { /* private fields */ }Expand description
✅ Advanced MODE: Advanced memory pool for fast processing This provides cache-efficient memory management for repeated transformations
Implementations§
Source§impl AdvancedMemoryPool
impl AdvancedMemoryPool
Sourcepub fn new(
max_matrices: usize,
max_vectors: usize,
initialcapacity: usize,
) -> Self
pub fn new( max_matrices: usize, max_vectors: usize, initialcapacity: usize, ) -> Self
Create a new memory pool with specified limits
Sourcepub fn get_matrix(&mut self, rows: usize, cols: usize) -> Array2<f64>
pub fn get_matrix(&mut self, rows: usize, cols: usize) -> Array2<f64>
✅ Advanced OPTIMIZATION: Get matrix from pool or allocate new one
Sourcepub fn get_vector(&mut self, size: usize) -> Array1<f64>
pub fn get_vector(&mut self, size: usize) -> Array1<f64>
✅ Advanced OPTIMIZATION: Get vector from pool or allocate new one
Sourcepub fn return_matrix(&mut self, matrix: Array2<f64>)
pub fn return_matrix(&mut self, matrix: Array2<f64>)
✅ Advanced OPTIMIZATION: Return matrix to pool for reuse
Sourcepub fn return_vector(&mut self, vector: Array1<f64>)
pub fn return_vector(&mut self, vector: Array1<f64>)
✅ Advanced OPTIMIZATION: Return vector to pool for reuse
Sourcepub fn efficiency(&self) -> f64
pub fn efficiency(&self) -> f64
✅ Advanced OPTIMIZATION: Get pool efficiency (hit rate)
Sourcepub fn update_stats(&mut self, transform_time_ns: u64, samplesprocessed: usize)
pub fn update_stats(&mut self, transform_time_ns: u64, samplesprocessed: usize)
Update performance statistics
Sourcepub fn adaptive_resize(&mut self)
pub fn adaptive_resize(&mut self)
✅ Advanced OPTIMIZATION: Adaptive pool resizing based on usage patterns
Sourcepub fn get_array(&mut self, rows: usize, cols: usize) -> Array2<f64>
pub fn get_array(&mut self, rows: usize, cols: usize) -> Array2<f64>
Get array from pool (alias for get_matrix)
Sourcepub fn return_array(&mut self, array: Array2<f64>)
pub fn return_array(&mut self, array: Array2<f64>)
Return array to pool (alias for return_matrix)
Sourcepub fn get_temp_array(&mut self, size: usize) -> Array1<f64>
pub fn get_temp_array(&mut self, size: usize) -> Array1<f64>
Get temporary array from pool (alias for get_vector)
Sourcepub fn return_temp_array(&mut self, temp: Array1<f64>)
pub fn return_temp_array(&mut self, temp: Array1<f64>)
Return temporary array to pool (alias for return_vector)
Auto Trait Implementations§
impl Freeze for AdvancedMemoryPool
impl RefUnwindSafe for AdvancedMemoryPool
impl Send for AdvancedMemoryPool
impl Sync for AdvancedMemoryPool
impl Unpin for AdvancedMemoryPool
impl UnsafeUnpin for AdvancedMemoryPool
impl UnwindSafe for AdvancedMemoryPool
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
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.