Crate srmc

Source
Expand description

§SRMC (Small Rust Math Crate)

srmc is a collection of mathematical methods, functions, and other useful tools. The goal is to make a stand alone math focused crate that can be used for a wide variety of applications. Will be continuously updated and improved as I imporve with the Rust langauge.

Structs§

Matrix
SRMC Matrix struct with various implementations

Functions§

create_identity_matrix
Returns an SRMC Matrix with diagonal values set to one.
create_matrix
Returns an SRMC Matrix swith provided dimensions. All elements of matrix are initially set to zero.
create_numbered_matrix
Returns an SRMC Matrix with provided dimensions. Elements of the matrix start at 1.0 and are incremented by 1.
create_sequential_vec
Creates a vector in numerical order from start to end with steps + 1 elements. NOTE: Elements of vector should be evenly spaced, but often times last two are not. Working on a fix for it, but if evenly spaced values is vital you may need to remove the final value or choose a different step size.
matrix_2x2det
Returns the determinant of a 2x2 Matrix.
matrix_3x3det
Returns the determinant of a 3x3 Matrix.
matrix_addition
Adds two Matricies together and returns the result as an SRMC Matrix
matrix_multiplication
Multiplies two Matricies together and returns the result as an SRMC Matrix.
matrix_subtraction
Subtracts two Matricies and returns the result as an SRMC Matrix.
matrix_transpose
Returns the tranpose of an SRMC Matrix
percentage_error
Function to calculate the percentage error between two values
relative_error
Function to calculate the relative error between two values
simpsons
Uses Simpson’s Method to evaluate a definite integral. Function to be integrated must take on parameter of type f32, and return a value of type f32. See the example functions (sin_x and x_cubed) for examples on how to format input.
sin_x
Example input function for sin(x)
trapzoidal_rule
Uses The Trapezoidal Rule to evaluate a definite integral. Function to be integrated must take on parameter of type f32, and return a value of type f32. See the example functions (sin_x and x_cubed) for examples on how to format input.
x_cubed
Example input function for x cubed