-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmatrix.h
More file actions
20 lines (18 loc) · 868 Bytes
/
Copy pathmatrix.h
File metadata and controls
20 lines (18 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef MATRIX_H
#define MATRIX_H
int matrix_alloc(int row, int col, float **mat);
int matrix_rand(float *mat, int row, int col);
void matrix_free(float **mat);
int transpose(const float *mat, int row, int col, float **out_mat);
int matrix_mult(const float *mat_a, int row_a, int col_a, const float *mat_b,
int row_b, int col_b, float **out_mat);
int matrix_add(const float *mat_a, const float *mat_b, int row, int col,
float **out_mat);
int matrix_sub(const float *mat_a, const float *mat_b, int row, int col,
float **out_mat);
int matrix_map(const float *mat, int row, int col, float (*func)(float),
float **out_mat);
int matrix_hadamard(const float *mat_a, const float *mat_b, int row, int col,
float **out_mat);
int matrix_scale(float *mat, int row, int col, float scalar);
#endif