pub struct MatrixLuciFactors<T> {
pub row_indices: Vec<usize>,
pub col_indices: Vec<usize>,
pub pivot_errors: Vec<f64>,
pub rank: usize,
pub left: Matrix<T>,
pub right: Matrix<T>,
}Expand description
High-level factors produced by MatrixLUCI.
This is the public result of the LUCI factorization facade. It exposes the selected pivot metadata and the left and right factors needed by higher-level tensor-network code without exposing the low-level pivot kernel substrate.
Related types: MatrixLUCI is the owning CI wrapper, while
MatrixACA and RrLU are related
matrix factorization entry points.
§Examples
use tensor4all_core::matrix_luci_factors_from_matrix;
use tensor4all_tensorbackend::from_vec2d;
let m = from_vec2d(vec![
vec![1.0_f64, 2.0],
vec![3.0, 4.0],
]);
let factors = matrix_luci_factors_from_matrix(&m, None).unwrap();
assert!(factors.rank >= 1);
assert_eq!(factors.row_indices.len(), factors.rank);
assert_eq!(factors.left.nrows(), m.nrows());
assert_eq!(factors.right.ncols(), m.ncols());Fields§
§row_indices: Vec<usize>Selected row indices.
col_indices: Vec<usize>Selected column indices.
pivot_errors: Vec<f64>Pivot error history, or one measured maximum residual for fixed pivots.
One entry per accepted pivot, then a trailing entry holding the largest
magnitude of the remaining residual (0.0 once the full rank is
reached). Both kernels report that same quantity for the pivots they
selected, so the trailing entry is a residual and never a lower or upper
bound standing in for one.
rank: usizeSelected rank.
left: Matrix<T>Left factor.
right: Matrix<T>Right factor.
Trait Implementations§
Source§impl<T: Clone> Clone for MatrixLuciFactors<T>
impl<T: Clone> Clone for MatrixLuciFactors<T>
Auto Trait Implementations§
impl<T> Freeze for MatrixLuciFactors<T>
impl<T> RefUnwindSafe for MatrixLuciFactors<T>where
T: RefUnwindSafe,
impl<T> Send for MatrixLuciFactors<T>where
T: Send,
impl<T> Sync for MatrixLuciFactors<T>where
T: Sync,
impl<T> Unpin for MatrixLuciFactors<T>where
T: Unpin,
impl<T> UnsafeUnpin for MatrixLuciFactors<T>
impl<T> UnwindSafe for MatrixLuciFactors<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
U: Sized,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
U: Sized,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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