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

21 lines
420 B
Rust
Raw Normal View History

use na::{DMatrix, Matrix4x3};
2018-10-22 13:00:10 +08:00
use nl::QR;
quickcheck!{
fn qr(m: DMatrix<f64>) -> bool {
let qr = QR::new(m.clone());
let q = qr.q();
let r = qr.r();
relative_eq!(m, q * r, epsilon = 1.0e-7)
}
fn qr_static(m: Matrix4x3<f64>) -> bool {
let qr = QR::new(m);
let q = qr.q();
let r = qr.r();
relative_eq!(m, q * r, epsilon = 1.0e-7)
}
}