Skip to main content

Lapack

Struct Lapack 

Source
pub struct Lapack { /* private fields */ }
Expand description

LAPACK backend.

Implements the decomposition and solver traits from mdarray_linalg by delegating to LAPACK routines.

Implementations§

Source§

impl Lapack

Source

pub fn new() -> Self

Creates a new Lapack backend.

Trait Implementations§

Source§

impl Clone for Lapack

Source§

fn clone(&self) -> Lapack

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Lapack

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Lapack

Source§

fn default() -> Lapack

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

impl<T, D0: Dim, D1: Dim> Eig<T, D0, D1> for Lapack
where T: ComplexFloat + Default + LapackScalar + NeedsRwork<Elem = T>, Complex<T::Real>: ComplexFloat + Default + LapackScalar + NeedsRwork<Elem = Complex<T::Real>>, i8: Into<T::Real>, T::Real: Into<T>,

Source§

fn eig<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> Result<EigDecomp<Self::SpectralScalar, D0, D1>, EigError>
where T: ComplexFloat,

Compute eigenvalues and right eigenvectors with new allocated matrices

Source§

fn eig_full<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> Result<EigDecomp<Self::SpectralScalar, D0, D1>, EigError>

Compute eigenvalues and both left/right eigenvectors with new allocated matrices

Source§

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>

Compute eigenvalues and eigenvectors of a self-adjoint matrix

Source§

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>

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>

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>

Compute Schur (complex) decomposition overwriting existing matrices

Source§

type SpectralScalar = Complex<<T as ComplexFloat>::Real>

Spectral scalar type used for general eigenvalues/eigenvectors and complex Schur decompositions.
Source§

type RealScalar = <T as ComplexFloat>::Real

Real scalar type used for self-adjoint eigenvalues.
Source§

impl<T, D0: Dim, D1: Dim> LU<T, D0, D1> for Lapack
where T: ComplexFloat + Default + LapackScalar + Workspace, T::Real: Into<T>,

Source§

fn cholesky<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> Result<Array<T, (D0, D1)>, InvError>

Computes the Cholesky decomposition, returning a lower-triangular matrix

Source§

fn cholesky_write<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> Result<(), InvError>

Computes the Cholesky decomposition in-place, overwriting the input 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>, )

Computes LU decomposition overwriting existing matrices
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)>)

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

fn inv_write<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> Result<(), InvError>

Computes inverse overwriting the input matrix
Source§

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 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 Lapack
where T: ComplexFloat + Default + LapackScalar + NeedsRwork, T::Real: Into<T>,

Source§

fn qr_write<D2: Dim, L: Layout, Lq: Layout, Lr: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, q: &mut Slice<T, (D0, D2), Lq>, r: &mut Slice<T, (D2, D1), Lr>, )

Compute QR decomposition overwriting existing matrices
Source§

fn qr<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> (Array<T, (D0, usize)>, Array<T, (usize, D1)>)

Compute QR decomposition with new allocated matrices
Source§

impl<T, D> SVD<T, D> for Lapack
where T: ComplexFloat + Default + LapackScalar + NeedsRwork, T::Real: Into<T>, D: Dim,

Source§

type SingularValue = T

Scalar type used for singular values. Read more
Source§

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>

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>

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>

Compute 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>

Compute only singular values, overwriting existing matrix
Source§

impl<T, D: Dim> Solve<T, D> for Lapack
where T: ComplexFloat + Default + LapackScalar, T::Real: Into<T>,

Source§

fn solve_write<R: Dim, La: Layout, Lb: Layout>( &self, a: &mut Slice<T, (D, D), La>, b: &mut Slice<T, (D, R), Lb>, ) -> Result<(), SolveError>

Solves linear system AX = B, overwriting B with the solution X. Read more
Source§

fn solve<R: Dim, La: Layout, Lb: Layout>( &self, a: &mut Slice<T, (D, D), La>, b: &Slice<T, (D, R), Lb>, ) -> Result<Array<T, (D, R)>, SolveError>

Solves linear system AX = B with a newly allocated solution matrix. Read more

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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