lax::eig

Struct EigWork

source
#[non_exhaustive]
pub struct EigWork<T: Scalar> { pub n: i32, pub jobvr: JobEv, pub jobvl: JobEv, pub eigs: Vec<MaybeUninit<T::Complex>>, pub eigs_re: Option<Vec<MaybeUninit<T::Real>>>, pub eigs_im: Option<Vec<MaybeUninit<T::Real>>>, pub vc_l: Option<Vec<MaybeUninit<T::Complex>>>, pub vr_l: Option<Vec<MaybeUninit<T::Real>>>, pub vc_r: Option<Vec<MaybeUninit<T::Complex>>>, pub vr_r: Option<Vec<MaybeUninit<T::Real>>>, pub work: Vec<MaybeUninit<T>>, pub rwork: Option<Vec<MaybeUninit<T::Real>>>, }
Expand description

Eigenvalue problem for general matrix

To manage memory more strictly, use EigWork.

§Right and Left eigenvalue problem

LAPACK can solve both right eigenvalue problem $$ AV_R = V_R \Lambda $$ where $V_R = \left( v_R^1, \cdots, v_R^n \right)$ are right eigenvectors and left eigenvalue problem $$ V_L^\dagger A = V_L^\dagger \Lambda $$ where $V_L = \left( v_L^1, \cdots, v_L^n \right)$ are left eigenvectors and eigenvalues $$ \Lambda = \begin{pmatrix} \lambda_1 & & 0 \\ & \ddots & \\ 0 & & \lambda_n \end{pmatrix} $$ which satisfies $A v_R^i = \lambda_i v_R^i$ and $\left(v_L^i\right)^\dagger A = \lambda_i \left(v_L^i\right)^\dagger$ for column-major matrices, although row-major matrices are not supported. Since a row-major matrix can be interpreted as a transpose of a column-major matrix, this transforms right eigenvalue problem to left one:

$$ A^\dagger V = V Λ ⟺ V^\dagger A = Λ V^\dagger $$

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§n: i32

Problem size

§jobvr: JobEv

Compute right eigenvectors or not

§jobvl: JobEv

Compute left eigenvectors or not

§eigs: Vec<MaybeUninit<T::Complex>>

Eigenvalues

§eigs_re: Option<Vec<MaybeUninit<T::Real>>>

Real part of eigenvalues used in real routines

§eigs_im: Option<Vec<MaybeUninit<T::Real>>>

Imaginary part of eigenvalues used in real routines

§vc_l: Option<Vec<MaybeUninit<T::Complex>>>

Left eigenvectors

§vr_l: Option<Vec<MaybeUninit<T::Real>>>

Left eigenvectors used in real routines

§vc_r: Option<Vec<MaybeUninit<T::Complex>>>

Right eigenvectors

§vr_r: Option<Vec<MaybeUninit<T::Real>>>

Right eigenvectors used in real routines

§work: Vec<MaybeUninit<T>>

Working memory

§rwork: Option<Vec<MaybeUninit<T::Real>>>

Working memory with T::Real

Implementations§

source§

impl<T> EigWork<T>
where T: Scalar, EigWork<T>: EigWorkImpl<Elem = T>,

source

pub fn new(calc_v: bool, l: MatrixLayout) -> Result<Self>

Create new working memory for eigenvalues compution.

source

pub fn calc(&mut self, a: &mut [T]) -> Result<EigRef<'_, T>>

Compute eigenvalues and vectors on this working memory.

source

pub fn eval(self, a: &mut [T]) -> Result<EigOwned<T>>

Compute eigenvalues and vectors by consuming this working memory.

Trait Implementations§

source§

impl EigWorkImpl for EigWork<c32>

source§

type Elem = Complex<f32>

source§

fn new(calc_v: bool, l: MatrixLayout) -> Result<Self>

source§

fn calc<'work>( &'work mut self, a: &mut [Self::Elem], ) -> Result<EigRef<'work, Self::Elem>>

source§

fn eval(self, a: &mut [Self::Elem]) -> Result<EigOwned<Self::Elem>>

source§

impl EigWorkImpl for EigWork<c64>

source§

type Elem = Complex<f64>

source§

fn new(calc_v: bool, l: MatrixLayout) -> Result<Self>

source§

fn calc<'work>( &'work mut self, a: &mut [Self::Elem], ) -> Result<EigRef<'work, Self::Elem>>

source§

fn eval(self, a: &mut [Self::Elem]) -> Result<EigOwned<Self::Elem>>

source§

impl EigWorkImpl for EigWork<f32>

source§

type Elem = f32

source§

fn new(calc_v: bool, l: MatrixLayout) -> Result<Self>

source§

fn calc<'work>( &'work mut self, a: &mut [Self::Elem], ) -> Result<EigRef<'work, Self::Elem>>

source§

fn eval(self, a: &mut [Self::Elem]) -> Result<EigOwned<Self::Elem>>

source§

impl EigWorkImpl for EigWork<f64>

source§

type Elem = f64

source§

fn new(calc_v: bool, l: MatrixLayout) -> Result<Self>

source§

fn calc<'work>( &'work mut self, a: &mut [Self::Elem], ) -> Result<EigRef<'work, Self::Elem>>

source§

fn eval(self, a: &mut [Self::Elem]) -> Result<EigOwned<Self::Elem>>

Auto Trait Implementations§

§

impl<T> Freeze for EigWork<T>

§

impl<T> RefUnwindSafe for EigWork<T>
where <T as Scalar>::Complex: RefUnwindSafe, T: RefUnwindSafe, <T as Scalar>::Real: RefUnwindSafe,

§

impl<T> Send for EigWork<T>
where <T as Scalar>::Complex: Send, T: Send, <T as Scalar>::Real: Send,

§

impl<T> Sync for EigWork<T>
where <T as Scalar>::Complex: Sync, T: Sync, <T as Scalar>::Real: Sync,

§

impl<T> Unpin for EigWork<T>
where <T as Scalar>::Complex: Unpin, T: Unpin, <T as Scalar>::Real: Unpin,

§

impl<T> UnwindSafe for EigWork<T>
where <T as Scalar>::Complex: UnwindSafe, T: UnwindSafe, <T as Scalar>::Real: UnwindSafe,

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> 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, 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.
§

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

§

fn vzip(self) -> V