@@ -8,7 +8,6 @@ use itertools::Itertools;
8
8
use num_traits:: Signed ;
9
9
use std:: collections:: BTreeSet ;
10
10
use std:: iter:: FusedIterator ;
11
- use std:: mem:: MaybeUninit ;
12
11
use std:: ops:: { Deref , DerefMut , Index , IndexMut , Neg , Range } ;
13
12
use std:: slice:: { Iter , IterMut } ;
14
13
use thiserror:: Error ;
@@ -232,20 +231,6 @@ impl<C> Matrix<C> {
232
231
} )
233
232
}
234
233
235
- /// Construct a new Matrix with uninitialized content.
236
- pub fn new_uninit ( rows : usize , columns : usize ) -> Matrix < MaybeUninit < C > > {
237
- let data_len = rows * columns;
238
- let mut data = Vec :: with_capacity ( data_len) ;
239
- unsafe {
240
- data. set_len ( data_len) ;
241
- }
242
- Matrix {
243
- rows,
244
- columns,
245
- data,
246
- }
247
- }
248
-
249
234
/// Create new square matrix from vector values. The first value
250
235
/// will be assigned to index (0, 0), the second one to index (0, 1),
251
236
/// and so on. An error is returned if the number of values is not a
@@ -636,23 +621,6 @@ impl<C> Matrix<C> {
636
621
}
637
622
}
638
623
639
- impl < C > Matrix < MaybeUninit < C > > {
640
- /// Convert to `Matrix<C>`.
641
- ///
642
- /// # Safety
643
- ///
644
- /// As with [`MaybeUninit::assume_init()`], it is up to the caller to guarantee
645
- /// that the value really is in an initialized state. Calling this when the content
646
- /// is not yet fully initialized causes immediate undefined behavior.
647
- pub unsafe fn assume_init ( self ) -> Matrix < C > {
648
- Matrix {
649
- rows : self . rows ,
650
- columns : self . columns ,
651
- data : std:: mem:: transmute ( self . data ) ,
652
- }
653
- }
654
- }
655
-
656
624
impl < C > Index < ( usize , usize ) > for Matrix < C > {
657
625
type Output = C ;
658
626
0 commit comments