9
** MAT_IN(): Function to read in a matrix. Simple version for now.
12
** \param fp = file pointer to input stream
13
** \param array = matrix to hold data
14
** \param width = number of columns to read
15
** \param max_length = maximum number of rows to read
16
** \param stat = pointer to int to hold status flag
17
** (0=read ok, 1=error)
20
** number of rows read
21
** Also modifies stat to = error code (0 = ok, 1 = error)
25
int mat_in(FILE *fp, double **array, int width, int max_length, int *stat)
27
int i=0, j, errcod=0 ;
31
while ( (i < max_length) && (!errcod) ) {
32
for (j=0; j<width; j++) {
33
nr = fscanf(fp, "%lf", &data) ;