-
Notifications
You must be signed in to change notification settings - Fork 0
/
matrix.h
executable file
·47 lines (32 loc) · 1.18 KB
/
matrix.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
============================================================================
Name : matrix.h
Author : Julian Fietkau
Copyright : Julian Fietkau
============================================================================
*/
#ifndef MATRIX_H_
#define MATRIX_H_
/*
* Internal representation of used matrices.
* We have an array of values and calculate every getValue() and setValue() individually.
* Matrix is uniquely defined by values, rows and columns
*/
typedef struct matrix {
double * values;
int rows;
int columns;
} matrix;
int equals(matrix * m1, matrix * m2);
double getValue(matrix * matrix, int x, int y);
int setValue(matrix * matrix, double value, int x, int y);
void createMatrix(matrix * m1, int rows, int column);
int destroyMatrix(matrix * m1);
void printMatrix(matrix * m1);
void printMatrixRow(matrix * m1);
int multiplication(matrix * result, matrix * m1, matrix * m2);
int multiplicationPThreads(matrix * result, matrix * m1, matrix * m2);
int parse_matrix(matrix * returnMatrix, char * stringData);
int createIdentityMatrix(matrix * returnMatrix, int n);
int createRandomMatrix(matrix * returnMatrix, int n, int m);
#endif /* MATRIX_H_ */