graphprogram/matrix.h

35 lines
1.2 KiB
C

#ifndef MATRIX_H
#define MATRIX_H
typedef unsigned long ulong;
typedef struct matrix {ulong row_length; ulong column_length; ulong **values;} Matrix;
void print_matrix(const ulong row_length, const ulong column_length,
const ulong matrix[row_length][column_length]);
void print_matrix_struct(const Matrix *matrix);
/*
First two matrices will be multiplied and
restult will be written to output_matrix.
Matrix size requirements are as specified in the parameters.
*/
void gemm_basic(const ulong row_length1, const ulong column_length1,
const ulong matrix1[row_length1][column_length1],
const ulong row_length2, const ulong column_length2,
const ulong matrix2[row_length2][column_length2],
ulong output_matrix[row_length1][column_length2]);
void gemm_basic_structs(const Matrix *matrix1, const Matrix *matrix2,
Matrix *output_matrix);
int read_csv(const char *file_name, const ulong row_length,
const ulong column_length,
ulong output_matrix[row_length][column_length]);
Matrix* create_matrix(ulong row_length, ulong column_length);
void free_matrix(Matrix *matrix);
#endif