174 |
|
|
175 |
|
/* Use the spectral sensitivity function to compute matrix coefficients */ |
176 |
|
void |
177 |
< |
sensrow(ROPMAT *rop, int r, double (*sf)(SCOLOR sc, int ncs, const float wlpt[4])) |
177 |
> |
sensrow(ROPMAT *rop, int r, double (*sf)(const SCOLOR sc, int ncs, const float wlpt[4])) |
178 |
|
{ |
179 |
|
const int nc = rop->imx.ncomp; |
180 |
|
int i; |
488 |
|
restype = mop[i].rmp->dtype; |
489 |
|
if (!imp->dtype || (restype = rmx_newtype(restype, imp->dtype)) > 0) |
490 |
|
imp->dtype = restype; |
491 |
< |
else |
491 |
> |
else if (!nowarn) |
492 |
|
fprintf(stderr, "%s: warning - data type mismatch\n", |
493 |
|
mop[i].inspec); |
494 |
|
if (!i) { |
552 |
|
|
553 |
|
#if defined(_WIN32) || defined(_WIN64) |
554 |
|
if (np > 1) { |
555 |
< |
fputs("Warning: only one process under Windows\n", stderr); |
555 |
> |
if (!nowarn) |
556 |
> |
fputs("Warning: only one process under Windows\n", stderr); |
557 |
|
np = 1; |
558 |
|
} else |
559 |
|
#endif |
673 |
|
if (!rmx_load_row(mop[i].imx.mtx, &mop[i].imx, mop[i].infp)) { |
674 |
|
if (cur_row > in_nrows) /* unknown #input rows? */ |
675 |
|
break; |
676 |
< |
fprintf(stderr, "%s: parent_loop() load error at row %d\n", |
676 |
> |
fprintf(stderr, "%s: load error at row %d\n", |
677 |
|
mop[i].inspec, cur_row); |
678 |
|
return(0); |
679 |
|
} |
682 |
|
for (i = 0; i < nmats; i++) |
683 |
|
if (writebuf(wfd, mop[i].imx.mtx, rmx_array_size(&mop[i].imx)) |
684 |
|
!= rmx_array_size(&mop[i].imx)) { |
685 |
< |
fprintf(stderr, "%s: parent_loop() write error at row %d\n", |
685 |
> |
fprintf(stderr, "%s: write error at row %d\n", |
686 |
|
mop[i].inspec, cur_row); |
687 |
|
return(0); |
688 |
|
} |
690 |
|
i = close_processes(cproc, nchildren); /* collect family */ |
691 |
|
free(cproc); cproc = NULL; nchildren = 0; |
692 |
|
if (i < 0) { |
693 |
< |
fputs("Warning: lost child in parent_loop()\n", stderr); |
693 |
> |
if (!nowarn) |
694 |
> |
fputs("Warning: lost child process\n", stderr); |
695 |
|
return(1); |
696 |
|
} |
697 |
|
if (i > 0) { |
737 |
|
if (!rmx_load_row(mop[i].imx.mtx, &mop[i].imx, mop[i].infp)) { |
738 |
|
if (cur_row > in_nrows) /* unknown #input rows? */ |
739 |
|
break; |
740 |
< |
fprintf(stderr, "%s: combine_input() load error at row %d\n", |
740 |
> |
fprintf(stderr, "%s: load error at row %d\n", |
741 |
|
mop[i].inspec, cur_row); |
742 |
|
return(0); |
743 |
|
} |
785 |
|
if (!rmx_write_data(res->rmp->mtx, res->rmp->ncomp, |
786 |
|
res->rmp->ncols, res->rmp->dtype, stdout) || |
787 |
|
(inchild >= 0 && fflush(stdout) == EOF)) { |
788 |
< |
fprintf(stderr, "Conversion/write error at row %d in combine_input()\n", |
788 |
> |
fprintf(stderr, "Conversion/write error at row %d\n", |
789 |
|
cur_row); |
790 |
|
return(0); |
791 |
|
} |
792 |
|
} |
793 |
|
return(inchild >= 0 || fflush(stdout) != EOF); |
794 |
|
multerror: |
795 |
< |
fputs("Unexpected matrix multiply error in combine_input()\n", stderr); |
795 |
> |
fputs("Unexpected matrix multiply error\n", stderr); |
796 |
|
return(0); |
797 |
|
} |
798 |
|
|
821 |
|
if (!rv) /* out of rows? */ |
822 |
|
break; |
823 |
|
if (rv != row_size) { |
824 |
< |
fputs("Read error in output_loop()\n", stderr); |
824 |
> |
fputs("Read error\n", stderr); |
825 |
|
return(0); |
826 |
|
} /* do final conversion */ |
827 |
|
if (!rmx_write_data(mop[nmats].rmp->mtx, mop[nmats].rmp->ncomp, |
828 |
|
mop[nmats].rmp->ncols, mop[nmats].rmp->dtype, stdout)) { |
829 |
< |
fputs("Conversion/write error in output_loop()\n", stderr); |
829 |
> |
fputs("Conversion/write error\n", stderr); |
830 |
|
return(0); |
831 |
|
} |
832 |
|
cur_child++; |
852 |
|
|
853 |
|
if (n2alloc == nall) |
854 |
|
return; |
855 |
< |
for (i = nall; i > n2alloc; i--) { |
855 |
> |
for (i = nall; i-- > n2alloc; ) { |
856 |
|
rmx_reset(&mop[i].imx); |
857 |
|
if (mop[i].rmp != &mop[i].imx) |
858 |
|
rmx_free(mop[i].rmp); |