| 356 |
|
} |
| 357 |
|
|
| 358 |
|
/* Write matrix to file type indicated by dtype */ |
| 359 |
< |
long |
| 359 |
> |
int |
| 360 |
|
rmx_write(const RMATRIX *rm, int dtype, FILE *fp) |
| 361 |
|
{ |
| 362 |
|
RMATRIX *mydm = NULL; |
| 371 |
|
dtype = rm->dtype; |
| 372 |
|
else if ((dtype == DTrgbe) & (rm->dtype == DTxyze)) |
| 373 |
|
dtype = DTxyze; |
| 374 |
< |
else if ((dtype = DTxyze) & (rm->dtype == DTrgbe)) |
| 374 |
> |
else if ((dtype == DTxyze) & (rm->dtype == DTrgbe)) |
| 375 |
|
dtype = DTrgbe; |
| 376 |
|
if ((dtype != DTrgbe) & (dtype != DTxyze)) { |
| 377 |
|
fprintf(fp, "NROWS=%d\n", rm->nrows); |
| 409 |
|
} |
| 410 |
|
ok &= (fflush(fp) == 0); |
| 411 |
|
rmx_free(mydm); |
| 412 |
< |
return(ftell(fp) * ok); /* return # bytes written */ |
| 412 |
> |
return(ok); |
| 413 |
|
} |
| 414 |
|
|
| 415 |
|
/* Allocate and assign square identity matrix with n components */ |