#include <stdlib.h>
#include <string.h>
#include "matrix.h"

// TODO Matrix-Funktionen implementieren

Matrix createMatrix(unsigned int rows, unsigned int cols)
{
    Matrix matrix = { rows , cols };

    matrix.matrixptr = malloc((sizeof(MatrixType)*rows*cols));

    return matrix;
}

void clearMatrix(Matrix *matrix)
{
   free(*matrix);
}

void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned int colIdx)
{
    *(matrix.matrixptr+(rowIdx*colIdx)) = value;
}

MatrixType getMatrixAt(const Matrix matrix, unsigned int rowIdx, unsigned int colIdx)
{
    MatrixType value;
    matrix[rowIdx][colIdx] = value;
    return value;
}

Matrix add(const Matrix matrix1, const Matrix matrix2)
{
    
}

Matrix multiply(const Matrix matrix1, const Matrix matrix2)
{
    
}