Skip to main content

DenseKernel

Trait DenseKernel 

pub trait DenseKernel<T>
where T: Real,
{ // Required methods fn potrf(&self, a: &mut DenseBlock<T>) -> Result<(), DenseError>; fn sytrf( &self, a: &mut DenseBlock<T>, perm: &mut Perm, pivot_2x2: &mut Vec<bool>, ) -> Result<Inertia, DenseError>; fn trsm_lower( &self, l: &DenseBlock<T>, b: &mut DenseBlock<T>, transpose: bool, ); fn gemm_sub( &self, a: &DenseBlock<T>, b: &DenseBlock<T>, c: &mut DenseBlock<T>, ); fn syrk_sub(&self, a: &DenseBlock<T>, c: &mut DenseBlock<T>); fn name(&self) -> &'static str; // Provided methods fn solve_min_rows(&self) -> usize { ... } fn solve_unit_lower(&self, l: &DenseBlock<T>, skip: &[bool], y: &mut [T]) { ... } fn solve_unit_lower_t(&self, l: &DenseBlock<T>, skip: &[bool], y: &mut [T]) { ... } }
Expand description

The kernels a supernodal factorization needs (BLAS-3 names kept for recognizability). Square blocks are read and written in their lower triangle (invariant (D3)).

Required Methods§

fn potrf(&self, a: &mut DenseBlock<T>) -> Result<(), DenseError>

In-place Cholesky A = L Lᵀ of a square block (Algorithm P).

fn sytrf( &self, a: &mut DenseBlock<T>, perm: &mut Perm, pivot_2x2: &mut Vec<bool>, ) -> Result<Inertia, DenseError>

In-place P A Pᵀ = L B Lᵀ with 1×1/2×2 pivots (Bunch–Kaufman, Algorithm B); returns the inertia and writes the permutation into perm and the 2×2 marks into pivot_2x2 (both resized to n).

fn trsm_lower(&self, l: &DenseBlock<T>, b: &mut DenseBlock<T>, transpose: bool)

B ← B L⁻ᵀ (transpose = true) or B ← L⁻¹ B (false), L square, non-unit lower triangular.

§Panics

If the dimensions do not agree.

fn gemm_sub(&self, a: &DenseBlock<T>, b: &DenseBlock<T>, c: &mut DenseBlock<T>)

C ← C − A Bᵀ.

§Panics

If the dimensions do not agree.

fn syrk_sub(&self, a: &DenseBlock<T>, c: &mut DenseBlock<T>)

C ← C − A Aᵀ, lower triangle of C.

§Panics

If the dimensions do not agree.

fn name(&self) -> &'static str

A short name for logs and tables.

Provided Methods§

fn solve_min_rows(&self) -> usize

The smallest row count n_r of a supernode block for which the solves of SupernodalLdl go through this kernel (gather, hook, scatter; step S0′ of Chapter 5.17). usize::MAX — the default — keeps the loops of the second edition everywhere. A cost switch only (invariant (D5)).

fn solve_unit_lower(&self, l: &DenseBlock<T>, skip: &[bool], y: &mut [T])

Forward half of a supernode’s solve, y ← L⁻¹ y (Algorithm V). l is the stored block (rows ≥ cols, unit lower trapezoidal, diagonal slots ignored); skip is empty or has l.cols marks (the first column of each 2×2 pivot).

§Panics

If y.len() != l.rows, l.rows < l.cols, l is inconsistent, or skip has another length.

fn solve_unit_lower_t(&self, l: &DenseBlock<T>, skip: &[bool], y: &mut [T])

Backward half, y_{..cols} ← L₁₁⁻ᵀ (y_{..cols} − L₂₁ᵀ y_{cols..}) (Algorithm W); y[cols..] is read only.

§Panics

As DenseKernel::solve_unit_lower.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

§

impl<T> DenseKernel<T> for NaiveDense
where T: Real,