pub struct Faer;Expand description
Faer backend.
Implements the linear algebra traits from mdarray_linalg by delegating
to the pure-Rust faer library. This backend supports the broadest range of
operations — from basic BLAS to full decompositions and tensor contractions —
without requiring any system BLAS/LAPACK installation.
Trait Implementations§
Source§impl<T> Contract<T> for Faer
impl<T> Contract<T> for Faer
Source§fn matmul<'a, D0, D1, D2, La, Lb>(
&self,
a: &'a Slice<T, (D0, D1), La>,
b: &'a Slice<T, (D1, D2), Lb>,
) -> impl MatmulBuilder<'a, T, D0, D1, D2, La, Lb>
fn matmul<'a, D0, D1, D2, La, Lb>( &self, a: &'a Slice<T, (D0, D1), La>, b: &'a Slice<T, (D1, D2), Lb>, ) -> impl MatmulBuilder<'a, T, D0, D1, D2, La, Lb>
Source§fn contract_all<'a, Sa, Sb, La, Lb>(
&self,
a: &'a Slice<T, Sa, La>,
b: &'a Slice<T, Sb, Lb>,
) -> T
fn contract_all<'a, Sa, Sb, La, Lb>( &self, a: &'a Slice<T, Sa, La>, b: &'a Slice<T, Sb, Lb>, ) -> T
Source§fn contract_n<'a, Sa, Sb, La, Lb>(
&self,
a: &'a Slice<T, Sa, La>,
b: &'a Slice<T, Sb, Lb>,
n: usize,
) -> impl ContractBuilder<'a, T, Sa, Sb, La, Lb>
fn contract_n<'a, Sa, Sb, La, Lb>( &self, a: &'a Slice<T, Sa, La>, b: &'a Slice<T, Sb, Lb>, n: usize, ) -> impl ContractBuilder<'a, T, Sa, Sb, La, Lb>
Source§fn contract_pairs<'a, Sa, Sb, La, Lb>(
&self,
a: &'a Slice<T, Sa, La>,
b: &'a Slice<T, Sb, Lb>,
axes_a: &'a [usize],
axes_b: &'a [usize],
) -> impl ContractBuilder<'a, T, Sa, Sb, La, Lb>
fn contract_pairs<'a, Sa, Sb, La, Lb>( &self, a: &'a Slice<T, Sa, La>, b: &'a Slice<T, Sb, Lb>, axes_a: &'a [usize], axes_b: &'a [usize], ) -> impl ContractBuilder<'a, T, Sa, Sb, La, Lb>
Source§impl<T, D0: Dim, D1: Dim> Eig<T, D0, D1> for Faerwhere
T: ComplexFloat + ComplexField + Default + From<<T as ComplexFloat>::Real>,
Complex<<T as ComplexFloat>::Real>: ComplexFloat + ComplexField + Default + From<<T as ComplexFloat>::Real> + From<<Complex<<T as ComplexFloat>::Real> as ComplexFloat>::Real>,
impl<T, D0: Dim, D1: Dim> Eig<T, D0, D1> for Faerwhere
T: ComplexFloat + ComplexField + Default + From<<T as ComplexFloat>::Real>,
Complex<<T as ComplexFloat>::Real>: ComplexFloat + ComplexField + Default + From<<T as ComplexFloat>::Real> + From<<Complex<<T as ComplexFloat>::Real> as ComplexFloat>::Real>,
Source§fn eig<L: Layout>(
&self,
a: &mut Slice<T, (D0, D1), L>,
) -> Result<EigDecomp<Self::SpectralScalar, D0, D1>, EigError>
fn eig<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> Result<EigDecomp<Self::SpectralScalar, D0, D1>, EigError>
Compute eigenvalues and right eigenvectors with new allocated matrices
The matrix A satisfies: A * v = λ * v where v are the right eigenvectors
Source§fn eig_values<L: Layout>(
&self,
a: &mut Slice<T, (D0, D1), L>,
) -> Result<Array<Self::SpectralScalar, (D0,)>, EigError>
fn eig_values<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> Result<Array<Self::SpectralScalar, (D0,)>, EigError>
Compute only eigenvalues with new allocated vectors
Source§fn eigh<L: Layout>(
&self,
a: &mut Slice<T, (D0, D1), L>,
) -> Result<EighDecomp<T, Self::RealScalar, D0, D1>, EigError>
fn eigh<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> Result<EighDecomp<T, Self::RealScalar, D0, D1>, EigError>
Compute eigenvalues and eigenvectors of a Hermitian matrix (input should be complex)
Source§fn schur<L: Layout>(
&self,
a: &mut Slice<T, (D0, D1), L>,
) -> Result<SchurDecomp<T, D0, D1>, SchurError>
fn schur<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> Result<SchurDecomp<T, D0, D1>, SchurError>
Compute Schur decomposition with new allocated matrices
Source§fn schur_write<L: Layout>(
&self,
a: &mut Slice<T, (D0, D1), L>,
t: &mut Slice<T, (D0, D1), Dense>,
z: &mut Slice<T, (D0, D1), Dense>,
) -> Result<(), SchurError>
fn schur_write<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, t: &mut Slice<T, (D0, D1), Dense>, z: &mut Slice<T, (D0, D1), Dense>, ) -> Result<(), SchurError>
Compute Schur decomposition overwriting existing matrices
Source§fn schur_complex<L: Layout>(
&self,
a: &mut Slice<T, (D0, D1), L>,
) -> Result<SchurDecomp<Self::SpectralScalar, D0, D1>, SchurError>
fn schur_complex<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> Result<SchurDecomp<Self::SpectralScalar, D0, D1>, SchurError>
Compute Schur (complex) decomposition with new allocated matrices
Source§fn schur_complex_write<L: Layout>(
&self,
a: &mut Slice<T, (D0, D1), L>,
t: &mut Slice<Self::SpectralScalar, (D0, D1), Dense>,
z: &mut Slice<Self::SpectralScalar, (D0, D1), Dense>,
) -> Result<(), SchurError>
fn schur_complex_write<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, t: &mut Slice<Self::SpectralScalar, (D0, D1), Dense>, z: &mut Slice<Self::SpectralScalar, (D0, D1), Dense>, ) -> Result<(), SchurError>
Compute Schur (complex) decomposition overwriting existing matrices
Source§type SpectralScalar = Complex<<T as ComplexFloat>::Real>
type SpectralScalar = Complex<<T as ComplexFloat>::Real>
Source§type RealScalar = <T as ComplexFloat>::Real
type RealScalar = <T as ComplexFloat>::Real
Source§impl<T, D0: Dim, D1: Dim> LU<T, D0, D1> for Faer
impl<T, D0: Dim, D1: Dim> LU<T, D0, D1> for Faer
Source§fn lu<L: Layout>(
&self,
a: &mut Slice<T, (D0, D1), L>,
) -> (Array<T, (D0, D0)>, Array<T, (D0, D1)>, Array<T, (D0, D0)>)
fn lu<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> (Array<T, (D0, D0)>, Array<T, (D0, D1)>, Array<T, (D0, D0)>)
Computes LU decomposition with new allocated matrices: L, U, P (permutation matrix)
Source§fn lu_write<L: Layout, Ll: Layout, Lu: Layout, Lp: Layout>(
&self,
a: &mut Slice<T, (D0, D1), L>,
l: &mut Slice<T, (D0, D0), Ll>,
u: &mut Slice<T, (D0, D1), Lu>,
p: &mut Slice<T, (D0, D0), Lp>,
)
fn lu_write<L: Layout, Ll: Layout, Lu: Layout, Lp: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, l: &mut Slice<T, (D0, D0), Ll>, u: &mut Slice<T, (D0, D1), Lu>, p: &mut Slice<T, (D0, D0), Lp>, )
Computes LU decomposition overwriting existing matrices
Source§fn inv<L: Layout>(
&self,
a: &mut Slice<T, (D0, D1), L>,
) -> Result<Array<T, (D0, D1)>, InvError>
fn inv<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> Result<Array<T, (D0, D1)>, InvError>
Computes inverse with new allocated matrix
Source§fn inv_write<L: Layout>(
&self,
a: &mut Slice<T, (D0, D1), L>,
) -> Result<(), InvError>
fn inv_write<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> Result<(), InvError>
Computes inverse overwriting the input matrix
Source§fn det<L: Layout>(&self, a: &mut Slice<T, (D0, D1), L>) -> T
fn det<L: Layout>(&self, a: &mut Slice<T, (D0, D1), L>) -> T
Computes the determinant of a square matrix. Panics if the matrix is non-square.
Source§impl<T, D0: Dim, D1: Dim> QR<T, D0, D1> for Faer
impl<T, D0: Dim, D1: Dim> QR<T, D0, D1> for Faer
Source§impl<T, D> SVD<T, D> for Faer
impl<T, D> SVD<T, D> for Faer
Source§fn svd<L: Layout>(
&self,
a: &mut Slice<T, (D, D), L>,
) -> Result<SVDDecomp<T, Self::SingularValue, D>, SVDError>
fn svd<L: Layout>( &self, a: &mut Slice<T, (D, D), L>, ) -> Result<SVDDecomp<T, Self::SingularValue, D>, SVDError>
Compute full SVD with new allocated matrices
Source§fn svd_thin<L: Layout>(
&self,
a: &mut Slice<T, (D, D), L>,
) -> Result<SVDDecomp<T, Self::SingularValue, D>, SVDError>
fn svd_thin<L: Layout>( &self, a: &mut Slice<T, (D, D), L>, ) -> Result<SVDDecomp<T, Self::SingularValue, D>, SVDError>
Compute thin SVD with new allocated matrices
Source§fn svd_s<L: Layout>(
&self,
a: &mut Slice<T, (D, D), L>,
) -> Result<Array<Self::SingularValue, (D,)>, SVDError>
fn svd_s<L: Layout>( &self, a: &mut Slice<T, (D, D), L>, ) -> Result<Array<Self::SingularValue, (D,)>, SVDError>
Compute only singular values with new allocated matrix
Source§fn svd_write<L: Layout, Ls: Layout, Lu: Layout, Lvt: Layout>(
&self,
a: &mut Slice<T, (D, D), L>,
s: &mut Slice<Self::SingularValue, (D,), Ls>,
u: &mut Slice<T, (D, D), Lu>,
vt: &mut Slice<T, (D, D), Lvt>,
) -> Result<(), SVDError>
fn svd_write<L: Layout, Ls: Layout, Lu: Layout, Lvt: Layout>( &self, a: &mut Slice<T, (D, D), L>, s: &mut Slice<Self::SingularValue, (D,), Ls>, u: &mut Slice<T, (D, D), Lu>, vt: &mut Slice<T, (D, D), Lvt>, ) -> Result<(), SVDError>
Compute full SVD, overwriting existing matrices
Source§fn svd_write_s<L: Layout, Ls: Layout>(
&self,
a: &mut Slice<T, (D, D), L>,
s: &mut Slice<Self::SingularValue, (D,), Ls>,
) -> Result<(), SVDError>
fn svd_write_s<L: Layout, Ls: Layout>( &self, a: &mut Slice<T, (D, D), L>, s: &mut Slice<Self::SingularValue, (D,), Ls>, ) -> Result<(), SVDError>
Compute only singular values, overwriting existing matrix
Source§type SingularValue = T
type SingularValue = T
Source§impl<T, D: Dim> Solve<T, D> for Faer
impl<T, D: Dim> Solve<T, D> for Faer
Source§impl<T, D: Dim> VecOps<T, D> for Faer
impl<T, D: Dim> VecOps<T, D> for Faer
Source§type Real = <T as ComplexFloat>::Real
type Real = <T as ComplexFloat>::Real
Source§fn add_to_scaled<Lx: Layout, Ly: Layout>(
&self,
_alpha: T,
_x: &Slice<T, (D,), Lx>,
_y: &mut Slice<T, (D,), Ly>,
)
fn add_to_scaled<Lx: Layout, Ly: Layout>( &self, _alpha: T, _x: &Slice<T, (D,), Lx>, _y: &mut Slice<T, (D,), Ly>, )
y := α·x + ySource§fn dot<Lx: Layout, Ly: Layout>(
&self,
x: &Slice<T, (D,), Lx>,
y: &Slice<T, (D,), Ly>,
) -> T
fn dot<Lx: Layout, Ly: Layout>( &self, x: &Slice<T, (D,), Lx>, y: &Slice<T, (D,), Ly>, ) -> T
∑xᵢyᵢSource§fn dotc<Lx: Layout, Ly: Layout>(
&self,
x: &Slice<T, (D,), Lx>,
y: &Slice<T, (D,), Ly>,
) -> T
fn dotc<Lx: Layout, Ly: Layout>( &self, x: &Slice<T, (D,), Lx>, y: &Slice<T, (D,), Ly>, ) -> T
∑conj(xᵢ) * yᵢ (BLAS convention)Auto Trait Implementations§
impl Freeze for Faer
impl RefUnwindSafe for Faer
impl Send for Faer
impl Sync for Faer
impl Unpin for Faer
impl UnsafeUnpin for Faer
impl UnwindSafe for Faer
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoCloned<T> for T
impl<T> IntoCloned<T> for 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>
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