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§
Sourcefn lu_decomp(matrix: &Matrix<T>) -> Result<Matrix<T>>
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.
Sourcefn linear_solve_matrix(
a_mat: &Matrix<T>,
b_vec: &Matrix<T>,
) -> Result<Matrix<T>>
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.
Sourcefn max(matrix: &Matrix<T>) -> T
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.
Sourcefn axis_max(matrix: &Matrix<T>, axis: Axis) -> Matrix<T>
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.
Sourcefn min(matrix: &Matrix<T>) -> T
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.
Sourcefn axis_min(matrix: &Matrix<T>, axis: Axis) -> Matrix<T>
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.
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.