// file: $(LAB 07)/Matrix.h // // this inclulde file defines the matrix data structure // and the support files. // // modified: // 20181116 (JP): initial version // // make sure this is only included once // #ifndef _MATRIX #define _MATRIX #endif // system include files // #include // stdin, stdout, fopen, etc. #include // memset, memmove, etc. #include // atoi // define a structure to hold the matrix: // Note that ncols must be a vector because each row can have // a different number of columns. // struct MATRIX { long nrows; // number of rows long* ncols; // number of cols in each row float** data; // matrix values }; // define the support functions // bool load(MATRIX& mat, FILE* fp); bool display(FILE* fp, MATRIX& mat, char* delim); // define important numeric constants // #define MAX_LINE_LEN (long)9999 #define MAX_VALUE_LEN (long)99 // define the characters that we will allow to separate values on the line. // in this case we allow commad, space and tab. // #define DELIMITERS (char*)", \t" // exit gracefully //