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.
32 lines
955 B
32 lines
955 B
#ifndef __CORTEX_MATRIX_HEADER__
|
|
#define __CORTEX_MATRIX_HEADER__
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <assert.h>
|
|
#include <stdint.h>
|
|
#include <math.h>
|
|
#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
|