pub struct LuDecompositionF32 { /* private fields */ }Expand description
Compact LU factorization in column-major layout.
Implementations§
Source§impl LuDecompositionF32
impl LuDecompositionF32
Sourcepub fn factors(&self) -> &[f32]
pub fn factors(&self) -> &[f32]
Examples found in repository?
examples/05_lapack_decompositions.rs (line 8)
3fn main() {
4 // Column-major 2x2 matrix [[3, 1], [1, 2]].
5 let matrix = [3.0_f32, 1.0, 1.0, 2.0];
6 let lu = lu_decompose_f32(&matrix, 2).expect("lu");
7 assert_eq!(lu.dimension(), 2);
8 assert_eq!(lu.factors().len(), 4);
9
10 let solution = solve_linear_system_f32(&matrix, 2, &[9.0_f32, 8.0]).expect("solve");
11 assert!((solution[0] - 2.0).abs() < 1.0e-5);
12 assert!((solution[1] - 3.0).abs() < 1.0e-5);
13
14 println!(
15 "lapack smoke passed: pivots={:?} solution={solution:?}",
16 lu.pivots()
17 );
18}Sourcepub fn pivots(&self) -> &[i32]
pub fn pivots(&self) -> &[i32]
Examples found in repository?
examples/05_lapack_decompositions.rs (line 16)
3fn main() {
4 // Column-major 2x2 matrix [[3, 1], [1, 2]].
5 let matrix = [3.0_f32, 1.0, 1.0, 2.0];
6 let lu = lu_decompose_f32(&matrix, 2).expect("lu");
7 assert_eq!(lu.dimension(), 2);
8 assert_eq!(lu.factors().len(), 4);
9
10 let solution = solve_linear_system_f32(&matrix, 2, &[9.0_f32, 8.0]).expect("solve");
11 assert!((solution[0] - 2.0).abs() < 1.0e-5);
12 assert!((solution[1] - 3.0).abs() < 1.0e-5);
13
14 println!(
15 "lapack smoke passed: pivots={:?} solution={solution:?}",
16 lu.pivots()
17 );
18}Sourcepub const fn dimension(&self) -> usize
pub const fn dimension(&self) -> usize
Examples found in repository?
examples/05_lapack_decompositions.rs (line 7)
3fn main() {
4 // Column-major 2x2 matrix [[3, 1], [1, 2]].
5 let matrix = [3.0_f32, 1.0, 1.0, 2.0];
6 let lu = lu_decompose_f32(&matrix, 2).expect("lu");
7 assert_eq!(lu.dimension(), 2);
8 assert_eq!(lu.factors().len(), 4);
9
10 let solution = solve_linear_system_f32(&matrix, 2, &[9.0_f32, 8.0]).expect("solve");
11 assert!((solution[0] - 2.0).abs() < 1.0e-5);
12 assert!((solution[1] - 3.0).abs() < 1.0e-5);
13
14 println!(
15 "lapack smoke passed: pivots={:?} solution={solution:?}",
16 lu.pivots()
17 );
18}Trait Implementations§
Source§impl Clone for LuDecompositionF32
impl Clone for LuDecompositionF32
Source§fn clone(&self) -> LuDecompositionF32
fn clone(&self) -> LuDecompositionF32
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LuDecompositionF32
impl Debug for LuDecompositionF32
Source§impl PartialEq for LuDecompositionF32
impl PartialEq for LuDecompositionF32
Source§fn eq(&self, other: &LuDecompositionF32) -> bool
fn eq(&self, other: &LuDecompositionF32) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for LuDecompositionF32
Auto Trait Implementations§
impl Freeze for LuDecompositionF32
impl RefUnwindSafe for LuDecompositionF32
impl Send for LuDecompositionF32
impl Sync for LuDecompositionF32
impl Unpin for LuDecompositionF32
impl UnsafeUnpin for LuDecompositionF32
impl UnwindSafe for LuDecompositionF32
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more