68 |
\section{Operations} |
\section{Operations} |
69 |
|
|
70 |
\subsection{Scalar operations} |
\subsection{Scalar operations} |
71 |
\noindent{}Arithmetic: |
\noindent{}\point Arithmetic: |
72 |
\begin{displaymath} |
\begin{displaymath} |
73 |
\begin{array}{cl} |
\begin{array}{cl} |
74 |
\BinopTy{{\odot}}{\tau}{\tau}{\tau} |
\BinopTy{{\odot}}{\tau}{\tau}{\tau} |
78 |
\end{array}% |
\end{array}% |
79 |
\end{displaymath}% |
\end{displaymath}% |
80 |
|
|
81 |
\noindent{}Comparisons: |
\noindent{}\point Comparisons: |
82 |
\begin{displaymath} |
\begin{displaymath} |
83 |
\BinopTy{{\odot}}{\tau}{\tau}{\TYbool} |
\BinopTy{{\odot}}{\tau}{\tau}{\TYbool} |
84 |
\qquad\text{for $\odot\in\SET{{<},{\leq},{=},{\neq}{>},{\geq}}$ and $\tau\in\SET{\TYint,\TYreal}$} |
\qquad\text{for $\odot\in\SET{{<},{\leq},{=},{\neq}{>},{\geq}}$ and $\tau\in\SET{\TYint,\TYreal}$} |
89 |
|
|
90 |
\subsection{Tensor operations} |
\subsection{Tensor operations} |
91 |
|
|
92 |
\noindent{}Scalar multiplication: |
\noindent{}\point Addition: |
93 |
|
\begin{displaymath} |
94 |
|
\BinopTy{{\odot}}{\TYtensor{o}{d}}{\TYtensor{o}{d}}{\TYtensor{o}{d}} |
95 |
|
\qquad\text{for $\odot\in\SET{{+},{-}}$} |
96 |
|
\end{displaymath}% |
97 |
|
|
98 |
|
\noindent{}\point Negation: |
99 |
|
\begin{displaymath} |
100 |
|
\UnopTy{-}{\TYtensor{o}{d}}{\TYtensor{o}{d}} |
101 |
|
\end{displaymath}% |
102 |
|
|
103 |
|
\noindent{}\point Scalar division: |
104 |
|
\begin{displaymath} |
105 |
|
\BinopTy{{/}}{\TYtensor{o}{d}}{\TYreal}{\TYtensor{o}{d}} |
106 |
|
\end{displaymath}% |
107 |
|
|
108 |
|
\noindent{}\point Scalar multiplication (scalar times order-N): |
109 |
\begin{displaymath} |
\begin{displaymath} |
110 |
\begin{array}{c} |
\begin{array}{c} |
111 |
\BinopTy{{*}}{\TYreal}{\TYtensor{o}{d}}{\TYtensor{o}{d}} \\ |
\BinopTy{{?}}{\TYreal}{\TYtensor{o}{d}}{\TYtensor{o}{d}} \\ |
112 |
\BinopTy{{*}}{\TYtensor{o}{d}}{\TYreal}{\TYtensor{o}{d}} |
\BinopTy{{?}}{\TYtensor{o}{d}}{\TYreal}{\TYtensor{o}{d}} |
113 |
\end{array}% |
\end{array}% |
114 |
\end{displaymath}% |
\end{displaymath}% |
115 |
|
Possible direct notation syntax (TBD): ~~ {\tt *} ~~ `` '' (space) |
116 |
|
|
117 |
\noindent{}Scalar division: |
\noindent{}\point Tensor scalar multiplication (contraction of two order-N |
118 |
|
tensors down to a scalar, \eg{} dot product of vectors, double dot |
119 |
|
product of 2nd-order tensors) |
120 |
\begin{displaymath} |
\begin{displaymath} |
121 |
\BinopTy{{/}}{\TYtensor{o}{d}}{\TYreal}{\TYtensor{o}{d}} |
\begin{array}{c} |
122 |
|
\BinopTy{{?}}{\TYtensor{o}{d}}{\TYtensor{o}{d}}{\TYreal} |
123 |
|
\end{array}% |
124 |
\end{displaymath}% |
\end{displaymath}% |
125 |
|
Defined by $c = A_{\vec{i}}B_{\vec{i}}$ |
126 |
|
~(\eg{} $\mathbf{a}\cdot\mathbf{b} = a_ib_i$ or $\mathbf{A:B} = A_{ij}B_{ij}$) |
127 |
|
NOTE: In this and subsequent index notation expressions, a vector over the index variable |
128 |
|
(\eg{} $\vec{i}$) means that the variable is in fact standing for a sequence of |
129 |
|
contiguous index variables \\ |
130 |
|
Possible direct notation syntax: ~~ {\tt .} (period) ~~ {\tt :} (colon) ~~ {\tt dot} ~~ {\tt o} |
131 |
|
|
132 |
\noindent{}Addition: |
\noindent{}\point Tensor product (aka outer product; order output is sum of orders) |
133 |
\begin{displaymath} |
\begin{displaymath} |
134 |
\BinopTy{{\odot}}{\TYtensor{o}{d}}{\TYtensor{o}{d}}{\TYtensor{o}{d}} |
\begin{array}{c} |
135 |
\qquad\text{for $\odot\in\SET{{+},{-}}$} |
\BinopTy{{?}}{\TYtensor{o}{d}}{\TYtensor{p}{d}}{\TYtensor{o+p}{d}} |
136 |
|
\end{array}% |
137 |
\end{displaymath}% |
\end{displaymath}% |
138 |
|
Defined by $C_{\vec{i}\vec{j}} = A_{\vec{i}}B_{\vec{j}}$ \\ |
139 |
|
Possible direct notation syntax: ~~ {\tt x} ~~ {\tt (x)} ~~ {\tt out} |
140 |
|
|
141 |
\noindent{}Negation: |
\noindent{}\point Matrix Multiply |
142 |
\begin{displaymath} |
\begin{displaymath} |
143 |
\UnopTy{-}{\TYtensor{o}{d}}{\TYtensor{o}{d}} |
\begin{array}{c} |
144 |
|
\BinopTy{{?}}{\TYtensor{o}{d}}{\TYtensor{2}{d}}{\TYtensor{o}{d}} \\ |
145 |
|
\BinopTy{{?}}{\TYtensor{2}{d}}{\TYtensor{o}{d}}{\TYtensor{o}{d}} |
146 |
|
\end{array}% |
147 |
|
\end{displaymath}% |
148 |
|
Defined by $C_{i\vec{k}} = A_{ij}B_{j\vec{k}}$ and $C_{\vec{i}k} = B_{\vec{i}j}A_{jk}$ |
149 |
|
~(\eg{} $u_i = M_{ij}v_j$ or $T_{ijl} = S_{ijk}M_{kl}$) \\ |
150 |
|
Possible direct notation syntax: ~~ ? |
151 |
|
|
152 |
|
\noindent{}\point Contracting out last or first index of tensor (order $o \geq 1$) |
153 |
|
with vector |
154 |
|
\begin{displaymath} |
155 |
|
\begin{array}{c} |
156 |
|
\BinopTy{{?}}{\TYtensor{o}{d}}{\TYvec{d}}{\TYtensor{o-1}{d}} \\ |
157 |
|
\BinopTy{{?}}{\TYvec{d}}{\TYtensor{o}{d}}{\TYtensor{o-1}{d}} |
158 |
|
\end{array}% |
159 |
|
\end{displaymath}% |
160 |
|
Defined by $C_{\vec{i}} = A_{\vec{i}j}v_j$ and $C_{\vec{j}} = v_iA_{j\vec{j}}$ \\ |
161 |
|
Possible direct notation syntax: ~~ ? |
162 |
|
|
163 |
|
\noindent{}\point Arbitrary ``tensor comprehension''. The product can also be |
164 |
|
expressed in general index notation, and which may increase, preserve, or |
165 |
|
decrease the tensor order. |
166 |
|
\begin{displaymath} |
167 |
|
\begin{array}{c} |
168 |
|
\BinopTy{{?}}{\TYtensor{o}{d}}{\TYtensor{p}{d}}{\TYtensor{q}{d}} |
169 |
|
\end{array}% |
170 |
\end{displaymath}% |
\end{displaymath}% |
171 |
|
Defined by the conventions of Einstein summation notation. \\ |
172 |
|
Possible syntax: {\tt <A.i.j.k,B.j.k.l>} ~~ {\tt <A\_i\_j\_k,B\_j\_k\_l>} |
173 |
|
|
174 |
\subsection{Field operations} |
\subsection{Field operations} |
175 |
|
|
176 |
\noindent{}Creation from an image: |
\noindent{}\point Creation from an image: |
177 |
\begin{displaymath} |
\begin{displaymath} |
178 |
\BinopTy{\OPconvolve}{\TYkern{k}}{\TYimage{d}{\mu}}{\TYfield{k}{d}{\theta}} |
\BinopTy{\OPconvolve}{\TYkern{k}}{\TYimage{d}{\TYrawten{o}{d}{\rho}}}{\TYfield{k}{d}{\TYtensor{o}{d}}} |
|
\qquad\text{where $\theta$ is the real conversion of $\mu$.} |
|
179 |
\end{displaymath}% |
\end{displaymath}% |
180 |
|
|
181 |
\noindent{}Scalar multiplication: |
\noindent{}\point Scalar multiplication: |
182 |
\begin{displaymath} |
\begin{displaymath} |
183 |
\begin{array}{c} |
\begin{array}{c} |
184 |
\BinopTy{{*}}{\TYreal}{\TYfield{k}{d}{\theta}}{\TYfield{k}{d}{\theta}} \\ |
\BinopTy{{*}}{\TYreal}{\TYfield{k}{d}{\theta}}{\TYfield{k}{d}{\theta}} \\ |
186 |
\end{array}% |
\end{array}% |
187 |
\end{displaymath}% |
\end{displaymath}% |
188 |
|
|
189 |
\noindent{}Scalar division: |
\noindent{}\point Scalar division: |
190 |
\begin{displaymath} |
\begin{displaymath} |
191 |
\BinopTy{{/}}{\TYfield{k}{d}{\theta}}{\TYreal}{\TYfield{k}{d}{\theta}} |
\BinopTy{{/}}{\TYfield{k}{d}{\theta}}{\TYreal}{\TYfield{k}{d}{\theta}} |
192 |
\end{displaymath}% |
\end{displaymath}% |
193 |
|
|
194 |
\noindent{}Negation: |
\noindent{}\point Negation: |
195 |
\begin{displaymath} |
\begin{displaymath} |
196 |
\UnopTy{-}{\TYfield{k}{d}{\theta}}{\TYfield{k}{d}{\theta}} |
\UnopTy{-}{\TYfield{k}{d}{\theta}}{\TYfield{k}{d}{\theta}} |
197 |
\end{displaymath}% |
\end{displaymath}% |
198 |
|
|
199 |
\noindent{}Addition: |
\noindent{}\point Addition: |
200 |
\begin{displaymath} |
\begin{displaymath} |
201 |
\begin{array}{c} |
\begin{array}{c} |
202 |
\BinopTy{{\odot}}{\TYfield{k}{d}{\theta}}{\theta}{\TYfield{k}{d}{\theta}} \\ |
\BinopTy{{\odot}}{\TYfield{k}{d}{\theta}}{\theta}{\TYfield{k}{d}{\theta}} \\ |
206 |
\qquad\text{for $\odot\in\SET{{+},{-}}$} |
\qquad\text{for $\odot\in\SET{{+},{-}}$} |
207 |
\end{displaymath}% |
\end{displaymath}% |
208 |
|
|
209 |
\noindent{}Differentiation: |
\noindent{}\point Differentiation: |
210 |
\begin{displaymath} |
\begin{displaymath} |
211 |
\UnopTy{\OPdiff}{\TYfield{k}{d}{\TYtensor{o}{d}}}{\TYfield{k-1}{d}{\TYtensor{o+1}{d}}} |
\UnopTy{\OPdiff}{\TYfield{k}{d}{\TYtensor{o}{d}}}{\TYfield{k-1}{d}{\TYtensor{o+1}{d}}} |
212 |
\qquad\text{for $k > 0$} |
\qquad\text{for $k > 0$} |
213 |
\end{displaymath}% |
\end{displaymath}% |
214 |
|
|
215 |
\noindent{}Probing: |
\noindent{}\point Probing: |
216 |
\begin{displaymath} |
\begin{displaymath} |
217 |
\BinopTy{@}{\TYfield{k}{d}{\theta}}{\TYvec{d}}{\theta} |
\BinopTy{@}{\TYfield{k}{d}{\theta}}{\TYvec{d}}{\theta} |
218 |
\end{displaymath}% |
\end{displaymath}% |