pub trait ElementOpApply: Copy {
// Provided methods
fn conj(self) -> Self { ... }
fn transpose(self) -> Self { ... }
fn adjoint(self) -> Self { ... }
}Expand description
Trait for types that support element operations (conj, transpose, adjoint).
Default implementations return self unchanged, so real-valued types
(and custom types that don’t need complex operations) can simply write:
use strided_traits::ElementOpApply;
#[derive(Clone, Copy, Debug, PartialEq)]
struct MyType(f64);
impl ElementOpApply for MyType {}
// The provided methods leave the element unchanged.
assert_eq!(MyType(2.0).conj(), MyType(2.0));
assert_eq!(MyType(2.0).adjoint(), MyType(2.0));Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".