[−][src]Struct easy_ml::differentiation::Trace
A dual number which traces a real number and keeps track of its derivative. This is used to perform Forward Automatic Differentiation
Trace implements only first order differentiation. For example, given a function
3x2, you can use calculus to work out that its derivative with respect
to x is 6x. You can also take the derivative of 6x with respect to x and work out
that the second derivative is 6. By instead writing the function 3x2 in
code using Trace types as your numbers you can compute the first order derivative
for a given value of x by passing your function Trace { number: x, derivative: 1.0 }.
use easy_ml::differentiation::Trace; let x = Trace { number: 3.2, derivative: 1.0 }; let dx = Trace::constant(3.0) * x * x; assert_eq!(dx.derivative, 3.2 * 6.0);
Why the one for the starting derivative? Because δx/δx = 1, as with symbolic differentiation.
Acknowledgments
The wikipedia page on Automatic Differentiation provided a very useful overview and explanation for understanding Forward Mode Automatic Differentiation as well as the implementation rules.
Fields
number: TThe real number
derivative: TThe first order derivative of this number.
Implementations
impl<T: Numeric + Primitive> Trace<T>[src]
The main set of methods for using Trace types for Forward Differentiation.
The general steps are
- create one variable
- create as many constants as needed
- do operations on the variable and constants
- the outputs will have derivatives computed which can be accessed from
the
.derivativefield, with each derivative being the output with respect to the input variable. - if you need derivatives for a different input then do everything all over again or do them all in parallel
pub fn constant(c: T) -> Trace<T>[src]
Constants are lifted to Traces with a derivative of 0
Why zero for the starting derivative? Because for any constant C δC/δx = 0, as with symbolic differentiation.
pub fn variable(x: T) -> Trace<T>[src]
To lift a variable that you want to find the derivative of a function to, the Trace starts with a derivative of 1
Why the one for the starting derivative? Because δx/δx = 1, as with symbolic differentiation.
pub fn derivative(function: impl Fn(Trace<T>) -> Trace<T>, x: T) -> T[src]
Computes the derivative of a function with respect to its input x.
This is a shorthand for (function(Trace::variable(x))).derivative
In the more general case, if you provide a function with an input x and it returns N outputs y1 to yN then you have computed all the derivatives δyi/δx for i = 1 to N.
impl<T: Numeric + Primitive> Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
pub fn unary(&self, fx: impl Fn(T) -> T, dfx_dx: impl Fn(T) -> T) -> Trace<T>[src]
Creates a new Trace from a reference to an existing Trace by applying some unary function to it which operates on the type the Trace wraps.
To compute the new trace, the unary function of some input x to some output y is needed along with its derivative with respect to its input x.
For example, tanh is a commonly used activation function, but the Real trait does not include this operation and Trace has no operations for it specifically. However, you can use this function to compute the tanh of a Trace like so:
use easy_ml::differentiation::Trace; let x = Trace::variable(0.7f32); // the derivative of tanh(x) is sech(x) * sech(x) which is equivalent to // 1 / (cosh(x) * cosh(x)) let y = x.unary(|x| x.tanh(), |x| 1.0 / (x.cosh() * x.cosh())); assert_eq!(y.derivative, 1.0f32 / (0.7f32.cosh() * 0.7f32.cosh()));
pub fn binary(
&self,
rhs: &Trace<T>,
fxy: impl Fn(T, T) -> T,
dfxy_dx: impl Fn(T, T) -> T,
dfxy_dy: impl Fn(T, T) -> T
) -> Trace<T>[src]
&self,
rhs: &Trace<T>,
fxy: impl Fn(T, T) -> T,
dfxy_dx: impl Fn(T, T) -> T,
dfxy_dy: impl Fn(T, T) -> T
) -> Trace<T>
Creates a new Trace from a reference to two existing Traces by applying some binary function to them which operates on two arguments of the type the Traces wrap.
To compute the new trace, the binary function of some inputs x and y to some output z is needed along with its derivative with respect to its first input x and its derivative with respect to its second input y.
For example, atan2 takes two arguments, but the Real trait does not include this operation and Trace has no operations for it specifically. However, you can use this function to compute the atan2 of two Traces like so:
use easy_ml::differentiation::Trace; let x = Trace::variable(3.0f32); let y = Trace::variable(3.0f32); // the derivative of atan2 with respect to x is y/(x*x + y*y) // https://www.wolframalpha.com/input/?i=d%28atan2%28x%2Cy%29%29%2Fdx // the derivative of atan2 with respect to y is -x/(x*x + y*y) // https://www.wolframalpha.com/input/?i=d%28atan2%28x%2Cy%29%29%2Fdy let z = x.binary(&y, |x, y| x.atan2(y), |x, y| y/((x*x) + (y*y)), |x, y| -x/((x*x) + (y*y)) );
Trait Implementations
impl<T: Numeric + Primitive, '_, '_> Add<&'_ T> for &'_ Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Addition for a trace and a constant of the same type with both referenced.
type Output = Trace<T>
The resulting type after applying the + operator.
fn add(self, rhs: &T) -> Self::Output[src]
impl<T: Numeric + Primitive, '_> Add<&'_ T> for Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for a trace and a constant of the same type with the right referenced.
type Output = Trace<T>
The resulting type after applying the + operator.
fn add(self, rhs: &T) -> Self::Output[src]
impl<T: Numeric + Primitive, '_> Add<&'_ Trace<T>> for Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for two traces of the same type with the right referenced.
type Output = Trace<T>
The resulting type after applying the + operator.
fn add(self, rhs: &Trace<T>) -> Self::Output[src]
impl<'l, 'r, T: Numeric + Primitive> Add<&'r Trace<T>> for &'l Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Addition for two traces of the same type with both referenced.
type Output = Trace<T>
The resulting type after applying the + operator.
fn add(self, rhs: &Trace<T>) -> Self::Output[src]
impl<T: Numeric + Primitive> Add<T> for Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for a trace and a constant of the same type.
type Output = Trace<T>
The resulting type after applying the + operator.
fn add(self, rhs: T) -> Self::Output[src]
impl<T: Numeric + Primitive, '_> Add<T> for &'_ Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for a trace and a constant of the same type with the left referenced.
type Output = Trace<T>
The resulting type after applying the + operator.
fn add(self, rhs: T) -> Self::Output[src]
impl<T: Numeric + Primitive> Add<Trace<T>> for Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for two traces of the same type.
type Output = Trace<T>
The resulting type after applying the + operator.
fn add(self, rhs: Trace<T>) -> Self::Output[src]
impl<T: Numeric + Primitive, '_> Add<Trace<T>> for &'_ Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for two traces of the same type with the left referenced.
type Output = Trace<T>
The resulting type after applying the + operator.
fn add(self, rhs: Trace<T>) -> Self::Output[src]
impl<T: Clone + Primitive> Clone for Trace<T>[src]
Any trace of a Cloneable type implements clone
fn clone(&self) -> Self[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<T: Copy + Primitive> Copy for Trace<T>[src]
Any trace of a Copy type implements Copy
impl<T: Numeric + Real + Primitive, '_> Cos for &'_ Trace<T> where
&'a T: NumericRef<T> + RealRef<T>, [src]
&'a T: NumericRef<T> + RealRef<T>,
Cosine of a Trace by reference.
impl<T: Numeric + Real + Primitive> Cos for Trace<T> where
&'a T: NumericRef<T> + RealRef<T>, [src]
&'a T: NumericRef<T> + RealRef<T>,
Operation for a trace by value.
impl<T: Debug + Primitive> Debug for Trace<T>[src]
impl<T: Display + Primitive> Display for Trace<T>[src]
A trace is displayed by showing its number component.
impl<T: Numeric + Primitive, '_, '_> Div<&'_ T> for &'_ Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Dvision for a trace and a constant of the same type with both referenced.
type Output = Trace<T>
The resulting type after applying the / operator.
fn div(self, rhs: &T) -> Self::Output[src]
impl<T: Numeric + Primitive, '_> Div<&'_ T> for Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for a trace and a constant of the same type with the right referenced.
type Output = Trace<T>
The resulting type after applying the / operator.
fn div(self, rhs: &T) -> Self::Output[src]
impl<T: Numeric + Primitive, '_> Div<&'_ Trace<T>> for Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for two traces of the same type with the right referenced.
type Output = Trace<T>
The resulting type after applying the / operator.
fn div(self, rhs: &Trace<T>) -> Self::Output[src]
impl<'l, 'r, T: Numeric + Primitive> Div<&'r Trace<T>> for &'l Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Division for two referenced traces of the same type.
type Output = Trace<T>
The resulting type after applying the / operator.
fn div(self, rhs: &Trace<T>) -> Self::Output[src]
impl<T: Numeric + Primitive> Div<T> for Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for a trace and a constant of the same type.
type Output = Trace<T>
The resulting type after applying the / operator.
fn div(self, rhs: T) -> Self::Output[src]
impl<T: Numeric + Primitive, '_> Div<T> for &'_ Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for a trace and a constant of the same type with the left referenced.
type Output = Trace<T>
The resulting type after applying the / operator.
fn div(self, rhs: T) -> Self::Output[src]
impl<T: Numeric + Primitive> Div<Trace<T>> for Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for two traces of the same type.
type Output = Trace<T>
The resulting type after applying the / operator.
fn div(self, rhs: Trace<T>) -> Self::Output[src]
impl<T: Numeric + Primitive, '_> Div<Trace<T>> for &'_ Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for two traces of the same type with the left referenced.
type Output = Trace<T>
The resulting type after applying the / operator.
fn div(self, rhs: Trace<T>) -> Self::Output[src]
impl<T: Numeric + Real + Primitive, '_> Exp for &'_ Trace<T> where
&'a T: NumericRef<T> + RealRef<T>, [src]
&'a T: NumericRef<T> + RealRef<T>,
Exponential, ie ex of a Trace by reference.
impl<T: Numeric + Real + Primitive> Exp for Trace<T> where
&'a T: NumericRef<T> + RealRef<T>, [src]
&'a T: NumericRef<T> + RealRef<T>,
Operation for a trace by value.
impl<T: Numeric + Primitive> FromUsize for Trace<T>[src]
fn from_usize(n: usize) -> Option<Trace<T>>[src]
impl<T: Numeric + Real + Primitive, '_> Ln for &'_ Trace<T> where
&'a T: NumericRef<T> + RealRef<T>, [src]
&'a T: NumericRef<T> + RealRef<T>,
Natural logarithm, ie ln(x) of a Trace by reference.
impl<T: Numeric + Real + Primitive> Ln for Trace<T> where
&'a T: NumericRef<T> + RealRef<T>, [src]
&'a T: NumericRef<T> + RealRef<T>,
Operation for a trace by value.
impl<T: Numeric + Primitive, '_, '_> Mul<&'_ T> for &'_ Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Multiplication for a trace and a constant of the same type with both referenced.
type Output = Trace<T>
The resulting type after applying the * operator.
fn mul(self, rhs: &T) -> Self::Output[src]
impl<T: Numeric + Primitive, '_> Mul<&'_ T> for Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for a trace and a constant of the same type with the right referenced.
type Output = Trace<T>
The resulting type after applying the * operator.
fn mul(self, rhs: &T) -> Self::Output[src]
impl<T: Numeric + Primitive, '_> Mul<&'_ Trace<T>> for Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for two traces of the same type with the right referenced.
type Output = Trace<T>
The resulting type after applying the * operator.
fn mul(self, rhs: &Trace<T>) -> Self::Output[src]
impl<'l, 'r, T: Numeric + Primitive> Mul<&'r Trace<T>> for &'l Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Multiplication for two referenced traces of the same type.
type Output = Trace<T>
The resulting type after applying the * operator.
fn mul(self, rhs: &Trace<T>) -> Self::Output[src]
impl<T: Numeric + Primitive> Mul<T> for Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for a trace and a constant of the same type.
type Output = Trace<T>
The resulting type after applying the * operator.
fn mul(self, rhs: T) -> Self::Output[src]
impl<T: Numeric + Primitive, '_> Mul<T> for &'_ Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for a trace and a constant of the same type with the left referenced.
type Output = Trace<T>
The resulting type after applying the * operator.
fn mul(self, rhs: T) -> Self::Output[src]
impl<T: Numeric + Primitive> Mul<Trace<T>> for Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for two traces of the same type.
type Output = Trace<T>
The resulting type after applying the * operator.
fn mul(self, rhs: Trace<T>) -> Self::Output[src]
impl<T: Numeric + Primitive, '_> Mul<Trace<T>> for &'_ Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for two traces of the same type with the left referenced.
type Output = Trace<T>
The resulting type after applying the * operator.
fn mul(self, rhs: Trace<T>) -> Self::Output[src]
impl<T: Numeric + Primitive, '_> Neg for &'_ Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Negation for a referenced Trace of some type.
type Output = Trace<T>
The resulting type after applying the - operator.
fn neg(self) -> Self::Output[src]
impl<T: Numeric + Primitive> Neg for Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Negation for a Trace by value of some type.
type Output = Trace<T>
The resulting type after applying the - operator.
fn neg(self) -> Self::Output[src]
impl<T: PartialEq + Primitive> PartialEq<Trace<T>> for Trace<T>[src]
Any trace of a PartialEq type implements PartialEq
Note that as a Trace is intended to be substitutable with its type T only the number parts of the trace are compared. Hence the following is true
use easy_ml::differentiation::Trace; assert_eq!(Trace { number: 0, derivative: 1 }, Trace { number: 0, derivative: 2 })
impl<T: PartialOrd + Primitive> PartialOrd<Trace<T>> for Trace<T>[src]
Any trace of a PartialOrd type implements PartialOrd
Note that as a Trace is intended to be substitutable with its type T only the number parts of the trace are compared. Hence the following is true
use easy_ml::differentiation::Trace; assert!(Trace { number: 1, derivative: 1 } > Trace { number: 0, derivative: 2 })
fn partial_cmp(&self, other: &Self) -> Option<Ordering>[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl<T: Numeric + Real + Primitive> Pi for Trace<T>[src]
impl<T: Numeric + Real + Primitive, '_, '_> Pow<&'_ T> for &'_ Trace<T> where
&'a T: NumericRef<T> + RealRef<T>, [src]
&'a T: NumericRef<T> + RealRef<T>,
Power of a trace to a constant of the same type with both referenced.
impl<T: Numeric + Real + Primitive, '_> Pow<&'_ T> for Trace<T> where
&'a T: NumericRef<T> + RealRef<T>, [src]
&'a T: NumericRef<T> + RealRef<T>,
Operation for a trace and a constant of the same type with the right referenced.
impl<T: Numeric + Real + Primitive, '_> Pow<&'_ Trace<T>> for Trace<T> where
&'a T: NumericRef<T> + RealRef<T>, [src]
&'a T: NumericRef<T> + RealRef<T>,
Operation for two traces of the same type with the right referenced.
impl<T: Numeric + Real + Primitive, '_, '_> Pow<&'_ Trace<T>> for &'_ T where
&'a T: NumericRef<T> + RealRef<T>, [src]
&'a T: NumericRef<T> + RealRef<T>,
Power of a constant to a trace of the same type with both referenced.
impl<T: Numeric + Real + Primitive, '_> Pow<&'_ Trace<T>> for T where
&'a T: NumericRef<T> + RealRef<T>, [src]
&'a T: NumericRef<T> + RealRef<T>,
Operation for a trace and a constant of the same type with the right referenced.
impl<'l, 'r, T: Numeric + Real + Primitive> Pow<&'r Trace<T>> for &'l Trace<T> where
&'a T: NumericRef<T> + RealRef<T>, [src]
&'a T: NumericRef<T> + RealRef<T>,
Power of one Trace to another, ie self^rhs for two traces of the same type with both referenced.
impl<T: Numeric + Real + Primitive> Pow<T> for Trace<T> where
&'a T: NumericRef<T> + RealRef<T>, [src]
&'a T: NumericRef<T> + RealRef<T>,
Operation for a trace and a constant of the same type.
impl<T: Numeric + Real + Primitive, '_> Pow<T> for &'_ Trace<T> where
&'a T: NumericRef<T> + RealRef<T>, [src]
&'a T: NumericRef<T> + RealRef<T>,
Operation for a trace and a constant of the same type with the left referenced.
impl<T: Numeric + Real + Primitive> Pow<Trace<T>> for Trace<T> where
&'a T: NumericRef<T> + RealRef<T>, [src]
&'a T: NumericRef<T> + RealRef<T>,
Operation for two traces of the same type.
impl<T: Numeric + Real + Primitive, '_> Pow<Trace<T>> for &'_ Trace<T> where
&'a T: NumericRef<T> + RealRef<T>, [src]
&'a T: NumericRef<T> + RealRef<T>,
Operation for two traces of the same type with the left referenced.
impl<T: Numeric + Real + Primitive> Pow<Trace<T>> for T where
&'a T: NumericRef<T> + RealRef<T>, [src]
&'a T: NumericRef<T> + RealRef<T>,
Operation for a trace and a constant of the same type.
impl<T: Numeric + Real + Primitive, '_> Pow<Trace<T>> for &'_ T where
&'a T: NumericRef<T> + RealRef<T>, [src]
&'a T: NumericRef<T> + RealRef<T>,
Operation for a trace and a constant of the same type with the left referenced.
impl<T: Numeric + Real + Primitive, '_> Sin for &'_ Trace<T> where
&'a T: NumericRef<T> + RealRef<T>, [src]
&'a T: NumericRef<T> + RealRef<T>,
Sine of a Trace by reference.
impl<T: Numeric + Real + Primitive> Sin for Trace<T> where
&'a T: NumericRef<T> + RealRef<T>, [src]
&'a T: NumericRef<T> + RealRef<T>,
Operation for a trace by value.
impl<T: Numeric + Real + Primitive, '_> Sqrt for &'_ Trace<T> where
&'a T: NumericRef<T> + RealRef<T>, [src]
&'a T: NumericRef<T> + RealRef<T>,
Square root of a Trace by reference.
impl<T: Numeric + Real + Primitive> Sqrt for Trace<T> where
&'a T: NumericRef<T> + RealRef<T>, [src]
&'a T: NumericRef<T> + RealRef<T>,
Operation for a trace by value.
impl<T: Numeric + Primitive, '_, '_> Sub<&'_ T> for &'_ Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Subtraction for a trace and a constant of the same type with both referenced.
type Output = Trace<T>
The resulting type after applying the - operator.
fn sub(self, rhs: &T) -> Self::Output[src]
impl<T: Numeric + Primitive, '_> Sub<&'_ T> for Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for a trace and a constant of the same type with the right referenced.
type Output = Trace<T>
The resulting type after applying the - operator.
fn sub(self, rhs: &T) -> Self::Output[src]
impl<T: Numeric + Primitive, '_> Sub<&'_ Trace<T>> for Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for two traces of the same type with the right referenced.
type Output = Trace<T>
The resulting type after applying the - operator.
fn sub(self, rhs: &Trace<T>) -> Self::Output[src]
impl<'l, 'r, T: Numeric + Primitive> Sub<&'r Trace<T>> for &'l Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Subtraction for two referenced traces of the same type.
type Output = Trace<T>
The resulting type after applying the - operator.
fn sub(self, rhs: &Trace<T>) -> Self::Output[src]
impl<T: Numeric + Primitive> Sub<T> for Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for a trace and a constant of the same type.
type Output = Trace<T>
The resulting type after applying the - operator.
fn sub(self, rhs: T) -> Self::Output[src]
impl<T: Numeric + Primitive, '_> Sub<T> for &'_ Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for a trace and a constant of the same type with the left referenced.
type Output = Trace<T>
The resulting type after applying the - operator.
fn sub(self, rhs: T) -> Self::Output[src]
impl<T: Numeric + Primitive> Sub<Trace<T>> for Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for two traces of the same type.
type Output = Trace<T>
The resulting type after applying the - operator.
fn sub(self, rhs: Trace<T>) -> Self::Output[src]
impl<T: Numeric + Primitive, '_> Sub<Trace<T>> for &'_ Trace<T> where
&'a T: NumericRef<T>, [src]
&'a T: NumericRef<T>,
Operation for two traces of the same type with the left referenced.
type Output = Trace<T>
The resulting type after applying the - operator.
fn sub(self, rhs: Trace<T>) -> Self::Output[src]
impl<T: Numeric + Primitive> Sum<Trace<T>> for Trace<T>[src]
Any trace of a Numeric type implements Sum, which is the same as adding a bunch of Trace types together.
impl<T: Numeric + Primitive> ZeroOne for Trace<T>[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Trace<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Trace<T> where
T: Send,
T: Send,
impl<T> Sync for Trace<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Trace<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Trace<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Numeric for T where
T: NumericByValue<T, T> + for<'a> NumericByValue<&'a T, T> + Clone + ZeroOne + FromUsize + Sum<T> + PartialOrd<T>, [src]
T: NumericByValue<T, T> + for<'a> NumericByValue<&'a T, T> + Clone + ZeroOne + FromUsize + Sum<T> + PartialOrd<T>,
impl<T, Rhs, Output> NumericByValue<Rhs, Output> for T where
T: Add<Rhs, Output = Output> + Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Neg<Output = Output>, [src]
T: Add<Rhs, Output = Output> + Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Neg<Output = Output>,
impl<RefT, T> NumericRef<T> for RefT where
RefT: NumericByValue<T, T> + for<'a> NumericByValue<&'a T, T>, [src]
RefT: NumericByValue<T, T> + for<'a> NumericByValue<&'a T, T>,
impl<'a, '_, T> Pow<&'_ Record<'a, T>> for T where
T: Numeric + Real + Primitive,
&'t T: for<'t> NumericRef<T>,
&'t T: for<'t> RealRef<T>, [src]
T: Numeric + Real + Primitive,
&'t T: for<'t> NumericRef<T>,
&'t T: for<'t> RealRef<T>,
type Output = Record<'a, T>
fn pow(Self, &Record<'a, T>) -> <T as Pow<&'_ Record<'a, T>>>::Output[src]
impl<'_, T> Pow<&'_ Trace<T>> for T where
T: Numeric + Real + Primitive,
&'a T: for<'a> NumericRef<T>,
&'a T: for<'a> RealRef<T>, [src]
T: Numeric + Real + Primitive,
&'a T: for<'a> NumericRef<T>,
&'a T: for<'a> RealRef<T>,
impl<'_, T> Pow<&'_ Trace<T>> for T where
T: Numeric + Real + Primitive,
&'a T: for<'a> NumericRef<T>,
&'a T: for<'a> RealRef<T>, [src]
T: Numeric + Real + Primitive,
&'a T: for<'a> NumericRef<T>,
&'a T: for<'a> RealRef<T>,
impl<'_, T> Pow<&'_ Trace<T>> for T where
T: Numeric + Real + Primitive,
&'a T: for<'a> NumericRef<T>,
&'a T: for<'a> RealRef<T>, [src]
T: Numeric + Real + Primitive,
&'a T: for<'a> NumericRef<T>,
&'a T: for<'a> RealRef<T>,
impl<'_, T> Pow<&'_ Trace<T>> for T where
T: Numeric + Real + Primitive,
&'a T: for<'a> NumericRef<T>,
&'a T: for<'a> RealRef<T>, [src]
T: Numeric + Real + Primitive,
&'a T: for<'a> NumericRef<T>,
&'a T: for<'a> RealRef<T>,
impl<'a, T> Pow<Record<'a, T>> for T where
T: Numeric + Real + Primitive,
&'t T: for<'t> NumericRef<T>,
&'t T: for<'t> RealRef<T>, [src]
T: Numeric + Real + Primitive,
&'t T: for<'t> NumericRef<T>,
&'t T: for<'t> RealRef<T>,
impl<T> Pow<Trace<T>> for T where
T: Numeric + Real + Primitive,
&'a T: for<'a> NumericRef<T>,
&'a T: for<'a> RealRef<T>, [src]
T: Numeric + Real + Primitive,
&'a T: for<'a> NumericRef<T>,
&'a T: for<'a> RealRef<T>,
impl<T> Pow<Trace<T>> for T where
T: Numeric + Real + Primitive,
&'a T: for<'a> NumericRef<T>,
&'a T: for<'a> RealRef<T>, [src]
T: Numeric + Real + Primitive,
&'a T: for<'a> NumericRef<T>,
&'a T: for<'a> RealRef<T>,
impl<T> Pow<Trace<T>> for T where
T: Numeric + Real + Primitive,
&'a T: for<'a> NumericRef<T>,
&'a T: for<'a> RealRef<T>, [src]
T: Numeric + Real + Primitive,
&'a T: for<'a> NumericRef<T>,
&'a T: for<'a> RealRef<T>,
impl<T> Pow<Trace<T>> for T where
T: Numeric + Real + Primitive,
&'a T: for<'a> NumericRef<T>,
&'a T: for<'a> RealRef<T>, [src]
T: Numeric + Real + Primitive,
&'a T: for<'a> NumericRef<T>,
&'a T: for<'a> RealRef<T>,
impl<T> Real for T where
T: RealByValue<T, T> + for<'a> RealByValue<&'a T, T> + Pi, [src]
T: RealByValue<T, T> + for<'a> RealByValue<&'a T, T> + Pi,
impl<T, Rhs, Output> RealByValue<Rhs, Output> for T where
T: Pow<Rhs, Output = Output> + Ln<Output = Output> + Sqrt<Output = Output> + Sin<Output = Output> + Cos<Output = Output> + Exp<Output = Output>, [src]
T: Pow<Rhs, Output = Output> + Ln<Output = Output> + Sqrt<Output = Output> + Sin<Output = Output> + Cos<Output = Output> + Exp<Output = Output>,
impl<RefT, T> RealRef<T> for RefT where
RefT: RealByValue<T, T> + for<'a> RealByValue<&'a T, T>, [src]
RefT: RealByValue<T, T> + for<'a> RealByValue<&'a T, T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,