ElementOp

Trait ElementOp 

Source
pub trait ElementOp<T>:
    Copy
    + Default
    + 'static {
    const IS_IDENTITY: bool = false;

    // Required method
    fn apply(value: T) -> T;
}
Expand description

Trait for element-wise operations applied to strided views.

Generic over the element type T. Identity implements this for any T: Copy, while Conj, Transpose, and Adjoint require T: ElementOpApply.

Operations form a group under composition:

  compose | Id   | Conj | Trans | Adj
---------|------|------|-------|------
  Id     | Id   | Conj | Trans | Adj
  Conj   | Conj | Id   | Adj   | Trans
  Trans  | Trans| Adj  | Id    | Conj
  Adj    | Adj  | Trans| Conj  | Id

Provided Associated Constants§

Source

const IS_IDENTITY: bool = false

Whether this operation is the identity (no-op).

Required Methods§

Source

fn apply(value: T) -> T

Apply the operation to a value.

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> ElementOp<T> for Adjoint
where T: ElementOpApply,

Source§

impl<T> ElementOp<T> for Conj
where T: ElementOpApply,

Source§

impl<T> ElementOp<T> for Identity
where T: Copy,

Source§

impl<T> ElementOp<T> for Transpose
where T: ElementOpApply,