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

void matrix_free(Matrix A)
{
	for(int i = 0; i < A.rows; i++)
		free(A.data[i]);
	free(A.data);
}

Matrix matrix_alloc(unsigned rows, unsigned colums)
{	
	Matrix A = {rows, colums, NULL};

	A.data = (double **)(malloc(sizeof(double*)*rows));
	for(int i = 0; i < rows; i++)
		A.data[i] = calloc(colums, sizeof(double));
	return A;
}

double *array_alloc(unsigned len){
	double *array = NULL;
	array = calloc(len, sizeof(double));
	return array;
}
