2017-08-03 01:38:28 +08:00
|
|
|
use na::{DMatrix, Matrix4x3};
|
2018-10-22 13:00:10 +08:00
|
|
|
use nl::QR;
|
2017-08-03 01:38:28 +08:00
|
|
|
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|