2019-03-23 18:46:56 +08:00
|
|
|
use na::{Matrix4, Schur};
|
2018-10-22 13:00:10 +08:00
|
|
|
use test::{self, Bencher};
|
2017-08-03 01:37:44 +08:00
|
|
|
|
|
|
|
#[bench]
|
|
|
|
fn schur_decompose_4x4(bh: &mut Bencher) {
|
|
|
|
let m = Matrix4::<f64>::new_random();
|
2019-03-23 18:46:56 +08:00
|
|
|
bh.iter(|| test::black_box(Schur::new(m.clone())))
|
2017-08-03 01:37:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#[bench]
|
|
|
|
fn schur_decompose_10x10(bh: &mut Bencher) {
|
2019-03-23 21:29:07 +08:00
|
|
|
let m = crate::reproductible_dmatrix(10, 10);
|
2019-03-23 18:46:56 +08:00
|
|
|
bh.iter(|| test::black_box(Schur::new(m.clone())))
|
2017-08-03 01:37:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#[bench]
|
|
|
|
fn schur_decompose_100x100(bh: &mut Bencher) {
|
2019-03-23 21:29:07 +08:00
|
|
|
let m = crate::reproductible_dmatrix(100, 100);
|
2019-03-23 18:46:56 +08:00
|
|
|
bh.iter(|| test::black_box(Schur::new(m.clone())))
|
2017-08-03 01:37:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#[bench]
|
|
|
|
fn schur_decompose_200x200(bh: &mut Bencher) {
|
2019-03-23 21:29:07 +08:00
|
|
|
let m = crate::reproductible_dmatrix(200, 200);
|
2019-03-23 18:46:56 +08:00
|
|
|
bh.iter(|| test::black_box(Schur::new(m.clone())))
|
2017-08-03 01:37:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#[bench]
|
|
|
|
fn eigenvalues_4x4(bh: &mut Bencher) {
|
|
|
|
let m = Matrix4::<f64>::new_random();
|
|
|
|
bh.iter(|| test::black_box(m.complex_eigenvalues()))
|
|
|
|
}
|
|
|
|
|
|
|
|
#[bench]
|
|
|
|
fn eigenvalues_10x10(bh: &mut Bencher) {
|
2019-03-23 21:29:07 +08:00
|
|
|
let m = crate::reproductible_dmatrix(10, 10);
|
2017-08-03 01:37:44 +08:00
|
|
|
bh.iter(|| test::black_box(m.complex_eigenvalues()))
|
|
|
|
}
|
|
|
|
|
|
|
|
#[bench]
|
|
|
|
fn eigenvalues_100x100(bh: &mut Bencher) {
|
2019-03-23 21:29:07 +08:00
|
|
|
let m = crate::reproductible_dmatrix(100, 100);
|
2017-08-03 01:37:44 +08:00
|
|
|
bh.iter(|| test::black_box(m.complex_eigenvalues()))
|
|
|
|
}
|
|
|
|
|
|
|
|
#[bench]
|
|
|
|
fn eigenvalues_200x200(bh: &mut Bencher) {
|
2019-03-23 21:29:07 +08:00
|
|
|
let m = crate::reproductible_dmatrix(200, 200);
|
2017-08-03 01:37:44 +08:00
|
|
|
bh.iter(|| test::black_box(m.complex_eigenvalues()))
|
|
|
|
}
|