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

Comparing ray/src/util/rmtxop.c (file contents):
Revision 2.15 by greg, Mon Aug 12 16:55:24 2019 UTC vs.
Revision 2.17 by greg, Sat Dec 28 18:05:14 2019 UTC

# Line 5 | Line 5 | static const char RCSid[] = "$Id$";
5   * General component matrix operations.
6   */
7  
8 #include <stdio.h>
8   #include <stdlib.h>
9   #include <errno.h>
10   #include "rtio.h"
# Line 140 | Line 139 | binaryop(const char *inspec, RMATRIX *mleft, int op, R
139  
140          if ((mleft == NULL) | (mright == NULL))
141                  return(NULL);
143
142          switch (op) {
143          case '.':                       /* concatenate */
144 <                mres = rmx_multiply(mleft, mright);
144 >                if (mleft->ncomp != mright->ncomp) {
145 >                        fputs(inspec, stderr);
146 >                        fputs(": # components do not match\n", stderr);
147 >                } else if (mleft->ncols != mright->nrows) {
148 >                        fputs(inspec, stderr);
149 >                        fputs(": mismatched dimensions\n",
150 >                                        stderr);
151 >                } else
152 >                        mres = rmx_multiply(mleft, mright);
153                  rmx_free(mleft);
154                  rmx_free(mright);
155                  if (mres == NULL) {
156                          fputs(inspec, stderr);
157 <                        if (mleft->ncols != mright->nrows)
152 <                                fputs(": mismatched dimensions for multiply\n",
153 <                                                stderr);
154 <                        else
155 <                                fputs(": concatenation failed\n", stderr);
157 >                        fputs(": concatenation failed\n", stderr);
158                          return(NULL);
159                  }
160                  if (verbose) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines