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.99 by greg, Tue Apr 22 04:45:25 2025 UTC vs.
Revision 2.100 by greg, Thu Jun 19 22:03:37 2025 UTC

# Line 761 | Line 761 | rmx_transpose(RMATRIX *rm)
761                  return(1);
762          }
763          if (rm->nrows == rm->ncols) {   /* square matrix case */
764 <             for (i = rm->nrows; i--; )
765 <                for (j = rm->ncols; j--; ) {
766 <                    if (i == j) continue;
764 >             for (i = rm->nrows; --i > 0; )
765 >                for (j = i; j-- > 0; ) {
766                      memcpy(val, rmx_val(rm,i,j),
767                                  sizeof(rmx_dtype)*rm->ncomp);
768                      memcpy(rmx_lval(rm,i,j), rmx_val(rm,j,i),
769                                  sizeof(rmx_dtype)*rm->ncomp);
770 <                    memcpy(rmx_val(rm,j,i), val,
770 >                    memcpy(rmx_lval(rm,j,i), val,
771                                  sizeof(rmx_dtype)*rm->ncomp);
772                  }
773 <                return(1);
773 >            return(1);
774          }
775   #define bmbyte(r,c)     bmap[((r)*rm->ncols+(c))>>3]
776   #define bmbit(r,c)      (1 << ((r)*rm->ncols+(c) & 7))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines