1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
//! Shared scalar trait bounds. use ndarray::ScalarOperand; use num_traits::{Float, FromPrimitive}; /// Canonical real scalar bound for ndarray-native public APIs. /// /// This trait intentionally maps to the first-class real scalar set supported /// by nabled: `f32` and `f64`. pub trait NabledReal: Float + FromPrimitive + ScalarOperand + Copy + Send + Sync + std::fmt::Debug + std::ops::AddAssign + std::ops::SubAssign + std::ops::MulAssign + std::ops::DivAssign + 'static { } impl NabledReal for f32 {} impl NabledReal for f64 {}