Skip to main content

MulScalarAdd

Trait MulScalarAdd 

Source
pub trait MulScalarAdd<A = Self, B = Self> {
    type Output;

    // Required method
    fn mul_add(self, a: A, b: B) -> Self::Output;
}
Expand description

Fused multiply-add: self * a + b.

This mirrors num_traits::MulAdd but allows heterogeneous operand types, which is needed for complex types where the scalar multiplier is real.

Required Associated Types§

Source

type Output

The result type of self * a + b.

Required Methods§

Source

fn mul_add(self, a: A, b: B) -> Self::Output

Compute self * a + b (fused, where hardware supports it).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: MulAdd<Output = T> + Clone> MulScalarAdd<T> for Complex<T>

Source§

type Output = Complex<T>

Source§

fn mul_add(self, a: T, b: Self) -> Self::Output

Implementors§

Source§

impl<T: MulAdd<T, T, Output = T>> MulScalarAdd for T