2017-08-03 01:37:44 +08:00
|
|
|
use na::{Matrix4, SymmetricEigen};
|
|
|
|
|
2019-03-24 02:07:16 +08:00
|
|
|
fn symmetric_eigen_decompose_4x4(bh: &mut criterion::Criterion) {
|
2017-08-03 01:37:44 +08:00
|
|
|
let m = Matrix4::<f64>::new_random();
|
2020-04-06 00:49:48 +08:00
|
|
|
bh.bench_function("symmetric_eigen_decompose_4x4", move |bh| {
|
2021-04-12 16:52:17 +08:00
|
|
|
bh.iter(|| std::hint::black_box(SymmetricEigen::new(m.clone())))
|
2020-04-06 00:49:48 +08:00
|
|
|
});
|
2017-08-03 01:37:44 +08:00
|
|
|
}
|
|
|
|
|
2019-03-24 02:07:16 +08:00
|
|
|
fn symmetric_eigen_decompose_10x10(bh: &mut criterion::Criterion) {
|
2019-03-23 21:29:07 +08:00
|
|
|
let m = crate::reproductible_dmatrix(10, 10);
|
2020-04-06 00:49:48 +08:00
|
|
|
bh.bench_function("symmetric_eigen_decompose_10x10", move |bh| {
|
2021-04-12 16:52:17 +08:00
|
|
|
bh.iter(|| std::hint::black_box(SymmetricEigen::new(m.clone())))
|
2020-04-06 00:49:48 +08:00
|
|
|
});
|
2017-08-03 01:37:44 +08:00
|
|
|
}
|
|
|
|
|
2019-03-24 02:07:16 +08:00
|
|
|
fn symmetric_eigen_decompose_100x100(bh: &mut criterion::Criterion) {
|
2019-03-23 21:29:07 +08:00
|
|
|
let m = crate::reproductible_dmatrix(100, 100);
|
2020-04-06 00:49:48 +08:00
|
|
|
bh.bench_function("symmetric_eigen_decompose_100x100", move |bh| {
|
2021-04-12 16:52:17 +08:00
|
|
|
bh.iter(|| std::hint::black_box(SymmetricEigen::new(m.clone())))
|
2020-04-06 00:49:48 +08:00
|
|
|
});
|
2017-08-03 01:37:44 +08:00
|
|
|
}
|
|
|
|
|
2019-03-24 02:07:16 +08:00
|
|
|
fn symmetric_eigen_decompose_200x200(bh: &mut criterion::Criterion) {
|
2019-03-23 21:29:07 +08:00
|
|
|
let m = crate::reproductible_dmatrix(200, 200);
|
2020-04-06 00:49:48 +08:00
|
|
|
bh.bench_function("symmetric_eigen_decompose_200x200", move |bh| {
|
2021-04-12 16:52:17 +08:00
|
|
|
bh.iter(|| std::hint::black_box(SymmetricEigen::new(m.clone())))
|
2020-04-06 00:49:48 +08:00
|
|
|
});
|
2017-08-03 01:37:44 +08:00
|
|
|
}
|
2019-03-24 02:07:16 +08:00
|
|
|
|
2020-04-06 00:49:48 +08:00
|
|
|
criterion_group!(
|
|
|
|
symmetric_eigen,
|
2019-03-24 02:07:16 +08:00
|
|
|
symmetric_eigen_decompose_4x4,
|
|
|
|
symmetric_eigen_decompose_10x10,
|
|
|
|
symmetric_eigen_decompose_100x100,
|
|
|
|
symmetric_eigen_decompose_200x200
|
|
|
|
);
|