createMatrix
This commit is contained in:
parent
d65f333f4c
commit
e11c68abb3
1
.idea/vcs.xml
generated
1
.idea/vcs.xml
generated
@ -2,5 +2,6 @@
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@ -6,11 +6,23 @@
|
||||
|
||||
Matrix createMatrix(unsigned int rows, unsigned int cols)
|
||||
{
|
||||
|
||||
Matrix matrix;
|
||||
matrix.rows = rows;
|
||||
matrix.cols = cols;
|
||||
matrix.data = (MatrixType *)malloc(rows * cols * sizeof(MatrixType));
|
||||
if (matrix.data != NULL) {
|
||||
printf("Matrix can not be created\n");
|
||||
}
|
||||
return matrix;
|
||||
}
|
||||
|
||||
void clearMatrix(Matrix *matrix)
|
||||
{
|
||||
if (matrix->data != NULL) {
|
||||
free(matrix->data);
|
||||
matrix->data = NULL;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -33,3 +45,5 @@ Matrix multiply(const Matrix matrix1, const Matrix matrix2)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user