nalgebra/benches/lib.rs
Bruce Mitchener 9042d1424c Use std::hint::black_box consistently.
This also removes the `#![feature(bench_black_box)]`. This was
stabilized in Rust 1.66 and anyone building benchmarks will be
on that or later (as they previously would have been on nightly).

This also allows building `cargo build --all-targets` on stable
Rust as it no longer dies when hitting the feature addition in
the benchmarks.
2023-08-14 11:15:57 +07:00

38 lines
737 B
Rust

#![allow(unused_macros)]
extern crate nalgebra as na;
extern crate rand_package as rand;
#[macro_use]
extern crate criterion;
use na::DMatrix;
use rand::Rng;
use rand_isaac::IsaacRng;
pub mod core;
pub mod geometry;
pub mod linalg;
fn reproductible_dmatrix(nrows: usize, ncols: usize) -> DMatrix<f64> {
use rand::SeedableRng;
let mut rng = IsaacRng::seed_from_u64(0);
DMatrix::<f64>::from_fn(nrows, ncols, |_, _| rng.gen())
}
criterion_main!(
core::matrix,
core::vector,
geometry::quaternion,
linalg::bidiagonal,
linalg::cholesky,
linalg::full_piv_lu,
linalg::hessenberg,
linalg::lu,
linalg::qr,
linalg::schur,
linalg::solve,
linalg::svd,
linalg::symmetric_eigen,
);