You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
557 B

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef MATRIX_H
  2. #define MATRIX_H
  3. typedef struct S_matrix{
  4. int rows, cols;
  5. float **vals;
  6. } matrix;
  7. matrix make_matrix(int rows, int cols);
  8. void free_matrix(matrix m);
  9. void print_matrix(matrix m);
  10. matrix csv_to_matrix(char *filename);
  11. void matrix_to_csv(matrix m);
  12. matrix hold_out_matrix(matrix *m, int n);
  13. float matrix_topk_accuracy(matrix truth, matrix guess, int k);
  14. void matrix_add_matrix(matrix from, matrix to);
  15. void scale_matrix(matrix m, float scale);
  16. matrix resize_matrix(matrix m, int size);
  17. float *pop_column(matrix *m, int c);
  18. #endif