| 9 |
|
#include <math.h> |
| 10 |
|
#include "platform.h" |
| 11 |
|
#include "rtio.h" |
| 12 |
– |
#include "resolu.h" |
| 12 |
|
#include "rmatrix.h" |
| 13 |
|
#include "calcomp.h" |
| 14 |
|
#include "paths.h" |
| 390 |
|
return(0); |
| 391 |
|
rmx_free(res); |
| 392 |
|
} else if (dst != src) |
| 393 |
< |
memcpy(dst->mtx, src->mtx, |
| 395 |
< |
sizeof(double)*dst->ncomp*dst->ncols*dst->nrows); |
| 393 |
> |
memcpy(dst->mtx, src->mtx, rmx_array_size(dst)); |
| 394 |
|
if (ro->nsf == dst->ncomp) |
| 395 |
|
rmx_scale(dst, ro->sca); |
| 396 |
|
return(1); |
| 678 |
|
{ |
| 679 |
|
int i; |
| 680 |
|
|
| 681 |
< |
for (i = nmats; i > n2alloc; i--) { |
| 681 |
> |
if (n2alloc == nall) |
| 682 |
> |
return; |
| 683 |
> |
for (i = nall; i > n2alloc; i--) { |
| 684 |
|
rmx_reset(&mop[i].imx); |
| 685 |
|
if (mop[i].rmp != &mop[i].imx) |
| 686 |
|
rmx_free(mop[i].rmp); |
| 690 |
|
fputs("Out of memory in resize_inparr()\n", stderr); |
| 691 |
|
exit(1); |
| 692 |
|
} |
| 693 |
< |
if (n2alloc > nmats) |
| 694 |
< |
memset(mop+nmats, 0, (n2alloc-nmats)*sizeof(ROPMAT)); |
| 693 |
> |
if (n2alloc > nall) |
| 694 |
> |
memset(mop+nall, 0, (n2alloc-nall)*sizeof(ROPMAT)); |
| 695 |
|
nall = n2alloc; |
| 696 |
|
} |
| 697 |
|
|
| 868 |
|
fprintf(stderr, "%s: unsupported output format\n", argv[0]); |
| 869 |
|
return(1); |
| 870 |
|
} |
| 871 |
+ |
doptimize(1); /* optimize definitions */ |
| 872 |
|
/* process & write rows */ |
| 873 |
|
return(combine_input(&mop[nmats], stdout) ? 0 : 1); |
| 874 |
|
stdin_error: |