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 {
1818 MatrixLayout :: F { .. } => t,
1919 MatrixLayout :: C { .. } => t. transpose( ) ,
2020 } ;
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 ) }
2323 } else {
2424 Vec :: new( )
2525 } ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ macro_rules! impl_qr {
2525 let m = l. lda( ) ;
2626 let n = l. len( ) ;
2727 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 ) } ;
2929
3030 // eval work size
3131 let mut info = 0 ;
@@ -62,7 +62,7 @@ macro_rules! impl_qr {
6262
6363 // calc
6464 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) } ;
6666 unsafe {
6767 match l {
6868 MatrixLayout :: F { .. } => {
@@ -93,6 +93,8 @@ macro_rules! impl_qr {
9393 }
9494 info. as_lapack_result( ) ?;
9595
96+ let tau = unsafe { tau. assume_init( ) } ;
97+
9698 Ok ( tau)
9799 }
98100
@@ -134,7 +136,7 @@ macro_rules! impl_qr {
134136
135137 // calc
136138 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) } ;
138140 unsafe {
139141 match l {
140142 MatrixLayout :: F { .. } => $gqr(
You can’t perform that action at this time.
0 commit comments