pub struct TCI1Options {
pub tolerance: f64,
pub max_iter: usize,
pub sweep_strategy: SweepStrategy,
pub pivot_tolerance: f64,
pub normalize_error: bool,
pub verbosity: usize,
}Expand description
Configuration for the TCI1 algorithm (crossinterpolate1).
See TCI2Options for the recommended TCI2
counterpart.
§Examples
use tensor4all_tensorci::{TCI1Options, SweepStrategy};
// Default options
let opts = TCI1Options::default();
assert!((opts.tolerance - 1e-8).abs() < 1e-15);
assert_eq!(opts.max_iter, 200);
assert_eq!(opts.sweep_strategy, SweepStrategy::BackAndForth);
assert!((opts.pivot_tolerance - 1e-12).abs() < 1e-20);
assert!(opts.normalize_error);
assert_eq!(opts.verbosity, 0);
// Custom options via struct update syntax
let custom = TCI1Options {
tolerance: 1e-10,
max_iter: 50,
sweep_strategy: SweepStrategy::Forward,
..TCI1Options::default()
};
assert!((custom.tolerance - 1e-10).abs() < 1e-20);
assert_eq!(custom.max_iter, 50);
assert_eq!(custom.sweep_strategy, SweepStrategy::Forward);Fields§
§tolerance: f64Convergence tolerance (default: 1e-8).
max_iter: usizeMaximum number of iterations (default: 200).
sweep_strategy: SweepStrategySweep strategy (default: SweepStrategy::BackAndForth).
pivot_tolerance: f64Minimum pivot error to add a new pivot (default: 1e-12).
normalize_error: boolWhether to normalize error by the maximum sample value (default: true).
verbosity: usizeVerbosity level (default: 0 = silent).
Trait Implementations§
Source§impl Clone for TCI1Options
impl Clone for TCI1Options
Source§fn clone(&self) -> TCI1Options
fn clone(&self) -> TCI1Options
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 TCI1Options
impl Debug for TCI1Options
Auto Trait Implementations§
impl Freeze for TCI1Options
impl RefUnwindSafe for TCI1Options
impl Send for TCI1Options
impl Sync for TCI1Options
impl Unpin for TCI1Options
impl UnsafeUnpin for TCI1Options
impl UnwindSafe for TCI1Options
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>,
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