-
Notifications
You must be signed in to change notification settings - Fork 1
/
matrix.h
25 lines (18 loc) · 878 Bytes
/
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
/* matrix.h: Our project requires the management of matrix and vector
data structures. This header contains the declarations for utilities,
implemented in matrix.c, which manage this work.
Author: Jason Franklin. */
/* Matrix: pointer to a 2-D array of int variables */
typedef int **Matrix;
/* Vector: pointer to an array of int variables */
typedef int *Vector;
/* matrix_create: returns a pointer to a Matrix with r rows and c cols */
Matrix matrix_create(int r, int c);
/* vector_create: returns a pointer to a Vector of length l */
Vector vector_create(int l);
/* matrix_destroy: de-allocate heap space occupied by m */
void matrix_destroy(Matrix m, int r);
/* vector_destroy: de-allocate heap space occupied by v */
void vector_destroy(Vector v);
/* vector_lte: return 1 if v1 <= v2, 0 if not */
int vector_lte(Vector a, Vector b, int len);