The reason for building this project was to implement the common linear algebra algorithms that were introduced during the introductory linear algebra course during my freshman year
$$2x+5y+z=20$$
$$4x+5y+z=10$$
API:
- Create a new matrix:
mat* mat_new(unsigned int num_rows,unsigned int num_cols)
- Assigning values:
mat->data[row][col] = desired_value
- Free a created matrix:
void mat_free(mat* matrix)
- Create a matrix with random numbers
mat *mat_rnd(unsigned int num_rows, unsigned int num_cols, int min, int max)
- Generate a square matrix
mat *mat_sqr(unsigned int rowCol)
- Assigning values:
mat->data[row][col] = desired_value
- Generate a square random matrix
mat *mat_sqr_rnd(unsigned int rowCol, int min, int max
- Matrix addition
mat* mat_add(mat* a,mat* b)
- Matrix subtraction
mat* mat_subtract(mat* a,mat* b)
- Matrix multiplication
mat* mat_mul_naive(mat* a,mat* b)
- Finding Row Echelon Form of a Matrix
mat* mat_ref(mat* a)
- Finding Reduced Row Echelon Form of a Matrix
mat* mat_rref(mat* a)
- LU decomposition
mat_lup* mat_LU(mat* a)
- Solving linear equations
mat* solve_linear_LU(mat* a,mat* b)
- Finding the inverse
- Using LU method
mat* mat_inverse(mat* a)
- Using LU method
- Finding the determinant
double mat_determinant(mat* a)
- I was completely new to C when I started with this project.
- I had done a freshmen introduction to linear algebra so I was kind of familiar with the mathematical concepts.
- References:
- 3b1b Linear Algebra playlist
- Linear Algebra playlist from Khan Academy
- Linear Algebra playlist from MathTheBeautiful
- The C programming language(Dennis Ritchie and Brian Kernighan)
Definitely not. This project was build for educational purposes only and this is definitely not a library that one should use for their projects.
- This project is far from complete.
- Some new features to be implemented:
- A CLI interface for users
- Replacing current makefile with CMake
- Computing eigenvalues and eignevectors
- Adding faster algorithms and better data structures
- Addition of strassen's algorithm for matrix multiplicaton
- Dense and sparse matrices
- More...