343 |
|
if (!split_input(rop)) /* get our own struct */ |
344 |
|
return(0); |
345 |
|
rop->rmp->ncomp = rop->preop.clen / rop->imx.ncomp; |
346 |
< |
if ((rop->rmp->ncomp > 3) & (rop->rmp->dtype <= DTspec)) |
346 |
> |
if ((rop->rmp->ncomp > 3) & (rop->rmp->dtype <= DTspec)) { |
347 |
|
rop->rmp->dtype = DTfloat; /* probably not actual spectrum */ |
348 |
+ |
memcpy(rop->rmp->wlpart, WLPART, sizeof(rop->rmp->wlpart)); |
349 |
+ |
} |
350 |
|
} else if (rop->preop.nsf > 0) { /* else use scalar(s)? */ |
351 |
|
if (rop->preop.nsf == 1) { |
352 |
|
for (i = rop->rmp->ncomp; --i; ) |
364 |
|
static int |
365 |
|
apply_op(RMATRIX *dst, const RMATRIX *src, const RUNARYOP *ro) |
366 |
|
{ |
365 |
– |
/* |
366 |
– |
if (!dst | !src | !ro || (dst->nrows != src->nrows) | |
367 |
– |
(dst->ncols != src->ncols)) |
368 |
– |
return(0); |
369 |
– |
*/ |
367 |
|
if (ro->clen > 0) { |
368 |
|
RMATRIX *res = rmx_transform(src, dst->ncomp, ro->cmat); |
369 |
|
if (!res) { |
370 |
|
fputs("Error in call to rmx_transform()\n", stderr); |
371 |
|
return(0); |
372 |
|
} |
373 |
< |
if (dst->mtx) free(dst->mtx); |
374 |
< |
dst->mtx = res->mtx; res->mtx = NULL; |
373 |
> |
if (!rmx_transfer_data(dst, res, 0)) |
374 |
> |
return(0); |
375 |
|
rmx_free(res); |
376 |
|
} else if (dst != src) |
377 |
|
memcpy(dst->mtx, src->mtx, |
606 |
|
mres = rmx_multiply(tmp, mcat); |
607 |
|
if (!mres) |
608 |
|
goto multerror; |
609 |
< |
if (res->rmp->mtx) free(res->rmp->mtx); |
610 |
< |
res->rmp->mtx = mres->mtx; mres->mtx = NULL; |
609 |
> |
if (!rmx_transfer_data(res->rmp, mres, 0)) |
610 |
> |
return(0); |
611 |
|
} else /* mcat && !mcat_last */ { |
612 |
|
mres = rmx_multiply(&res->imx, mcat); |
613 |
|
if (!mres) |