Skip to main content

MatrixOperations

Trait MatrixOperations 

Source
pub trait MatrixOperations<T> {
    // Required methods
    fn matrix_vector_multiply(
        &self,
        matrix: &[Vec<T>],
        vector: &[T],
    ) -> Result<Vec<T>, SimdError>;
    fn matrix_multiply(
        &self,
        a: &[Vec<T>],
        b: &[Vec<T>],
    ) -> Result<Vec<Vec<T>>, SimdError>;
    fn transpose(&self, matrix: &[Vec<T>]) -> Result<Vec<Vec<T>>, SimdError>;
    fn elementwise_add(
        &self,
        a: &[Vec<T>],
        b: &[Vec<T>],
    ) -> Result<Vec<Vec<T>>, SimdError>;
}
Expand description

Trait for matrix operations

Required Methods§

Source

fn matrix_vector_multiply( &self, matrix: &[Vec<T>], vector: &[T], ) -> Result<Vec<T>, SimdError>

Matrix-vector multiplication

Source

fn matrix_multiply( &self, a: &[Vec<T>], b: &[Vec<T>], ) -> Result<Vec<Vec<T>>, SimdError>

Matrix-matrix multiplication

Source

fn transpose(&self, matrix: &[Vec<T>]) -> Result<Vec<Vec<T>>, SimdError>

Matrix transpose

Source

fn elementwise_add( &self, a: &[Vec<T>], b: &[Vec<T>], ) -> Result<Vec<Vec<T>>, SimdError>

Element-wise matrix operations

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§