graphprogram/matrix.h

35 lines
1.2 KiB
C
Raw Normal View History

2024-09-26 14:32:20 +02:00
#ifndef MATRIX_H
#define MATRIX_H
2024-10-22 23:26:09 +02:00
typedef unsigned long ulong;
2024-10-22 23:38:00 +02:00
typedef struct matrix {ulong row_length; ulong column_length; ulong **values;} Matrix;
2024-09-26 14:32:20 +02:00
2024-10-22 23:26:09 +02:00
void print_matrix(const ulong row_length, const ulong column_length,
const ulong matrix[row_length][column_length]);
2024-10-03 12:48:22 +02:00
2024-10-22 23:38:00 +02:00
void print_matrix_struct(const Matrix *matrix);
2024-10-04 01:03:39 +02:00
/*
First two matrices will be multiplied and
restult will be written to output_matrix.
2024-10-11 00:09:26 +02:00
Matrix size requirements are as specified in the parameters.
2024-10-04 01:03:39 +02:00
*/
2024-10-22 23:26:09 +02:00
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]);
2024-09-26 14:32:20 +02:00
2024-10-22 23:38:00 +02:00
void gemm_basic_structs(const Matrix *matrix1, const Matrix *matrix2,
Matrix *output_matrix);
2024-10-22 23:26:09 +02:00
int read_csv(const char *file_name, const ulong row_length,
const ulong column_length,
ulong output_matrix[row_length][column_length]);
2024-10-04 01:03:39 +02:00
2024-11-19 11:46:06 +01:00
Matrix* create_matrix(ulong row_length, ulong column_length);
void free_matrix(Matrix *matrix);
2024-09-26 14:32:20 +02:00
#endif