pub struct SamplerDatasetOptions {
pub replace_samples: bool,
pub size_config: SizeConfig,
pub rng_source: RngSource,
}Expand description
Options to configure a SamplerDataset.
Fields§
§replace_samples: boolThe sampling mode.
size_config: SizeConfigThe size source of the wrapper relative to the dataset.
rng_source: RngSourceThe source of the random number generator.
Implementations§
Source§impl SamplerDatasetOptions
impl SamplerDatasetOptions
Sourcepub fn with_replace_samples(self, replace_samples: bool) -> Self
pub fn with_replace_samples(self, replace_samples: bool) -> Self
Set the replacement mode.
Sourcepub fn with_replacement(self) -> Self
pub fn with_replacement(self) -> Self
Set the replacement mode to WithReplacement.
Sourcepub fn without_replacement(self) -> Self
pub fn without_replacement(self) -> Self
Set the replacement mode to WithoutReplacement.
Sourcepub fn with_size<S>(self, source: S) -> Selfwhere
S: Into<SizeConfig>,
pub fn with_size<S>(self, source: S) -> Selfwhere
S: Into<SizeConfig>,
Set the size source.
Sourcepub fn with_source_size(self) -> Self
pub fn with_source_size(self) -> Self
Set the size to the size of the source.
Sourcepub fn with_fixed_size(self, size: usize) -> Self
pub fn with_fixed_size(self, size: usize) -> Self
Set the size to a fixed size.
Sourcepub fn with_size_ratio(self, size_ratio: f64) -> Self
pub fn with_size_ratio(self, size_ratio: f64) -> Self
Set the size to be a multiple of the ration and the source size.
Sourcepub fn with_system_rng(self) -> Self
pub fn with_system_rng(self) -> Self
Use the system rng.
Trait Implementations§
Source§impl Clone for SamplerDatasetOptions
impl Clone for SamplerDatasetOptions
Source§fn clone(&self) -> SamplerDatasetOptions
fn clone(&self) -> SamplerDatasetOptions
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 SamplerDatasetOptions
impl Debug for SamplerDatasetOptions
Source§impl Default for SamplerDatasetOptions
impl Default for SamplerDatasetOptions
Source§impl<T> From<Option<T>> for SamplerDatasetOptionswhere
T: Into<SamplerDatasetOptions>,
impl<T> From<Option<T>> for SamplerDatasetOptionswhere
T: Into<SamplerDatasetOptions>,
Source§impl From<usize> for SamplerDatasetOptions
impl From<usize> for SamplerDatasetOptions
Source§impl PartialEq for SamplerDatasetOptions
impl PartialEq for SamplerDatasetOptions
impl StructuralPartialEq for SamplerDatasetOptions
Auto Trait Implementations§
impl Freeze for SamplerDatasetOptions
impl RefUnwindSafe for SamplerDatasetOptions
impl Send for SamplerDatasetOptions
impl Sync for SamplerDatasetOptions
impl Unpin for SamplerDatasetOptions
impl UnwindSafe for SamplerDatasetOptions
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