pub trait HasTruncationParams {
// Required methods
fn truncation_params(&self) -> &TruncationParams;
fn truncation_params_mut(&mut self) -> &mut TruncationParams;
// Provided methods
fn rtol(&self) -> Option<f64> { ... }
fn max_rank(&self) -> Option<usize> { ... }
fn with_rtol(self, rtol: f64) -> Self
where Self: Sized { ... }
fn with_max_rank(self, max_rank: usize) -> Self
where Self: Sized { ... }
fn with_cutoff(self, cutoff: f64) -> Self
where Self: Sized { ... }
fn with_maxdim(self, maxdim: usize) -> Self
where Self: Sized { ... }
fn set_cutoff(&mut self, cutoff: f64) { ... }
fn set_maxdim(&mut self, maxdim: usize) { ... }
}Expand description
Trait for types that contain truncation parameters.
This trait provides a common interface for accessing and modifying truncation parameters in various options structs.
Required Methods§
Sourcefn truncation_params(&self) -> &TruncationParams
fn truncation_params(&self) -> &TruncationParams
Get a reference to the truncation parameters.
Sourcefn truncation_params_mut(&mut self) -> &mut TruncationParams
fn truncation_params_mut(&mut self) -> &mut TruncationParams
Get a mutable reference to the truncation parameters.
Provided Methods§
Sourcefn with_rtol(self, rtol: f64) -> Selfwhere
Self: Sized,
fn with_rtol(self, rtol: f64) -> Selfwhere
Self: Sized,
Set the rtol value (builder pattern).
Clears any previously set cutoff origin.
Sourcefn with_max_rank(self, max_rank: usize) -> Selfwhere
Self: Sized,
fn with_max_rank(self, max_rank: usize) -> Selfwhere
Self: Sized,
Set the max_rank value (builder pattern).
Sourcefn with_cutoff(self, cutoff: f64) -> Selfwhere
Self: Sized,
fn with_cutoff(self, cutoff: f64) -> Selfwhere
Self: Sized,
Set cutoff (ITensorMPS.jl convention, builder pattern).
Internally converted to rtol = √cutoff.
Sourcefn with_maxdim(self, maxdim: usize) -> Selfwhere
Self: Sized,
fn with_maxdim(self, maxdim: usize) -> Selfwhere
Self: Sized,
Set maxdim (alias for max_rank, builder pattern).
Sourcefn set_cutoff(&mut self, cutoff: f64)
fn set_cutoff(&mut self, cutoff: f64)
Set cutoff via mutable reference.
Sourcefn set_maxdim(&mut self, maxdim: usize)
fn set_maxdim(&mut self, maxdim: usize)
Set maxdim via mutable reference (alias for max_rank).