Faer

Struct Faer 

Source
pub struct Faer;

Trait Implementations§

Source§

impl Default for Faer

Source§

fn default() -> Faer

Returns the “default value” for a type. Read more
Source§

impl<T> Eig<T> for Faer
where T: ComplexFloat + ComplexField + Default + From<<T as ComplexFloat>::Real> + 'static,

Source§

fn eig<L: Layout>(&self, a: &mut DSlice<T, 2, L>) -> EigResult<T>

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 DSlice<T, 2, L>) -> EigResult<T>

Compute only eigenvalues with new allocated vectors

Source§

fn eigh<L: Layout>(&self, a: &mut DSlice<T, 2, L>) -> EigResult<T>

Compute eigenvalues and eigenvectors of a Hermitian matrix (input should be complex)

Source§

fn eigs<L: Layout>(&self, a: &mut DSlice<T, 2, L>) -> EigResult<T>

Compute eigenvalues and eigenvectors of a symmetric matrix (input should be real)

Source§

fn schur<L: Layout>(&self, _a: &mut DSlice<T, 2, L>) -> SchurResult<T>

Compute Schur decomposition with new allocated matrices

Source§

fn schur_overwrite<L: Layout>( &self, _a: &mut DSlice<T, 2, L>, _t: &mut DSlice<T, 2, Dense>, _z: &mut DSlice<T, 2, Dense>, ) -> Result<(), SchurError>

Compute Schur decomposition overwriting existing matrices

Source§

fn schur_complex<L: Layout>(&self, _a: &mut DSlice<T, 2, L>) -> SchurResult<T>

Compute Schur (complex) decomposition with new allocated matrices

Source§

fn schur_complex_overwrite<L: Layout>( &self, _a: &mut DSlice<T, 2, L>, _t: &mut DSlice<T, 2, Dense>, _z: &mut DSlice<T, 2, Dense>, ) -> Result<(), SchurError>

Compute Schur (complex) decomposition overwriting existing matrices

Source§

fn eig_full<L: Layout>( &self, _a: &mut DSlice<T, 2, L>, ) -> Result<EigDecomp<T>, EigError>

Compute eigenvalues and both left/right eigenvectors with new allocated matrices The matrix A satisfies: A * vr = λ * vr and vl^H * A = λ * vl^H where vr are right eigenvectors and vl are left eigenvectors
Source§

impl<T> LU<T> for Faer
where T: ComplexFloat + ComplexField + Default + From<<T as ComplexFloat>::Real> + 'static,

Source§

fn lu<L: Layout>( &self, a: &mut DSlice<T, 2, L>, ) -> (DTensor<T, 2>, DTensor<T, 2>, DTensor<T, 2>)

Computes LU decomposition with new allocated matrices: L, U, P (permutation matrix)

Source§

fn lu_overwrite<L: Layout, Ll: Layout, Lu: Layout, Lp: Layout>( &self, a: &mut DSlice<T, 2, L>, l: &mut DSlice<T, 2, Ll>, u: &mut DSlice<T, 2, Lu>, p: &mut DSlice<T, 2, Lp>, )

Computes LU decomposition overwriting existing matrices

Source§

fn inv<L: Layout>(&self, a: &mut DSlice<T, 2, L>) -> InvResult<T>

Computes inverse with new allocated matrix

Source§

fn inv_overwrite<L: Layout>( &self, a: &mut DSlice<T, 2, L>, ) -> Result<(), InvError>

Computes inverse overwriting the input matrix

Source§

fn det<L: Layout>(&self, a: &mut DSlice<T, 2, L>) -> T

Computes the determinant of a square matrix. Panics if the matrix is non-square.

Source§

fn choleski<L: Layout>(&self, _a: &mut DSlice<T, 2, L>) -> InvResult<T>

Computes the Cholesky decomposition, returning a lower-triangular matrix

Source§

fn choleski_overwrite<L: Layout>( &self, _a: &mut DSlice<T, 2, L>, ) -> Result<(), InvError>

Computes the Cholesky decomposition in-place, overwriting the input matrix

Source§

impl<T> MatMul<T> for Faer
where T: ComplexFloat + ComplexField + One + 'static,

Source§

fn contract_all<'a, La, Lb>( &self, a: &'a Slice<T, DynRank, La>, b: &'a Slice<T, DynRank, Lb>, ) -> impl ContractBuilder<'a, T, La, Lb>
where T: 'a, La: Layout, Lb: Layout,

Contracts all axes of the first tensor with all axes of the second tensor.

Source§

