Skip to content

Commit 7e5cf1c

Browse files
committed
Add EigWork<T>
1 parent ee38384 commit 7e5cf1c

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

lax/src/eig.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,31 @@ pub trait Eig_: Scalar {
3232
) -> Result<(Vec<Self::Complex>, Vec<Self::Complex>)>;
3333
}
3434

35+
/// Working memory for [Eig_]
36+
#[derive(Debug, Clone)]
37+
pub struct EigWork<T: Scalar> {
38+
pub n: i32,
39+
pub jobvr: JobEv,
40+
pub jobvl: JobEv,
41+
42+
/// Eigenvalues used in complex routines
43+
pub eigs: Option<Vec<MaybeUninit<T>>>,
44+
/// Real part of eigenvalues used in real routines
45+
pub eigs_re: Option<Vec<MaybeUninit<T>>>,
46+
/// Imaginary part of eigenvalues used in real routines
47+
pub eigs_im: Option<Vec<MaybeUninit<T>>>,
48+
49+
/// Left eigenvectors
50+
pub vl: Option<Vec<MaybeUninit<T>>>,
51+
/// Right eigenvectors
52+
pub vr: Option<Vec<MaybeUninit<T>>>,
53+
54+
/// Working memory
55+
pub work: Vec<MaybeUninit<T>>,
56+
/// Working memory with `T::Real`
57+
pub rwork: Option<Vec<MaybeUninit<T::Real>>>,
58+
}
59+
3560
macro_rules! impl_eig_complex {
3661
($scalar:ty, $ev:path) => {
3762
impl Eig_ for $scalar {

0 commit comments

Comments
 (0)