/* * Project P12 parsecommand starter * * Complete the routines in this file! * */ #include #include #include "sparcematrix.h" struct sparceMatrix *createSparceMatrix(int numRows, int numCols) { /* declarations go here */ if (numRows <= 0 || numCols <= 0) { return NULL ; } /* statements go here */ } static int indexOK(struct sparceMatrix *M, int r, int c) { return r < M->numRows && c < M->numCols && r >= 0 && c >= 0 ; } int incrementValueSparceMatrix(struct sparceMatrix *theMatrix, int row, int col) { /* declarations here */ if (!indexOK(theMatrix, row, col)) { return -1 ; } /* statements go here */ return 0 ; } int printValueSparceMatrix(FILE * inFH, struct sparceMatrix *theMatrix, int row, int col) { /* declarations here */ if (!indexOK(theMatrix, row, col)) { return -1 ; } /* statements go here */ return 0 ; } int printRowSparceMatrix(FILE * inFH, struct sparceMatrix *theMatrix, int row) { /* declarations here */ if (!indexOK(theMatrix, row, 0)) { return -1 ; } /* statements go here */ return 0 ; } int printColumnSparceMatrix(FILE * inFH, struct sparceMatrix *theMatrix, int col) { /* declarations here */ if (!indexOK(theMatrix, 0, col)) { return -1 ; } /* statements go here */ return 0 ; }