fn contract_n<'a, La, Lb>( &self, a: &'a Slice<T, DynRank, La>, b: &'a Slice<T, DynRank, Lb>, n: usize, ) -> impl ContractBuilder<'a, T, La, Lb>
where T: 'a, La: Layout, Lb: Layout,

Contracts the last n axes of the first tensor with the first n axes of the second tensor.

§Example

For two matrices (2D tensors), contract_n(1) performs standard matrix multiplication.

Source§

fn contract<'a, La, Lb>( &self, a: &'a Slice<T, DynRank, La>, b: &'a Slice<T, DynRank, Lb>, axes_a: impl Into<Box<[usize]>>, axes_b: impl Into<Box<[usize]>>, ) -> impl ContractBuilder<'a, T, La, Lb>
where T: 'a, La: Layout, Lb: Layout,

Specifies exactly which axes to contract_all.

§Example

specific([1, 2], [3, 4]) contracts axis 1 and 2 of a with axes 3 and 4 of b.

Source§

fn matmul<'a, La, Lb>( &self, a: &'a DSlice<T, 2, La>, b: &'a DSlice<T, 2, Lb>, ) -> impl MatMulBuilder<'a, T, La, Lb>
where La: Layout, Lb: Layout,

Source§

impl<T> QR<T> for Faer
where T: ComplexFloat + ComplexField + Default + From<<T as ComplexFloat>::Real> + 'static,

Source§

fn qr<L: Layout>( &self, a: &mut DSlice<T, 2, L>, ) -> (DTensor<T, 2>, DTensor<T, 2>)

Compute full QR decomposition with new allocated matrices

Source§

fn qr_overwrite<L: Layout, Lq: Layout, Lr: Layout>( &self, a: &mut DSlice<T, 2, L>, q: &mut DSlice<T, 2, Lq>, r: &mut DSlice<T, 2, Lr>, )

Compute full QR decomposition, overwriting existing matrices

Source§

impl<T> SVD<T> for Faer
where T: ComplexFloat + ComplexField + Default + From<<T as ComplexFloat>::Real> + 'static,

Source§

fn svd<L: Layout>( &self, a: &mut DSlice<T, 2, L>, ) -> Result<SVDDecomp<T>, SVDError>

Compute full SVD with new allocated matrices

Source§

fn svd_s<L: Layout>( &self, a: &mut DSlice<T, 2, L>, ) -> Result<DTensor<T, 2>, SVDError>

Compute only singular values with new allocated matrix

Source§

fn svd_overwrite<L: Layout, Ls: Layout, Lu: Layout, Lvt: Layout>( &self, a: &mut DSlice<T, 2, L>, s: &mut DSlice<T, 2, Ls>, u: &mut DSlice<T, 2, Lu>, vt: &mut DSlice<T, 2, Lvt>, ) -> Result<(), SVDError>

Compute full SVD, overwriting existing matrices

Source§

fn svd_overwrite_s<L: Layout, Ls: Layout>( &self, a: &mut DSlice<T, 2, L>, s: &mut DSlice<T, 2, Ls>, ) -> Result<(), SVDError>

Compute only singular values, overwriting existing matrix

Source§

impl<T> Solve<T> for Faer
where T: ComplexFloat + ComplexField + Default + From<<T as ComplexFloat>::Real> + 'static,

Source§

fn solve<La: Layout, Lb: Layout>( &self, a: &mut DSlice<T, 2, La>, b: &DSlice<T, 2, Lb>, ) -> SolveResultType<T>

Solves linear system AX = B with new allocated solution matrix A is modified (overwritten with LU decomposition) Returns the solution X and P the permutation matrix (identity in that case), or error

Source§

fn solve_overwrite<La: Layout, Lb: Layout, Lp: Layout>( &self, a: &mut DSlice<T, 2, La>, b: &mut DSlice<T, 2, Lb>, p: &mut DSlice<T, 2, Lp>, ) -> Result<(), SolveError>

Solves linear system AX = b overwriting existing matrices A is overwritten with its LU decomposition B is overwritten with the solution X P is filled with the permutation matrix such that PA = LU (here P = identity) Returns Ok(()) on success, Err(SolveError) on failure

Auto Trait Implementations§

§

impl Freeze for Faer

§

impl RefUnwindSafe for Faer

§

impl Send for Faer

§

impl Sync for Faer

§

impl Unpin for Faer

§

impl UnwindSafe for Faer

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

Source§

impl<T> DistributionExt for T
where T: ?Sized,

Source§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoCloned<T> for T

Source§

fn clone_to(self, target: &mut T)

Moves an existing object or clones from a reference to the target object.
Source§

fn into_cloned(self) -> T

Returns an existing object or a new clone from a reference.
Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V