246 |
|
case DTascii: |
247 |
|
if (!rmx_load_ascii(dnew, fp)) |
248 |
|
goto loaderr; |
249 |
+ |
dnew->dtype = DTascii; /* should leave double? */ |
250 |
|
break; |
251 |
|
case DTfloat: |
252 |
|
if (!rmx_load_float(dnew, fp)) |
357 |
|
} |
358 |
|
|
359 |
|
/* Write matrix to file type indicated by dtype */ |
360 |
< |
long |
360 |
> |
int |
361 |
|
rmx_write(const RMATRIX *rm, int dtype, FILE *fp) |
362 |
|
{ |
363 |
|
RMATRIX *mydm = NULL; |
372 |
|
dtype = rm->dtype; |
373 |
|
else if ((dtype == DTrgbe) & (rm->dtype == DTxyze)) |
374 |
|
dtype = DTxyze; |
375 |
< |
else if ((dtype = DTxyze) & (rm->dtype == DTrgbe)) |
375 |
> |
else if ((dtype == DTxyze) & (rm->dtype == DTrgbe)) |
376 |
|
dtype = DTrgbe; |
377 |
|
if ((dtype != DTrgbe) & (dtype != DTxyze)) { |
378 |
|
fprintf(fp, "NROWS=%d\n", rm->nrows); |
410 |
|
} |
411 |
|
ok &= (fflush(fp) == 0); |
412 |
|
rmx_free(mydm); |
413 |
< |
return(ftell(fp) * ok); /* return # bytes written */ |
413 |
> |
return(ok); |
414 |
|
} |
415 |
|
|
416 |
|
/* Allocate and assign square identity matrix with n components */ |