File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ macro_rules! impl_opnorm {
18
18
MatrixLayout :: F { .. } => t,
19
19
MatrixLayout :: C { .. } => t. transpose( ) ,
20
20
} ;
21
- let mut work: Vec <Self :: Real > = if matches!( t, NormType :: Infinity ) {
22
- unsafe { vec_uninit ( m as usize ) }
21
+ let mut work: Vec <MaybeUninit < Self :: Real > > = if matches!( t, NormType :: Infinity ) {
22
+ unsafe { vec_uninit2 ( m as usize ) }
23
23
} else {
24
24
Vec :: new( )
25
25
} ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ macro_rules! impl_qr {
25
25
let m = l. lda( ) ;
26
26
let n = l. len( ) ;
27
27
let k = m. min( n) ;
28
- let mut tau = unsafe { vec_uninit ( k as usize ) } ;
28
+ let mut tau = unsafe { vec_uninit2 ( k as usize ) } ;
29
29
30
30
// eval work size
31
31
let mut info = 0 ;
@@ -62,7 +62,7 @@ macro_rules! impl_qr {
62
62
63
63
// calc
64
64
let lwork = work_size[ 0 ] . to_usize( ) . unwrap( ) ;
65
- let mut work: Vec <Self > = unsafe { vec_uninit ( lwork) } ;
65
+ let mut work: Vec <MaybeUninit < Self >> = unsafe { vec_uninit2 ( lwork) } ;
66
66
unsafe {
67
67
match l {
68
68
MatrixLayout :: F { .. } => {
@@ -93,6 +93,8 @@ macro_rules! impl_qr {
93
93
}
94
94
info. as_lapack_result( ) ?;
95
95
96
+ let tau = unsafe { tau. assume_init( ) } ;
97
+
96
98
Ok ( tau)
97
99
}
98
100
@@ -134,7 +136,7 @@ macro_rules! impl_qr {
134
136
135
137
// calc
136
138
let lwork = work_size[ 0 ] . to_usize( ) . unwrap( ) ;
137
- let mut work: Vec <Self > = unsafe { vec_uninit ( lwork) } ;
139
+ let mut work: Vec <MaybeUninit < Self >> = unsafe { vec_uninit2 ( lwork) } ;
138
140
unsafe {
139
141
match l {
140
142
MatrixLayout :: F { .. } => $gqr(
You can’t perform that action at this time.
0 commit comments