2013-11-13 22:50:38 +04:00
|
|
|
#ifndef MATRIX_H
|
|
|
|
#define MATRIX_H
|
|
|
|
typedef struct matrix{
|
|
|
|
int rows, cols;
|
2014-01-29 04:28:42 +04:00
|
|
|
float **vals;
|
2013-11-13 22:50:38 +04:00
|
|
|
} matrix;
|
|
|
|
|
|
|
|
matrix make_matrix(int rows, int cols);
|
|
|
|
void free_matrix(matrix m);
|
|
|
|
void print_matrix(matrix m);
|
|
|
|
|
|
|
|
matrix csv_to_matrix(char *filename);
|
2016-03-14 09:18:42 +03:00
|
|
|
void matrix_to_csv(matrix m);
|
2013-11-13 22:50:38 +04:00
|
|
|
matrix hold_out_matrix(matrix *m, int n);
|
2014-12-12 00:15:26 +03:00
|
|
|
float matrix_topk_accuracy(matrix truth, matrix guess, int k);
|
2013-12-07 21:38:50 +04:00
|
|
|
void matrix_add_matrix(matrix from, matrix to);
|
2016-03-14 09:18:42 +03:00
|
|
|
void scale_matrix(matrix m, float scale);
|
|
|
|
matrix resize_matrix(matrix m, int size);
|
2013-11-13 22:50:38 +04:00
|
|
|
|
2014-01-29 04:28:42 +04:00
|
|
|
float *pop_column(matrix *m, int c);
|
2013-11-13 22:50:38 +04:00
|
|
|
|
|
|
|
#endif
|