nalgebra/benches/linalg/symmetric_eigen.rs

38 lines
1.3 KiB
Rust
Raw Permalink Normal View History

use na::{Matrix4, SymmetricEigen};
fn symmetric_eigen_decompose_4x4(bh: &mut criterion::Criterion) {
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
});
}
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
});
}
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
});
}
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
});
}
2020-04-06 00:49:48 +08:00
criterion_group!(
symmetric_eigen,
symmetric_eigen_decompose_4x4,
symmetric_eigen_decompose_10x10,
symmetric_eigen_decompose_100x100,
symmetric_eigen_decompose_200x200
);