Operator

Trait Operator 

Source
pub trait Operator<T: Float, const A: usize> {
    const NAME: &'static str;
    const DISPLAY: &'static str = Self::NAME;
    const INFIX: Option<&'static str> = None;
    const ALIASES: &'static [&'static str] = _;
    const COMMUTATIVE: bool = false;
    const ASSOCIATIVE: bool = false;
    const COMPLEXITY: u16 = 1u16;

    // Required methods
    fn eval(args: &[T; A]) -> T;
    fn partial(args: &[T; A], idx: usize) -> T;
}

Required Associated Constants§

Source

const NAME: &'static str

Provided Associated Constants§

Source

const DISPLAY: &'static str = Self::NAME

Source

const INFIX: Option<&'static str> = None

Source

const ALIASES: &'static [&'static str] = _

Source

const COMMUTATIVE: bool = false

Source

const ASSOCIATIVE: bool = false

Source

const COMPLEXITY: u16 = 1u16

Required Methods§

Source

fn eval(args: &[T; A]) -> T

Source

fn partial(args: &[T; A], idx: usize) -> T

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.

Implementors§

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Abs2

Source§

const NAME: &'static str = "abs2"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Abs

Source§

const NAME: &'static str = "abs"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Acos

Source§

const NAME: &'static str = "acos"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Acosh

Source§

const NAME: &'static str = "acosh"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Add

Source§

const NAME: &'static str = "add"

Source§

const INFIX: Option<&'static str>

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = true

Source§

const ASSOCIATIVE: bool = true

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Asin

Source§

const NAME: &'static str = "asin"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Asinh

Source§

const NAME: &'static str = "asinh"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Atan2

Source§

const NAME: &'static str = "atan2"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Atan

Source§

const NAME: &'static str = "atan"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Atanh

Source§

const NAME: &'static str = "atanh"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Cbrt

Source§

const NAME: &'static str = "cbrt"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Clamp

Source§

const NAME: &'static str = "clamp"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Cos

Source§

const NAME: &'static str = "cos"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Cosh

Source§

const NAME: &'static str = "cosh"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Cot

Source§

const NAME: &'static str = "cot"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Csc

Source§

const NAME: &'static str = "csc"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Div

Source§

const NAME: &'static str = "div"

Source§

const INFIX: Option<&'static str>

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Exp2

Source§

const NAME: &'static str = "exp2"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Exp

Source§

const NAME: &'static str = "exp"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Expm1

Source§

const NAME: &'static str = "expm1"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Fma

Source§

const NAME: &'static str = "fma"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Identity

Source§

const NAME: &'static str = "identity"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Inv

Source§

const NAME: &'static str = "inv"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Log1p

Source§

const NAME: &'static str = "log1p"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Log2

Source§

const NAME: &'static str = "log2"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Log10

Source§

const NAME: &'static str = "log10"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Log

Source§

const NAME: &'static str = "log"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Max

Source§

const NAME: &'static str = "max"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = true

Source§

const ASSOCIATIVE: bool = true

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Min

Source§

const NAME: &'static str = "min"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = true

Source§

const ASSOCIATIVE: bool = true

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Mul

Source§

const NAME: &'static str = "mul"

Source§

const INFIX: Option<&'static str>

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = true

Source§

const ASSOCIATIVE: bool = true

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Neg

Source§

const NAME: &'static str = "neg"

Source§

const INFIX: Option<&'static str>

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Pow

Source§

const NAME: &'static str = "pow"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Sec

Source§

const NAME: &'static str = "sec"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Sign

Source§

const NAME: &'static str = "sign"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Sin

Source§

const NAME: &'static str = "sin"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Sinh

Source§

const NAME: &'static str = "sinh"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Sqrt

Source§

const NAME: &'static str = "sqrt"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Sub

Source§

const NAME: &'static str = "sub"

Source§

const INFIX: Option<&'static str>

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Tan

Source§

const NAME: &'static str = "tan"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16

Source§

impl<T: Float> Operator<T, { $crate::op!(@count $($eval_arg),+) }> for Tanh

Source§

const NAME: &'static str = "tanh"

Source§

const INFIX: Option<&'static str> = None

Source§

const DISPLAY: &'static str

Source§

const ALIASES: &'static [&'static str]

Source§

const COMMUTATIVE: bool = false

Source§

const ASSOCIATIVE: bool = false

Source§

const COMPLEXITY: u16 = 1u16