1 |
|
.\" RCSid "$Id$" |
2 |
|
.TH RMTXOP 1 7/8/97 RADIANCE |
3 |
|
.SH NAME |
4 |
< |
rmtxop - concatenate, add, transpose, scale, and convert matrices |
4 |
> |
rmtxop - concatenate, add, multiply, divide, transpose, scale, and convert matrices |
5 |
|
.SH SYNOPSIS |
6 |
|
.B rmtxop |
7 |
|
[ |
17 |
|
] |
18 |
|
.B m1 |
19 |
|
[ |
20 |
< |
.B + |
20 |
> |
.B ".+*/" |
21 |
|
] |
22 |
|
.B ".." |
23 |
|
.SH DESCRIPTION |
24 |
|
.I Rmtxop |
25 |
< |
loads and concatenates (multiplies) or adds together component matrix files |
26 |
< |
given on the command line. |
25 |
> |
loads and concatenates or adds/multiplies/divides |
26 |
> |
together component matrix files given on the command line. |
27 |
|
Each file must have a header containing the following variables: |
28 |
|
.sp |
29 |
|
.nf |
96 |
|
to the same input matrix. |
97 |
|
.PP |
98 |
|
If present, the second and subsequent matrices on the command |
99 |
< |
line are concatenated to the result unless separated by a plus ('+') symbol, |
100 |
< |
in which case the elements are added together. |
99 |
> |
line are concatenated to the result unless separated by a plus ('+'), |
100 |
> |
asterisk ('*'), or forward slash ('/') symbol, |
101 |
> |
in which case the matrix elements are added, multiplied, or divided together, |
102 |
> |
respectively. |
103 |
> |
(Note that the asterisk must be quoted or escaped in most shells.)\0 |
104 |
> |
In the case of addition, the two matrices involved must have the same number |
105 |
> |
of components. |
106 |
> |
For element-wise multiplication and division, the second matrix is |
107 |
> |
permitted instead to have a single component per element, which will be |
108 |
> |
applied equally to all components of the first matrix. |
109 |
> |
If element-wise division is specified, any zero elements in the second |
110 |
> |
matrix will result in a warning and the corresponding component(s) in the |
111 |
> |
first matrix will be set to zero. |
112 |
> |
.PP |
113 |
|
The number of components in the new matrix after applying any |
114 |
|
.I -c |
115 |
|
transform must agree with the prior result. |
117 |
|
in the prior result must equal the number of rows in the new matrix, and |
118 |
|
the result will have the number of rows of the previous and the number |
119 |
|
of columns of the new matrix. |
120 |
< |
In the case of addition, the number of rows and columns of the prior |
121 |
< |
result and the new matrix must match, and will not be changed by the |
122 |
< |
operation. |
120 |
> |
In the case of addition, multiplication, and division, |
121 |
> |
the number of rows and columns of the prior result and the |
122 |
> |
new matrix must match, and will not be changed by the operation. |
123 |
|
.PP |
124 |
|
Results are sent to the standard output. |
125 |
|
By default, the values will be written in the lowest resolution format |
155 |
|
for further processing: |
156 |
|
.IP "" .2i |
157 |
|
rmtxop -fa orig.mtx | rcollate -ho -oc 1 | rcalc [operations] |
158 |
+ |
.SH NOTES |
159 |
+ |
Matrix multiplication is associative but not commutative, so order |
160 |
+ |
matters to the result. |
161 |
+ |
.I Rmtxop |
162 |
+ |
takes advantage of the associative property to evaluate the |
163 |
+ |
implicit equation from right to left when this reduces the |
164 |
+ |
number of basic operations. |
165 |
+ |
If the rightmost matrix is a column vector for example, it is |
166 |
+ |
much faster to concatenate from the right, and the result should |
167 |
+ |
be the same. |
168 |
+ |
This only applies to matrix multiplication. |
169 |
+ |
Element-wise addition, multiplication, and division are still |
170 |
+ |
evaluated from left to right. |
171 |
|
.SH AUTHOR |
172 |
|
Greg Ward |
173 |
|
.SH "SEE ALSO" |
174 |
|
cnt(1), getinfo(1), histo(1), neaten(1), rcalc(1), rcollate(1), |
175 |
< |
rcontrib(1), rfluxmtx(1), rlam(1), tabfunc(1), total(1), wrapBSDF(1) |
175 |
> |
rcontrib(1), rfluxmtx(1), rlam(1), |
176 |
> |
rsplit(1), tabfunc(1), total(1), wrapBSDF(1) |