**matrixcomp.c**

https://github.com/GianlucaMancusi/matrix_computation

This github project is created by Gianluca Mancusi, Daniele Manicardi, Gianmarco Lusvardi – from the “Enzo Ferrari” Department of Engineering. Some useful Matrix Calculation tools optimized for each system.

This C library is designed to **perform calculations on matrix**. Here are some of the cool features:

**Determinant**of a square matrix (Laplace’s method)- Possibility to reduce a matrix in
**rowEchelonForm** - In-situ
**matrix transposition**(uses a lightweight auxiliary table to perform it on rectangular matrices) - Fast matrix row edits (matrices are stored by rows)
- Matrix multiplication

We are pleased to receiving support!

##### //====== Useful functions =======

Calculates the **determinant** of any squared matrix of any dimension (NxN):

1 |
extern double det(const struct matrix *matr); |

Reduce a matrix in** row echelon form**. For more information see Wikipedia

1 |
extern void rowEchelonForm(struct matrix *matr); |

**Transpose** the input matrix (very fast):

1 |
extern void transposeMatrix(struct matrix *matr); |

**Multiply** two compatible matrices:

1 |
extern struct matrix *mulmatr(const struct matrix *lhs, const struct matrix *rhs); |

Creates a **new** matrix in the single pointer format:

1 |
extern struct matrix *creatematr(size_t rows, size_t cols); |

Create a **new empty** matrix in the single pointer format:

1 |
extern struct matrix *createemptymatr(size_t rows, size_t cols); |

Create a **new “cloned from other”** matrix in the single pointer format:

1 |
extern struct matrix *creatematrfrom(const double* matr, size_t row, size_t col); |

**Clone** a matrix:

1 |
extern struct matrix *clonematr(const struct matrix* matr); |

This feature allows you to find the **complementary minor** given rows and columns:

1 |
extern struct matrix* matrcompminor(const struct matrix *matr, int row, int col); |

Change an entire row:

1 |
extern int matrrow(const struct matrix* matr, size_t rowid, const double *row); |

Destroy and free memory of an allocated matrix:

1 |
extern void destroymatr(struct matrix* matr); |

Fast way to **access an element** of a matrix without thinking too much about it:

1 |
extern double *elementAt(struct matrix *matr, size_t rowIndex, size_t colIndex); |

Print to File a matrix (to print on screen use “stdout” standard file):

1 |
extern void printMatrix(struct matrix *matr, FILE *f); |