use na::{Quaternion, UnitQuaternion, Vector3}; use rand::Rng; use rand_isaac::IsaacRng; use std::ops::{Add, Div, Mul, Sub}; #[path = "../common/macros.rs"] mod macros; bench_binop!(quaternion_add_q, Quaternion, Quaternion, add); bench_binop!(quaternion_sub_q, Quaternion, Quaternion, sub); bench_binop!(quaternion_mul_q, Quaternion, Quaternion, mul); bench_binop!( unit_quaternion_mul_v, UnitQuaternion, Vector3, mul ); bench_binop!(quaternion_mul_s, Quaternion, f32, mul); bench_binop!(quaternion_div_s, Quaternion, f32, div); bench_unop!(quaternion_inv, Quaternion, try_inverse); bench_unop!(unit_quaternion_inv, UnitQuaternion, inverse); // bench_unop_self!(quaternion_conjugate, Quaternion, conjugate); // bench_unop!(quaternion_normalize, Quaternion, normalize); criterion_group!( quaternion, quaternion_add_q, quaternion_sub_q, quaternion_mul_q, unit_quaternion_mul_v, quaternion_mul_s, quaternion_div_s, quaternion_inv, unit_quaternion_inv );