pub struct TruncationOptions { /* private fields */ }Expand description
Options for truncation operations.
§Builder Pattern
use tensor4all_core::SvdTruncationPolicy;
use tensor4all_treetn::TruncationOptions;
let options = TruncationOptions::default()
.with_max_rank(50)
.with_svd_policy(SvdTruncationPolicy::new(1e-10));
assert_eq!(options.max_rank(), Some(50));
assert_eq!(options.svd_policy(), Some(SvdTruncationPolicy::new(1e-10)));Implementations§
Source§impl TruncationOptions
impl TruncationOptions
Sourcepub fn with_max_rank(self, rank: usize) -> Self
pub fn with_max_rank(self, rank: usize) -> Self
Create options with a maximum rank.
Sourcepub fn with_svd_policy(self, policy: SvdTruncationPolicy) -> Self
pub fn with_svd_policy(self, policy: SvdTruncationPolicy) -> Self
Set the SVD truncation policy used during the truncation sweep.
Sourcepub fn svd_policy(&self) -> Option<SvdTruncationPolicy>
pub fn svd_policy(&self) -> Option<SvdTruncationPolicy>
Get the SVD truncation policy.
Trait Implementations§
Source§impl Clone for TruncationOptions
impl Clone for TruncationOptions
Source§fn clone(&self) -> TruncationOptions
fn clone(&self) -> TruncationOptions
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 TruncationOptions
impl Debug for TruncationOptions
Source§impl Default for TruncationOptions
impl Default for TruncationOptions
impl Copy for TruncationOptions
Auto Trait Implementations§
impl Freeze for TruncationOptions
impl RefUnwindSafe for TruncationOptions
impl Send for TruncationOptions
impl Sync for TruncationOptions
impl Unpin for TruncationOptions
impl UnsafeUnpin for TruncationOptions
impl UnwindSafe for TruncationOptions
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§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,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<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>
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