#[non_exhaustive]pub struct SvdOptions {
pub shape: SvdShape,
pub gauge: SvdGauge,
pub derivative_eps: f64,
pub driver: SvdDriver,
}Expand description
Options for singular value decomposition.
§Examples
use tenferro_linalg::{SvdDriver, SvdGauge, SvdOptions};
let options = SvdOptions::default()
.gauge(SvdGauge::CanonicalPivot)
.derivative_eps(1.0e-10)
.driver(SvdDriver::QrBased);
assert_eq!(options.gauge, SvdGauge::CanonicalPivot);
assert_eq!(options.derivative_eps, 1.0e-10);
assert_eq!(options.driver, SvdDriver::QrBased);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.shape: SvdShapeThin or full-matrices factors. The default is SvdShape::Thin.
gauge: SvdGaugeSingular-vector gauge convention.
derivative_eps: f64AD derivative regularization for repeated or nearly repeated singular values.
driver: SvdDriverAlgorithm family for the SVD: a hint for providers that can choose a driver; the current CPU provider ignores it.
Implementations§
Source§impl SvdOptions
impl SvdOptions
Sourcepub fn shape(self, shape: SvdShape) -> Self
pub fn shape(self, shape: SvdShape) -> Self
Return options with the requested factor shape.
§Examples
use tenferro_linalg::{SvdOptions, SvdShape};
let options = SvdOptions::default().shape(SvdShape::Full);
assert_eq!(options.shape, SvdShape::Full);Sourcepub fn gauge(self, gauge: SvdGauge) -> Self
pub fn gauge(self, gauge: SvdGauge) -> Self
Return options with the requested singular-vector gauge.
§Examples
use tenferro_linalg::{SvdGauge, SvdOptions};
let options = SvdOptions::default().gauge(SvdGauge::CanonicalPivot);
assert_eq!(options.gauge, SvdGauge::CanonicalPivot);Sourcepub fn derivative_eps(self, derivative_eps: f64) -> Self
pub fn derivative_eps(self, derivative_eps: f64) -> Self
Return options with an explicit derivative epsilon.
§Examples
use tenferro_linalg::SvdOptions;
let options = SvdOptions::default().derivative_eps(1.0e-9);
assert_eq!(options.derivative_eps, 1.0e-9);Trait Implementations§
Source§impl Clone for SvdOptions
impl Clone for SvdOptions
impl Copy for SvdOptions
Source§impl Debug for SvdOptions
impl Debug for SvdOptions
Source§impl Default for SvdOptions
impl Default for SvdOptions
Source§impl PartialEq for SvdOptions
impl PartialEq for SvdOptions
impl StructuralPartialEq for SvdOptions
Auto Trait Implementations§
impl Freeze for SvdOptions
impl RefUnwindSafe for SvdOptions
impl Send for SvdOptions
impl Sync for SvdOptions
impl Unpin for SvdOptions
impl UnsafeUnpin for SvdOptions
impl UnwindSafe for SvdOptions
Blanket Implementations§
impl<T> Boilerplate for T
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,
impl<T, U> Imply<T> for U
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