nalgebra/benches/construction.rs

20 lines
776 B
Rust
Raw Normal View History

2015-03-26 22:22:27 +08:00
#![feature(test)]
2014-11-07 23:15:56 +08:00
extern crate test;
2015-02-17 21:10:08 +08:00
extern crate rand;
2015-03-26 22:22:27 +08:00
extern crate nalgebra as na;
2014-11-07 23:15:56 +08:00
2015-02-17 21:10:08 +08:00
use rand::{IsaacRng, Rng};
2014-11-07 23:15:56 +08:00
use test::Bencher;
use na::{UnitQuaternion, Rotation2, Rotation3, Vector1, Vector3};
2014-11-07 23:15:56 +08:00
#[path="common/macros.rs"]
mod macros;
2016-08-16 19:35:17 +08:00
bench_construction!(_bench_quaternion_from_axisangle, UnitQuaternion::from_scaled_axis, axisangle: Vector3<f32>);
bench_construction!(_bench_rot2_from_axisangle, Rotation2::new, axisangle: Vector1<f32>);
bench_construction!(_bench_rot3_from_axisangle, Rotation3::new, axisangle: Vector3<f32>);
2014-11-07 23:15:56 +08:00
2016-08-16 19:35:17 +08:00
bench_construction!(_bench_quaternion_from_euler_angles, UnitQuaternion::from_euler_angles, roll: f32, pitch: f32, yaw: f32);
bench_construction!(_bench_rot3_from_euler_angles, Rotation3::from_euler_angles, roll: f32, pitch: f32, yaw: f32);