nalgebra/nalgebra-lapack/tests/linalg/qr.rs

25 lines
487 B
Rust
Raw Permalink Normal View History

2018-10-22 13:00:10 +08:00
use nl::QR;
use crate::proptest::*;
use proptest::{prop_assert, proptest};
proptest! {
#[test]
fn qr(m in dmatrix()) {
let qr = QR::new(m.clone());
let q = qr.q();
let r = qr.r();
prop_assert!(relative_eq!(m, q * r, epsilon = 1.0e-7))
}
#[test]
fn qr_static(m in matrix5x3()) {
let qr = QR::new(m);
let q = qr.q();
let r = qr.r();
prop_assert!(relative_eq!(m, q * r, epsilon = 1.0e-7))
}
}