pub struct PartitionConfig {
pub chunk_size: usize,
pub max_memory_bytes: Option<usize>,
pub accumulation: AccumulationStrategy,
pub parallel: bool,
pub epsilon: f64,
}Expand description
Configuration for a partitioned reduction.
Fields§
§chunk_size: usizeNumber of elements per partition chunk.
max_memory_bytes: Option<usize>Optional memory budget in bytes.
accumulation: AccumulationStrategyHow to accumulate across chunks.
parallel: boolWhether to run chunks in parallel (placeholder flag; actual parallelism requires a rayon dependency that is not present in this crate).
epsilon: f64Numerical stability epsilon (used in log-sum-exp and division guards).
Implementations§
Source§impl PartitionConfig
impl PartitionConfig
Sourcepub fn new(chunk_size: usize) -> Self
pub fn new(chunk_size: usize) -> Self
Create a new config with the given chunk size and default settings.
Sourcepub fn memory_bounded(max_bytes: usize, element_size: usize) -> Self
pub fn memory_bounded(max_bytes: usize, element_size: usize) -> Self
Derive chunk size from a memory budget and the element size in bytes.
The computed chunk size is max_bytes / element_size, clamped to at
least 1.
Sourcepub fn with_strategy(self, strategy: AccumulationStrategy) -> Self
pub fn with_strategy(self, strategy: AccumulationStrategy) -> Self
Set the accumulation strategy.
Sourcepub fn with_parallel(self, parallel: bool) -> Self
pub fn with_parallel(self, parallel: bool) -> Self
Enable or disable parallel chunk processing.
Sourcepub fn chunks_for_size(&self, total_elements: usize) -> usize
pub fn chunks_for_size(&self, total_elements: usize) -> usize
Return the number of chunks needed to process total_elements elements.
Trait Implementations§
Source§impl Clone for PartitionConfig
impl Clone for PartitionConfig
Source§fn clone(&self) -> PartitionConfig
fn clone(&self) -> PartitionConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PartitionConfig
impl Debug for PartitionConfig
Auto Trait Implementations§
impl Freeze for PartitionConfig
impl RefUnwindSafe for PartitionConfig
impl Send for PartitionConfig
impl Sync for PartitionConfig
impl Unpin for PartitionConfig
impl UnsafeUnpin for PartitionConfig
impl UnwindSafe for PartitionConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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