clearmatrix
This commit is contained in:
parent
5f2056acb4
commit
c643740ccd
7
matrix.c
7
matrix.c
@ -41,7 +41,12 @@ Matrix createMatrix(unsigned int rows, unsigned int cols)
|
|||||||
|
|
||||||
void clearMatrix(Matrix *matrix)
|
void clearMatrix(Matrix *matrix)
|
||||||
{
|
{
|
||||||
|
if (matrix->buffer != NULL){
|
||||||
|
free (matrix->buffer);
|
||||||
|
matrix->buffer = NULL;
|
||||||
|
}
|
||||||
|
matrix->rows = 0;
|
||||||
|
matrix->cols = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned int colIdx)
|
void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned int colIdx)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user