#ifndef __CORTEX_MATRIX_HEADER__ #define __CORTEX_MATRIX_HEADER__ #include #include #include #include #include #include #include "basicUtils.h" typedef struct S_MATRIX{ uint32_t rows; uint32_t cols; float **values; } cortexMATRIX; cortexMATRIX make_matrix(uint32_t rows, uint32_t cols); cortexMATRIX copy_matrix(cortexMATRIX m); void print_matrix(cortexMATRIX m); void scale_matrix(cortexMATRIX m, float scale); void matrix_add_matrix(cortexMATRIX from, cortexMATRIX to); cortexMATRIX hold_out_matrix(cortexMATRIX *m, uint32_t n); cortexMATRIX resize_matrix(cortexMATRIX m, uint32_t size); float matrix_topk_accuracy(cortexMATRIX truth, cortexMATRIX guess, uint32_t k); float *pop_column(cortexMATRIX *m, uint32_t c); void free_matrix(cortexMATRIX m); cortexMATRIX csv_to_matrix(char *filename); void matrix_to_csv(cortexMATRIX m); #endif