/***** * jims_matrix.h * * The header file, with definitions and API. * See ./readme.txt for the details. * * Jim Mahoney | cs.marlboro.edu | Jan 2016 | MIT License *****/ #ifndef JIMS_MATRIX #define JIMS_MATRIX typedef struct _jmatrix *jmatrix; struct _jmatrix { int rows; int columns; float *values; }; /* Create and return a jmatrix. If values is non-null then it will be copied in as data. */ jmatrix new_jmatrix(int rows, int columns, float* values); /* Get one float from a jmatrix at the given row, col */ float jm_get(jmatrix m, int row, int col); /* Set one float in a jmatrix at the given row, col */ void jm_set(jmatrix m, int row, int col, float v); /* Transpose a matrix in place. */ void transpose_jmatrix(jmatrix m); /* Print a matrix */ void print_jmatrix(jmatrix m); /* Free a jmatrix's allocated memory */ void free_jmatrix(jmatrix m); #endif