5 |
|
* General component matrix operations. |
6 |
|
*/ |
7 |
|
|
8 |
– |
#include <stdio.h> |
8 |
|
#include <stdlib.h> |
9 |
|
#include <errno.h> |
10 |
|
#include "rtio.h" |
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) { |