Skip to main content

FitScalar

Trait FitScalar 

Source
pub trait FitScalar: GemmScalar {
    const REAL_WIDTH: usize;

    // Required methods
    fn as_f64(s: &[Self]) -> &[f64];
    fn as_f64_mut(s: &mut [Self]) -> &mut [f64];
}
Expand description

f64 or Complex<f64>, viewable as interleaved f64 storage.

A column-major complex tensor of shape [pre, n, post] is a real tensor of shape [2 * pre, n, post], so real-matrix contractions apply to it with pre doubled.

Required Associated Constants§

Source

const REAL_WIDTH: usize

Number of f64 values per element (1 or 2).

Required Methods§

Source

fn as_f64(s: &[Self]) -> &[f64]

Reinterpret as f64 storage.

Source

fn as_f64_mut(s: &mut [Self]) -> &mut [f64]

Reinterpret mutably as f64 storage.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl FitScalar for Complex<f64>

Source§

const REAL_WIDTH: usize = 2

Source§

fn as_f64(s: &[Complex<f64>]) -> &[f64]

Source§

fn as_f64_mut(s: &mut [Complex<f64>]) -> &mut [f64]

Source§

impl FitScalar for f64

Source§

const REAL_WIDTH: usize = 1

Source§

fn as_f64(s: &[f64]) -> &[f64]

Source§

fn as_f64_mut(s: &mut [f64]) -> &mut [f64]

Implementors§