Scalar

Trait Scalar 

Source
pub trait Scalar: ScalarBase { }
Expand description

Scalar element type for tensors.

Minimum requirements for a type to be stored in a Tensor<T>. All standard numeric types (f32, f64, Complex32, Complex64) satisfy this trait automatically via the blanket implementation.

Scalar is a supertrait of ScalarBase, ensuring that any Scalar type can be used with strided-rs operations.

§Examples

use tenferro_algebra::Scalar;

fn needs_scalar<T: Scalar>() {}
needs_scalar::<f64>();
needs_scalar::<f32>();

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: ScalarBase> Scalar for T