Skip to content

Commit b029bfb

Browse files
committed
Rename JobEv::{Calc, Not} to {All, None} to match JobSvd
1 parent 950b7da commit b029bfb

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

lax/src/eig.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ macro_rules! impl_eig_complex {
3535
// eigenvalues are the eigenvalues computed with `A`.
3636
let (jobvl, jobvr) = if calc_v {
3737
match l {
38-
MatrixLayout::C { .. } => (JobEv::Calc, JobEv::Not),
39-
MatrixLayout::F { .. } => (JobEv::Not, JobEv::Calc),
38+
MatrixLayout::C { .. } => (JobEv::All, JobEv::None),
39+
MatrixLayout::F { .. } => (JobEv::None, JobEv::All),
4040
}
4141
} else {
42-
(JobEv::Not, JobEv::Not)
42+
(JobEv::None, JobEv::None)
4343
};
4444
let mut eigs: Vec<MaybeUninit<Self>> = unsafe { vec_uninit(n as usize) };
4545
let mut rwork: Vec<MaybeUninit<Self::Real>> = unsafe { vec_uninit(2 * n as usize) };
@@ -143,11 +143,11 @@ macro_rules! impl_eig_real {
143143
// `sgeev`/`dgeev`.
144144
let (jobvl, jobvr) = if calc_v {
145145
match l {
146-
MatrixLayout::C { .. } => (JobEv::Calc, JobEv::Not),
147-
MatrixLayout::F { .. } => (JobEv::Not, JobEv::Calc),
146+
MatrixLayout::C { .. } => (JobEv::All, JobEv::None),
147+
MatrixLayout::F { .. } => (JobEv::None, JobEv::All),
148148
}
149149
} else {
150-
(JobEv::Not, JobEv::Not)
150+
(JobEv::None, JobEv::None)
151151
};
152152
let mut eig_re: Vec<MaybeUninit<Self>> = unsafe { vec_uninit(n as usize) };
153153
let mut eig_im: Vec<MaybeUninit<Self>> = unsafe { vec_uninit(n as usize) };

lax/src/eigh.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ macro_rules! impl_eigh {
4141
) -> Result<Vec<Self::Real>> {
4242
assert_eq!(layout.len(), layout.lda());
4343
let n = layout.len();
44-
let jobz = if calc_v { JobEv::Calc } else { JobEv::Not };
44+
let jobz = if calc_v { JobEv::All } else { JobEv::None };
4545
let mut eigs: Vec<MaybeUninit<Self::Real>> = unsafe { vec_uninit(n as usize) };
4646

4747
$(
@@ -100,7 +100,7 @@ macro_rules! impl_eigh {
100100
) -> Result<Vec<Self::Real>> {
101101
assert_eq!(layout.len(), layout.lda());
102102
let n = layout.len();
103-
let jobz = if calc_v { JobEv::Calc } else { JobEv::Not };
103+
let jobz = if calc_v { JobEv::All } else { JobEv::None };
104104
let mut eigs: Vec<MaybeUninit<Self::Real>> = unsafe { vec_uninit(n as usize) };
105105

106106
$(

lax/src/flags.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,17 @@ impl NormType {
6464
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
6565
#[repr(u8)]
6666
pub enum JobEv {
67-
Calc = b'V',
68-
Not = b'N',
67+
/// Calculate eigenvectors in addition to eigenvalues
68+
All = b'V',
69+
/// Do not calculate eigenvectors. Only calculate eigenvalues.
70+
None = b'N',
6971
}
7072

7173
impl JobEv {
7274
pub fn is_calc(&self) -> bool {
7375
match self {
74-
JobEv::Calc => true,
75-
JobEv::Not => false,
76+
JobEv::All => true,
77+
JobEv::None => false,
7678
}
7779
}
7880

0 commit comments

Comments
 (0)