This repository has been archived by the owner on Jan 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatrix.h
49 lines (35 loc) · 1.47 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
48
#ifndef __MATRIX_H__
#define __MATRIX_H__
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <limits.h>
struct matrix {
size_t order;
int *data;
};
struct matrix * matrix_new (size_t order);
void matrix_free (struct matrix * matrix);
struct matrix * matrix_from_vector (int * vector,
size_t order
);
struct matrix * matrix_random (size_t order,
int lower,
int upper,
double connectivity);
int matrix_get (struct matrix * matrix,
size_t i,
size_t j
);
int * matrix_getp (struct matrix *matrix,
size_t i,
size_t j);
void matrix_set (struct matrix * matrix,
size_t i,
size_t j,
int e
);
void matrix_print (struct matrix * matrix);
#endif /* __MATRIX_H__ */