pub trait ScalarAd:
Copy
+ PartialEq
+ Neg<Output = Self>
+ Add<Output = Self>
+ Sub<Output = Self>
+ Mul<Output = Self>
+ Div<Output = Self> {
type Real: Copy + Float + FloatConst;
Show 34 methods
// Required methods
fn conj(self) -> Self;
fn recip(self) -> Self;
fn cbrt(self) -> Self;
fn sqrt(self) -> Self;
fn exp(self) -> Self;
fn exp2(self) -> Self;
fn exp10(self) -> Self;
fn expm1(self) -> Self;
fn ln(self) -> Self;
fn log1p(self) -> Self;
fn log2(self) -> Self;
fn log10(self) -> Self;
fn sin(self) -> Self;
fn cos(self) -> Self;
fn tan(self) -> Self;
fn tanh(self) -> Self;
fn asin(self) -> Self;
fn acos(self) -> Self;
fn atan(self) -> Self;
fn sinh(self) -> Self;
fn cosh(self) -> Self;
fn asinh(self) -> Self;
fn acosh(self) -> Self;
fn atanh(self) -> Self;
fn abs(self) -> Self::Real;
fn abs2(self) -> Self::Real;
fn real(self) -> Self::Real;
fn imag(self) -> Self::Real;
fn angle(self) -> Self::Real;
fn powf(self, exponent: Self::Real) -> Self;
fn powi(self, exponent: i32) -> Self;
fn pow(self, exponent: Self) -> Self;
fn from_real(value: Self::Real) -> Self;
fn from_i32(value: i32) -> Self;
}Expand description
Scalar trait used by elementary AD rule helpers.
§Examples
use chainrules::ScalarAd;
fn takes_scalar<S: ScalarAd>(_x: S) {}
takes_scalar(1.0_f32);
takes_scalar(1.0_f64);Required Associated Types§
Sourcetype Real: Copy + Float + FloatConst
type Real: Copy + Float + FloatConst
Real exponent type for powf.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.