Trait KroneckerMul

Source
pub trait KroneckerMul<Rhs>: Matrix
where Rhs: Matrix, Self::Output: Matrix,
{ type Output; // Required method fn kronecker_mul(self, rhs: Rhs) -> Self::Output; }

Required Associated Types§

Required Methods§

Source

fn kronecker_mul(self, rhs: Rhs) -> Self::Output

Returns the kronecker product of the two matrices

A ⊗ₖᵣₒₙ B

§Arguments
  • rhs - A matrix of any size
§Examples
let a = [
    [1.0, 2.0],
    [3.0, 4.0]
];
let b = [
    [1.0, 2.0],
    [3.0, 4.0]
];
let ab = [
    [1.0, 2.0, 2.0, 4.0],
    [3.0, 4.0, 6.0, 8.0],
    [3.0, 6.0, 4.0, 8.0],
    [9.0, 12.0, 12.0, 16.0]
];
assert_eq!(a.kronecker(b), ab);

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.

Implementations on Foreign Types§

Source§

impl<F, const L1: usize, const H1: usize, const L2: usize, const H2: usize> KroneckerMul<[[F; L2]; H2]> for [[F; L1]; H1]
where Self: Matrix, [[F; L2]; H2]: Matrix, F: Clone + Mul<F>, [[<F as Mul<F>>::Output; { _ }]; { _ }]: Matrix,

Source§

type Output = [[<F as Mul>::Output; { _ }]; { _ }]

Source§

fn kronecker_mul(self, rhs: [[F; L2]; H2]) -> Self::Output

Implementors§