Question: struct _matrix { int rows; int cols; double * data; }; int nRows(matrix const * mtx, int * n) { if (!mtx || !n) return

struct _matrix { int rows; int cols; double * data; };
int nRows(matrix const * mtx, int * n) { if (!mtx || !n) return -1; *n = mtx->rows; return 0; }
int nCols(matrix const * mtx, int * n) { if (!mtx || !n) return -1; *n = mtx->cols; return 0; }
Exercise 6.8. Implement the following specification 1) /* Returns column col of mt as a new tector. Returns NULL 2if mta is NULL or col is inconsistent with mta 's 3*dimensions. matrix getColumn (matrix mtx, int col) 7/ /* Returns row row of mt 1s a row uector. Returns NULLf * mta is NULL or rou is inconsistent with mt's 9dimensions. 10* 11matrix getRow (matrix mtx int row)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
