@@ -35,21 +35,21 @@ macro_rules! impl_eig_complex {
35
35
// eigenvalues are the eigenvalues computed with `A`.
36
36
let ( jobvl, jobvr) = if calc_v {
37
37
match l {
38
- MatrixLayout :: C { .. } => ( b'V' , b'N' ) ,
39
- MatrixLayout :: F { .. } => ( b'N' , b'V' ) ,
38
+ MatrixLayout :: C { .. } => ( EigenVectorFlag :: Calc , EigenVectorFlag :: Not ) ,
39
+ MatrixLayout :: F { .. } => ( EigenVectorFlag :: Not , EigenVectorFlag :: Calc ) ,
40
40
}
41
41
} else {
42
- ( b'N' , b'N' )
42
+ ( EigenVectorFlag :: Not , EigenVectorFlag :: Not )
43
43
} ;
44
44
let mut eigs = unsafe { vec_uninit( n as usize ) } ;
45
45
let mut rwork = unsafe { vec_uninit( 2 * n as usize ) } ;
46
46
47
- let mut vl = if jobvl == b'V' {
47
+ let mut vl = if jobvl == EigenVectorFlag :: Calc {
48
48
Some ( unsafe { vec_uninit( ( n * n) as usize ) } )
49
49
} else {
50
50
None
51
51
} ;
52
- let mut vr = if jobvr == b'V' {
52
+ let mut vr = if jobvr == EigenVectorFlag :: Calc {
53
53
Some ( unsafe { vec_uninit( ( n * n) as usize ) } )
54
54
} else {
55
55
None
@@ -60,8 +60,8 @@ macro_rules! impl_eig_complex {
60
60
let mut work_size = [ Self :: zero( ) ] ;
61
61
unsafe {
62
62
$ev(
63
- jobvl,
64
- jobvr,
63
+ jobvl as u8 ,
64
+ jobvr as u8 ,
65
65
n,
66
66
& mut a,
67
67
n,
@@ -83,8 +83,8 @@ macro_rules! impl_eig_complex {
83
83
let mut work = unsafe { vec_uninit( lwork) } ;
84
84
unsafe {
85
85
$ev(
86
- jobvl,
87
- jobvr,
86
+ jobvl as u8 ,
87
+ jobvr as u8 ,
88
88
n,
89
89
& mut a,
90
90
n,
@@ -102,7 +102,7 @@ macro_rules! impl_eig_complex {
102
102
info. as_lapack_result( ) ?;
103
103
104
104
// Hermite conjugate
105
- if jobvl == b'V' {
105
+ if jobvl == EigenVectorFlag :: Calc {
106
106
for c in vl. as_mut( ) . unwrap( ) . iter_mut( ) {
107
107
c. im = -c. im
108
108
}
@@ -144,21 +144,21 @@ macro_rules! impl_eig_real {
144
144
// `sgeev`/`dgeev`.
145
145
let ( jobvl, jobvr) = if calc_v {
146
146
match l {
147
- MatrixLayout :: C { .. } => ( b'V' , b'N' ) ,
148
- MatrixLayout :: F { .. } => ( b'N' , b'V' ) ,
147
+ MatrixLayout :: C { .. } => ( EigenVectorFlag :: Calc , EigenVectorFlag :: Not ) ,
148
+ MatrixLayout :: F { .. } => ( EigenVectorFlag :: Not , EigenVectorFlag :: Calc ) ,
149
149
}
150
150
} else {
151
- ( b'N' , b'N' )
151
+ ( EigenVectorFlag :: Not , EigenVectorFlag :: Not )
152
152
} ;
153
153
let mut eig_re = unsafe { vec_uninit( n as usize ) } ;
154
154
let mut eig_im = unsafe { vec_uninit( n as usize ) } ;
155
155
156
- let mut vl = if jobvl == b'V' {
156
+ let mut vl = if jobvl == EigenVectorFlag :: Calc {
157
157
Some ( unsafe { vec_uninit( ( n * n) as usize ) } )
158
158
} else {
159
159
None
160
160
} ;
161
- let mut vr = if jobvr == b'V' {
161
+ let mut vr = if jobvr == EigenVectorFlag :: Calc {
162
162
Some ( unsafe { vec_uninit( ( n * n) as usize ) } )
163
163
} else {
164
164
None
@@ -169,8 +169,8 @@ macro_rules! impl_eig_real {
169
169
let mut work_size = [ 0.0 ] ;
170
170
unsafe {
171
171
$ev(
172
- jobvl,
173
- jobvr,
172
+ jobvl as u8 ,
173
+ jobvr as u8 ,
174
174
n,
175
175
& mut a,
176
176
n,
@@ -192,8 +192,8 @@ macro_rules! impl_eig_real {
192
192
let mut work = unsafe { vec_uninit( lwork) } ;
193
193
unsafe {
194
194
$ev(
195
- jobvl,
196
- jobvr,
195
+ jobvl as u8 ,
196
+ jobvr as u8 ,
197
197
n,
198
198
& mut a,
199
199
n,
@@ -254,7 +254,7 @@ macro_rules! impl_eig_real {
254
254
for row in 0 ..n {
255
255
let re = v[ row + col * n] ;
256
256
let mut im = v[ row + ( col + 1 ) * n] ;
257
- if jobvl == b'V' {
257
+ if jobvl == EigenVectorFlag :: Calc {
258
258
im = -im;
259
259
}
260
260
eigvecs[ row + col * n] = Self :: complex( re, im) ;
0 commit comments