-
Notifications
You must be signed in to change notification settings - Fork 0
/
mats.h
59 lines (43 loc) · 959 Bytes
/
mats.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
49
50
51
52
53
54
55
56
57
58
59
#ifndef MATS_H
#define MATS_H
typedef struct {
int *m;
int nrow;
int ncol;
int **r;
int **c;
} mats_m;
typedef struct {
int *v;
int n;
} mats_v;
typedef struct {
int **v;
int n;
} mats_s;
mats_m* init_m(int ncol, int nrow);
void free_m(mats_m *m);
void set_m(mats_m *m, int r, int c, int e);
int get_m(mats_m *m, int r, int c);
mats_v* init_v(int n);
void free_v(mats_v *v);
void set_v(mats_v *v, int n, int e);
int get_v(mats_v *v, int n);
mats_s col_s(mats_m *m, int c);
mats_s row_s(mats_m *m, int r);
void set_s(mats_s s, int n, int e);
int get_s(mats_s s, int n);
mats_v* s_write_v(mats_s s);
void zeroc_m(mats_m *m);
void zeroi_m(mats_m *m);
void zeroc_v(mats_v *v);
void zeroi_v(mats_v *v);
void randomc_m(mats_m *m);
void randomi_m(mats_m *m);
void printc_m(mats_m *m);
void printc_v(mats_v *v);
void printi_m(mats_m *m);
void printi_v(mats_v *v);
int rbind_m(mats_m *sink, mats_m *src);
int sum_v(mats_v *v);
#endif