ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/rmatrix.c
(Generate patch)

Comparing ray/src/util/rmatrix.c (file contents):
Revision 2.29 by greg, Thu Aug 2 18:33:50 2018 UTC vs.
Revision 2.30 by greg, Fri Oct 19 00:21:31 2018 UTC

# Line 290 | Line 290 | loaderr:                                       /* should report error? */
290   static int
291   rmx_write_ascii(const RMATRIX *rm, FILE *fp)
292   {
293 +        const char      *fmt = (rm->dtype == DTfloat) ? " %.7e" :
294 +                        (rm->dtype == DTrgbe) | (rm->dtype == DTxyze) ? " %.3e" :
295 +                                " %.15e" ;
296          int     i, j, k;
297  
298          for (i = 0; i < rm->nrows; i++) {
299              for (j = 0; j < rm->ncols; j++) {
300                  for (k = 0; k < rm->ncomp; k++)
301 <                    fprintf(fp, " %.15e", rmx_lval(rm,i,j,k));
301 >                    fprintf(fp, fmt, rmx_lval(rm,i,j,k));
302                  fputc('\t', fp);
303              }
304              fputc('\n', fp);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines