Trait feanor_math::algorithms::matmul::MatmulAlgorithm

source ·
pub trait MatmulAlgorithm<R: ?Sized + RingBase> {
    // Required method
    fn add_matmul<V1, V2, V3, const T1: bool, const T2: bool, const T3: bool>(
        &self,
        lhs: TransposableSubmatrix<'_, V1, R::Element, T1>,
        rhs: TransposableSubmatrix<'_, V2, R::Element, T2>,
        dst: TransposableSubmatrixMut<'_, V3, R::Element, T3>,
        ring: &R,
    )
       where V1: AsPointerToSlice<R::Element>,
             V2: AsPointerToSlice<R::Element>,
             V3: AsPointerToSlice<R::Element>;

    // Provided method
    fn matmul<V1, V2, V3, const T1: bool, const T2: bool, const T3: bool>(
        &self,
        lhs: TransposableSubmatrix<'_, V1, R::Element, T1>,
        rhs: TransposableSubmatrix<'_, V2, R::Element, T2>,
        dst: TransposableSubmatrixMut<'_, V3, R::Element, T3>,
        ring: &R,
    )
       where V1: AsPointerToSlice<R::Element>,
             V2: AsPointerToSlice<R::Element>,
             V3: AsPointerToSlice<R::Element> { ... }
}
Expand description

Trait for objects that can compute a matrix multiplications over a fixed ring.

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Required Methods§

source

fn add_matmul<V1, V2, V3, const T1: bool, const T2: bool, const T3: bool>( &self, lhs: TransposableSubmatrix<'_, V1, R::Element, T1>, rhs: TransposableSubmatrix<'_, V2, R::Element, T2>, dst: TransposableSubmatrixMut<'_, V3, R::Element, T3>, ring: &R, )

Computes the matrix product of lhs and rhs, and adds the result to dst.

This requires that lhs is a nxk matrix, rhs is a kxm matrix and dst is a nxm matrix. In this case, the function concretely computes dst[i, j] += sum_l lhs[i, l] * rhs[l, j] where l runs from 0 to k - 1.

Provided Methods§

source

fn matmul<V1, V2, V3, const T1: bool, const T2: bool, const T3: bool>( &self, lhs: TransposableSubmatrix<'_, V1, R::Element, T1>, rhs: TransposableSubmatrix<'_, V2, R::Element, T2>, dst: TransposableSubmatrixMut<'_, V3, R::Element, T3>, ring: &R, )

Computes the matrix product of lhs and rhs, and stores the result in dst.

This requires that lhs is a nxk matrix, rhs is a kxm matrix and dst is a nxm matrix. In this case, the function concretely computes dst[i, j] = sum_l lhs[i, l] * rhs[l, j] where l runs from 0 to k - 1.

Object Safety§

This trait is not object safe.

Implementors§