src/linsolve.rs

changeset 92
e11986179a4b
parent 55
7b2ee3e84c5f
child 93
123f7f38e161
equal deleted inserted replaced
91:db870f2a2cde 92:e11986179a4b
50 // If the "nightly" feature is enabled, we will use an uninitialised array for a 50 // If the "nightly" feature is enabled, we will use an uninitialised array for a
51 // little bit of efficiency. 51 // little bit of efficiency.
52 // This use of MaybeUninit assumes F : Copy. Otherwise undefined behaviour may occur. 52 // This use of MaybeUninit assumes F : Copy. Otherwise undefined behaviour may occur.
53 #[cfg(feature = "nightly")] 53 #[cfg(feature = "nightly")]
54 { 54 {
55 let mut x : [[MaybeUninit<F>; K]; M] = core::array::from_fn(|_| MaybeUninit::uninit_array::<K>() ); 55 let mut x: [[MaybeUninit<F>; K]; M] = [[const { MaybeUninit::uninit() }; K]; M];
56 //unsafe { std::mem::MaybeUninit::uninit().assume_init() }; 56 //unsafe { std::mem::MaybeUninit::uninit().assume_init() };
57 for i in (0..M).rev() { 57 for i in (0..M).rev() {
58 for 𝓁 in 0..K { 58 for 𝓁 in 0..K {
59 let mut tmp = ab[i][M+𝓁]; 59 let mut tmp = ab[i][M+𝓁];
60 for j in (i+1)..M { 60 for j in (i+1)..M {

mercurial