pub trait Factor: Scalar {
// Required methods
fn matrix_lu_into(a: &[Self], n: usize, work: &mut LuWork<Self>);
fn matrix_lu_solve(
lu: Lu<Self, &[Self], &[usize]>,
b: &[Self],
k: usize,
) -> Vec<Self>;
fn matrix_lu_inverse_into(
lu: Lu<Self, &[Self], &[usize]>,
x: &mut Vec<Self>,
out: &mut [Self],
);
fn matrix_cholesky(a: &[Self], n: usize) -> Option<Vec<Self>>;
fn matrix_qr(
a: &[Self],
size: [usize; 2],
complete: bool,
) -> (Vec<Self>, Vec<Self>);
fn matrix_qr_into(
a: &[Self],
size: [usize; 2],
complete: bool,
work: &mut QrWork<Self>,
q: &mut [Self],
r: &mut [Self],
);
fn matrix_svd(a: &[Self], size: [usize; 2], vectors: bool) -> Svd<Self>;
fn matrix_truncated_svd(a: &[Self], size: [usize; 2], k: usize) -> Svd<Self>;
fn matrix_svd_solve(
svd: Svd<Self, &[Self], &[Self::Real]>,
b: Option<&[Self]>,
k: usize,
) -> Vec<Self>;
fn matrix_lstsq(
a: &[Self],
b: &[Self],
size: [usize; 2],
k: usize,
) -> (Vec<Self>, Vec<Self::Real>);
fn matrix_eigh(a: &[Self], n: usize, vectors: bool) -> Option<Eigh<Self>>;
fn matrix_eig(
a: &[Self],
n: usize,
vectors: bool,
) -> Option<Eig<Self::Real>>;
}Expand description
An item type whose matrices rustymath factors: f32, f64, or a complex number with parts of either type. Only rustymath implements it, and the functions of this module call it. Its methods compile in rustymath.
Required Methods§
Sourcefn matrix_lu_into(a: &[Self], n: usize, work: &mut LuWork<Self>)
fn matrix_lu_into(a: &[Self], n: usize, work: &mut LuWork<Self>)
The LU factorization of the n×n matrix a, into work’s buffers.
Sourcefn matrix_lu_solve(
lu: Lu<Self, &[Self], &[usize]>,
b: &[Self],
k: usize,
) -> Vec<Self>
fn matrix_lu_solve( lu: Lu<Self, &[Self], &[usize]>, b: &[Self], k: usize, ) -> Vec<Self>
The solution of a x = b for the matrix that lu factors and the n×k matrix b.
Sourcefn matrix_lu_inverse_into(
lu: Lu<Self, &[Self], &[usize]>,
x: &mut Vec<Self>,
out: &mut [Self],
)
fn matrix_lu_inverse_into( lu: Lu<Self, &[Self], &[usize]>, x: &mut Vec<Self>, out: &mut [Self], )
The inverse of the matrix that lu factors, written into out, with x as scratch.
Sourcefn matrix_cholesky(a: &[Self], n: usize) -> Option<Vec<Self>>
fn matrix_cholesky(a: &[Self], n: usize) -> Option<Vec<Self>>
The Cholesky factor of the n×n matrix a, or None where a isn’t positive definite.
Sourcefn matrix_qr(
a: &[Self],
size: [usize; 2],
complete: bool,
) -> (Vec<Self>, Vec<Self>)
fn matrix_qr( a: &[Self], size: [usize; 2], complete: bool, ) -> (Vec<Self>, Vec<Self>)
The QR factorization of the matrix a of size [m, n]: thin, or complete where complete is true.
Sourcefn matrix_qr_into(
a: &[Self],
size: [usize; 2],
complete: bool,
work: &mut QrWork<Self>,
q: &mut [Self],
r: &mut [Self],
)
fn matrix_qr_into( a: &[Self], size: [usize; 2], complete: bool, work: &mut QrWork<Self>, q: &mut [Self], r: &mut [Self], )
matrix_qr’s Q and R, written into q and r, with work’s buffers.
Sourcefn matrix_svd(a: &[Self], size: [usize; 2], vectors: bool) -> Svd<Self>
fn matrix_svd(a: &[Self], size: [usize; 2], vectors: bool) -> Svd<Self>
The thin SVD of the matrix a of size [m, n], with its singular vectors only where vectors is true.
Sourcefn matrix_truncated_svd(a: &[Self], size: [usize; 2], k: usize) -> Svd<Self>
fn matrix_truncated_svd(a: &[Self], size: [usize; 2], k: usize) -> Svd<Self>
An approximation to the thin SVD’s first k singular values and vectors of the matrix a of size [m, n].
Sourcefn matrix_svd_solve(
svd: Svd<Self, &[Self], &[Self::Real]>,
b: Option<&[Self]>,
k: usize,
) -> Vec<Self>
fn matrix_svd_solve( svd: Svd<Self, &[Self], &[Self::Real]>, b: Option<&[Self]>, k: usize, ) -> Vec<Self>
The least-squares solution of a x = b for the matrix that svd factors and the m×k matrix b, or without b its n×m pseudoinverse.
Sourcefn matrix_lstsq(
a: &[Self],
b: &[Self],
size: [usize; 2],
k: usize,
) -> (Vec<Self>, Vec<Self::Real>)
fn matrix_lstsq( a: &[Self], b: &[Self], size: [usize; 2], k: usize, ) -> (Vec<Self>, Vec<Self::Real>)
The least-squares solution of a x = b, and a’s singular values, for the matrix a of size [m, n] and the m×k matrix b.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".