MatrixUtilities

Trait MatrixUtilities 

Source
pub trait MatrixUtilities<T: IsFloat + Debug + Copy + Clone> {
    // Required methods
    fn lu_decomp(matrix: &Matrix<T>) -> Result<Matrix<T>>;
    fn linear_solve_matrix(
        a_mat: &Matrix<T>,
        b_vec: &Matrix<T>,
    ) -> Result<Matrix<T>>;
    fn max(matrix: &Matrix<T>) -> T;
    fn axis_max(matrix: &Matrix<T>, axis: Axis) -> Matrix<T>;
    fn min(matrix: &Matrix<T>) -> T;
    fn axis_min(matrix: &Matrix<T>, axis: Axis) -> Matrix<T>;
    fn sum(matrix: &Matrix<T>) -> T;
    fn axis_sum(matrix: &Matrix<T>, axis: Axis) -> Matrix<T>;
    fn concatenate(matrices: &[Matrix<T>], axis: Axis) -> Result<Matrix<T>>;
}
Expand description

Trait containing utility functions for the Matrix struct.

Required Methods§

Source

fn lu_decomp(matrix: &Matrix<T>) -> Result<Matrix<T>>

Perform partial LU decomposition of a matrix. This function returns a single matrix LU that is equivalent to L + U - I. This is designed primarily as a helper function for linear_solve_matrix. This function can return an error.

Source

fn linear_solve_matrix( a_mat: &Matrix<T>, b_vec: &Matrix<T>, ) -> Result<Matrix<T>>

Solve system of linear equations Ax=b. This will output x as a Matrix given A and b. This function can return an error.

Source

fn max(matrix: &Matrix<T>) -> T

Find absolute maximum value of matrix. This will find and output the single maximum value across all elements in the matrix.

Source

fn axis_max(matrix: &Matrix<T>, axis: Axis) -> Matrix<T>

Find maximum value of matrix along an axis. This will find the maximum value of each row or column and output them as a matrix.

Source

fn min(matrix: &Matrix<T>) -> T

Find absolute minimum value of matrix. This will find and output the single minimum value across all elements in the matrix.

Source

fn axis_min(matrix: &Matrix<T>, axis: Axis) -> Matrix<T>

Find minimum value of matrix along an axis. This will find the minimum value of each row or column and output them as a matrix.

Source

fn sum(matrix: &Matrix<T>) -> T

Find sum of all elements in a matrix.

Source

fn axis_sum(matrix: &Matrix<T>, axis: Axis) -> Matrix<T>

Sum elements of a matrix along rows or columns, returning a column or row matrix.

Source

fn concatenate(matrices: &[Matrix<T>], axis: Axis) -> Result<Matrix<T>>

Concatenate slice of matrices together along an axis. Think of this as “stacking” the matrices together either top to bottom (Axis::Row) or left to right (Axis::Col)

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§