Skip to main content

Field

Trait Field 

Source
pub trait Field:
    ComplexField
    + Copy
    + Send
    + Sync
    + PartialEq
    + Debug
    + 'static
    + Add<Output = Self>
    + Sub<Output = Self>
    + Mul<Output = Self>
    + Div<Output = Self>
    + AddAssign
    + SubAssign
    + MulAssign {
    const ZERO: Self;
    const ONE: Self;
    const PIVOT_TOL: f64;

    // Required methods
    fn from_c64(z: c64) -> Self;
    fn to_c64(self) -> c64;
    fn modulus(self) -> f64;
    fn into_c64(m: Mat<Self>) -> Mat<c64>;
    fn schur(f: MatRef<'_, Self>, ne: usize) -> Option<(Mat<Self>, Mat<Self>)>;
}
Expand description

A complex scalar the elimination kernels run in: c64, or c32 for reduced precision. Through Accelerate on Apple silicon, the Schur step of a front of 128 to 2048 variables runs 2.7–3.7× faster in c32.

Required Associated Constants§

Source

const ZERO: Self

The scalar 0.

Source

const ONE: Self

The scalar 1.

Source

const PIVOT_TOL: f64

The pivot test of Field::schur: a pivot below this fraction of the largest entry of the block counts as zero. About 10⁵ times the rounding error of c64; for c32, about 100 times its rounding error. A stricter c32 test would refuse more ill-conditioned blocks, which nested dissection then delays to larger fronts: more accurate, but up to 3× slower than c64 (ARCHITECTURE.md, item 12).

Required Methods§

Source

fn from_c64(z: c64) -> Self

z in this precision: rounded to c32, unchanged for c64.

Source

fn to_c64(self) -> c64

The scalar in complex f64 (exact).

Source

fn modulus(self) -> f64

|z|, in f64.

Source

fn into_c64(m: Mat<Self>) -> Mat<c64>

The matrix in complex f64 (a move for c64).

Source

fn schur(f: MatRef<'_, Self>, ne: usize) -> Option<(Mat<Self>, Mat<Self>)>

Schur complement of the leading ne × ne block f11 of the square matrix f: (S, X) with X = f11⁻¹ f12 and S = f22 − f21 X, or None if a pivot of the LU of f11 falls below Field::PIVOT_TOL times its largest entry (numerically singular).

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl Field for c32

Source§

const ZERO: Self

Source§

const ONE: Self

Source§

const PIVOT_TOL: f64 = 1e-5

Source§

impl Field for c64

Source§

const ZERO: Self

Source§

const ONE: Self

Source§

const PIVOT_TOL: f64 = 1e-11