CS205 S22 Assignment 1
assign1_mat.h
Go to the documentation of this file.
1
11#ifndef __CS205_ASSIGN_1_MAT_H__
12#define __CS205_ASSIGN_1_MAT_H__
13
14
15#include <stddef.h>
16
17
22typedef struct matrix {
23 int m_col;
24 int m_row;
25 size_t m_data_size;
26 void *m_data;
28
29
37matrix create_matrix_all_zero(int row, int col);
38
39
46void delete_matrix(matrix mat);
47
48
56
57
65void set_by_index(matrix mat, int row, int col, int val);
66
67
75int get_by_index(matrix mat, int row, int col);
76
77
87int scalar_multiplication(matrix mat_a, int x, matrix mat_res);
88
89#endif // __CS205_ASSIGN_1_MAT_H__
matrix create_matrix_all_zero(int row, int col)
Definition: assign1_mat.c:15
int scalar_multiplication(matrix mat_a, int x, matrix mat_res)
Definition: assign1_mat.c:52
void set_by_index(matrix mat, int row, int col, int val)
Definition: assign1_mat.c:39
int get_by_index(matrix mat, int row, int col)
Definition: assign1_mat.c:45
void delete_matrix(matrix mat)
Definition: assign1_mat.c:26
matrix copy_matrix(matrix mat)
Definition: assign1_mat.c:31
struct matrix matrix
Structure to store a matrix with integers.
Structure to store a matrix with integers.
Definition: assign1_mat.h:22
size_t m_data_size
number of bytes in the data zone, aka. m_col * m_row * sizeof(int)
Definition: assign1_mat.h:25
int m_col
number of columns in the matrix, aka. width
Definition: assign1_mat.h:23
int m_row
number of rows in the matrix, aka. height
Definition: assign1_mat.h:24