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

// TODO Matrix-Funktionen implementieren

Matrix createMatrix(unsigned int rows, unsigned int cols)
{
    
}

void clearMatrix(Matrix *matrix)
{
    //test
}

void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned int colIdx)
{
    if (matrix.buffer != NULL)
    {
        if (rowIdx < matrix.rows && colIdx < matrix.cols)
        {
            matrix.buffer[rowIdx * matrix.cols + colIdx] = value;
        }
    }
}

MatrixType getMatrixAt(const Matrix matrix, unsigned int rowIdx, unsigned int colIdx)
{
    if (matrix.buffer != NULL)
    {
        if (rowIdx < matrix.rows && colIdx < matrix.cols)
        {
            return matrix.buffer[rowIdx * matrix.cols + colIdx];
        }

    }
    else 
    {
        return 0;
    }
}

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

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