MatMulBuilder

Trait MatMulBuilder 

Source
pub trait MatMulBuilder<'a, T, La, Lb>
where La: Layout + 'a, Lb: Layout + 'a, T: 'a,
{ // Required methods fn parallelize(self) -> Self; fn scale(self, factor: T) -> Self; fn eval(self) -> DTensor<T, 2>; fn overwrite<Lc: Layout>(self, c: &mut DSlice<T, 2, Lc>); fn add_to<Lc: Layout>(self, c: &mut DSlice<T, 2, Lc>); fn add_to_scaled<Lc: Layout>(self, c: &mut DSlice<T, 2, Lc>, beta: T); fn special( self, lr: Side, type_of_matrix: Type, tr: Triangle, ) -> DTensor<T, 2>; }
Expand description

Builder interface for configuring matrix-matrix operations

Required Methods§

Source

fn parallelize(self) -> Self

Enable parallelization.

Source

fn scale(self, factor: T) -> Self

Multiplies the result by a scalar factor.

Source

fn eval(self) -> DTensor<T, 2>

Returns a new owned tensor containing the result.

Source

fn overwrite<Lc: Layout>(self, c: &mut DSlice<T, 2, Lc>)

Overwrites the provided slice with the result.

Source

fn add_to<Lc: Layout>(self, c: &mut DSlice<T, 2, Lc>)

Adds the result to the provided slice.

Source

fn add_to_scaled<Lc: Layout>(self, c: &mut DSlice<T, 2, Lc>, beta: T)

Adds the result to the provided slice after scaling the slice by beta (i.e. C := beta * C + result).

Source

fn special(self, lr: Side, type_of_matrix: Type, tr: Triangle) -> DTensor<T, 2>

Computes a matrix product where the first operand is a special matrix (symmetric, Hermitian, or triangular) and the other is general.

The special matrix is always treated as A. lr determines the multiplication order:

  • Side::Left : C := alpha * A * B
  • Side::Right : C := alpha * B * A
§Parameters
  • lr - side of multiplication (left or right)
  • type_of_matrix - special matrix type: Sym, Her, or Tri
  • tr - triangle containing stored data: Upper or Lower

Only the specified triangle needs to be stored for symmetric/Hermitian matrices; for triangular matrices it specifies which half is used.

§Returns

A new tensor with the result.

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§