--- trunk/doc/diderot.tex 2010/01/16 18:16:32 21 +++ trunk/doc/diderot.tex 2010/04/06 15:36:27 44 @@ -40,11 +40,11 @@ \iota & ::= & \TYbool & \text{booleans} \\ & \mid & \TYint & \text{integers} \\[1em] % \mu for memory, where images of rawtensors will live (or on disk) - \mu & ::= & \TYrawten{o}{d}{\rho} & \begin{minipage}[l]{3in}\begin{flushright} - tensors of order $o$ and dimension $d$,\\with coefficients of type $\rho$ + \mu & ::= & \TYrawten{\Seq{d}}{\rho} & \begin{minipage}[l]{3in}\begin{flushright} + tensors of order $|\Seq{d}|$ and dimensions $\Seq{d}$,\\with coefficients of type $\rho$ \end{flushright}\end{minipage}\\[1em] - \theta & ::= & \TYtensor{o}{d} & \begin{minipage}[l]{3in}\begin{flushright} - tensors of order $o$ and dimension $d$,\\with real coefficients + \theta & ::= & \TYtensor{\Seq{d}} & \begin{minipage}[l]{3in}\begin{flushright} + tensors of order $|\Seq{d}|$ and dimensions $\Seq{d}$,\\with real coefficients \end{flushright}\end{minipage}\\[1em] \tau & ::= & \iota \\ & \mid & \theta \\ @@ -61,27 +61,27 @@ \end{figure}% We use some type abbreviations for common cases: \begin{eqnarray*} - \TYreal & = & \TYtensor{0}{d} \quad\text{for any $d$} \\ - \TYvec{d} & = & \TYtensor{1}{d} + \TYreal & = & \TYtensor{\epsilon} \quad\text{for any $d$} \\ + \TYvec{d} & = & \TYtensor{d} \end{eqnarray*}% \section{Operations} \subsection{Scalar operations} -\noindent{}Arithmetic: +\noindent{}\point Arithmetic: \begin{displaymath} \begin{array}{cl} \BinopTy{{\odot}}{\tau}{\tau}{\tau} - & \text{for $\odot\in\SET{{+},{-},{*},{/}}$ and $\tau\in\SET{\TYint,\TYreal}$} \\ - \UnopTy{{-}}{\tau}{\tau} + & \text{for $\odot\in\SET{\OP{+},\OP{-},\OP{*},\OP{/}}$ and $\tau\in\SET{\TYint,\TYreal}$} \\ + \UnopTy{\OP{-}}{\tau}{\tau} & \text{for $\tau\in\SET{\TYint,\TYreal}$} \end{array}% \end{displaymath}% -\noindent{}Comparisons: +\noindent{}\point Comparisons: \begin{displaymath} \BinopTy{{\odot}}{\tau}{\tau}{\TYbool} - \qquad\text{for $\odot\in\SET{{<},{\leq},{=},{\neq}{>},{\geq}}$ and $\tau\in\SET{\TYint,\TYreal}$} + \qquad\text{for $\odot\in\SET{\OP{<},{\leq},\OP{=},{\neq}\OP{>},{\geq}}$ and $\tau\in\SET{\TYint,\TYreal}$} \end{displaymath}% @@ -89,75 +89,131 @@ \subsection{Tensor operations} -\noindent{}Scalar multiplication: +\noindent{}\point Addition: +\begin{displaymath} + \BinopTy{{\odot}}{\TYtensor{\Seq{d}}}{\TYtensor{\Seq{d}}}{\TYtensor{\Seq{d}}} + \qquad\text{for $\odot\in\SET{\OP{+},\OP{-}}$} +\end{displaymath}% + +\noindent{}\point Negation: +\begin{displaymath} + \UnopTy{\OP{-}}{\TYtensor{\Seq{d}}}{\TYtensor{\Seq{d}}} +\end{displaymath}% + +\noindent{}\point Scalar division: +\begin{displaymath} + \BinopTy{\OP{/}}{\TYtensor{\Seq{d}}}{\TYreal}{\TYtensor{\Seq{d}}} +\end{displaymath}% + +\noindent{}\point Scalar multiplication (scalar times order-N): \begin{displaymath} \begin{array}{c} - \BinopTy{{*}}{\TYreal}{\TYtensor{o}{d}}{\TYtensor{o}{d}} \\ - \BinopTy{{*}}{\TYtensor{o}{d}}{\TYreal}{\TYtensor{o}{d}} + \BinopTy{\OP{*}}{\TYreal}{\TYtensor{\Seq{d}}}{\TYtensor{\Seq{d}}} \\ + \BinopTy{\OP{*}}{\TYtensor{\Seq{d}}}{\TYreal}{\TYtensor{\Seq{d}}} \end{array}% \end{displaymath}% -\noindent{}Scalar division: +\noindent{}\point Tensor scalar multiplication (contraction of two order-N +tensors down to a scalar, \eg{} dot product of vectors, double dot +product of 2nd-order tensors) \begin{displaymath} - \BinopTy{{/}}{\TYtensor{o}{d}}{\TYreal}{\TYtensor{o}{d}} + \begin{array}{c} + \BinopTy{{?}}{\TYtensor{\Seq{d}}}{\TYtensor{\Seq{d}}}{\TYreal} + \end{array}% \end{displaymath}% +Defined by $c = A_{\vec{i}}B_{\vec{i}}$ +~(\eg{} $\mathbf{a}\cdot\mathbf{b} = a_ib_i$ or $\mathbf{A:B} = A_{ij}B_{ij}$) +NOTE: In this and subsequent index notation expressions, a vector over the index variable +(\eg{} $\vec{i}$) means that the variable is in fact standing for a sequence of +contiguous index variables \\ +Possible direct notation syntax: ~~ {\tt .} (period) ~~ {\tt :} (colon) ~~ {\tt dot} ~~ {\tt o} -\noindent{}Addition: +\noindent{}\point Tensor product (aka outer product; order output is sum of orders) \begin{displaymath} - \BinopTy{{\odot}}{\TYtensor{o}{d}}{\TYtensor{o}{d}}{\TYtensor{o}{d}} - \qquad\text{for $\odot\in\SET{{+},{-}}$} + \begin{array}{c} + \BinopTy{{?}}{\TYtensor{\Seq{d}}}{\TYtensor{\Seq{d'}}}{\TYtensor{\Seq{d}\Seq{d'}}} + \end{array}% \end{displaymath}% +Defined by $C_{\vec{i}\vec{j}} = A_{\vec{i}}B_{\vec{j}}$ \\ +Possible direct notation syntax: ~~ {\tt x} ~~ {\tt (x)} ~~ {\tt out} -\noindent{}Negation: +\noindent{}\point Matrix Multiply \begin{displaymath} - \UnopTy{-}{\TYtensor{o}{d}}{\TYtensor{o}{d}} + \begin{array}{c} + \BinopTy{{?}}{\TYtensor{\Seq{d}}}{\TYtensor{d_1 d_2}}{\TYtensor{\Seq{d}}} \\ + \BinopTy{{?}}{\TYtensor{d_1 d_2}}{\TYtensor{\Seq{d}}}{\TYtensor{\Seq{d}}} + \end{array}% +\end{displaymath}% +Defined by $C_{i\vec{k}} = A_{ij}B_{j\vec{k}}$ and $C_{\vec{i}k} = B_{\vec{i}j}A_{jk}$ +~(\eg{} $u_i = M_{ij}v_j$ or $T_{ijl} = S_{ijk}M_{kl}$) \\ +Possible direct notation syntax: ~~ ? + +\noindent{}\point Contracting out last or first index of tensor (order $o \geq 1$) +with vector +\begin{displaymath} + \begin{array}{c} + \BinopTy{{?}}{\TYtensor{d'\Seq{d}}}{\TYvec{d}}{\TYtensor{\Seq{d}}} \\ + \BinopTy{{?}}{\TYvec{d}}{\TYtensor{d'\Seq{d}}}{\TYtensor{\Seq{d}}} + \end{array}% +\end{displaymath}% +Defined by $C_{\vec{i}} = A_{\vec{i}j}v_j$ and $C_{\vec{j}} = v_iA_{j\vec{j}}$ \\ +Possible direct notation syntax: ~~ ? + +\noindent{}\point Arbitrary tensor comprehension''. The product can also be +expressed in general index notation, and which may increase, preserve, or +decrease the tensor order. +\begin{displaymath} + \begin{array}{c} + \BinopTy{{?}}{\TYtensor{\Seq{d}}}{\TYtensor{p}{d}}{\TYtensor{q}{d}} + \end{array}% \end{displaymath}% +Defined by the conventions of Einstein summation notation. \\ +Possible syntax: {\tt } ~~ {\tt } \subsection{Field operations} -\noindent{}Creation from an image: +\noindent{}\point Creation from an image: \begin{displaymath} - \BinopTy{\OPconvolve}{\TYkern{k}}{\TYimage{d}{\mu}}{\TYfield{k}{d}{\theta}} - \qquad\text{where $\theta$ is the real conversion of $\mu$.} + \BinopTy{\OPconvolve}{\TYkern{k}}{\TYimage{d'}{\TYrawten{\Seq{d}}{\rho}}}{\TYfield{k}{d'}{\TYtensor{\Seq{d}}}} \end{displaymath}% -\noindent{}Scalar multiplication: +\noindent{}\point Scalar multiplication: \begin{displaymath} \begin{array}{c} - \BinopTy{{*}}{\TYreal}{\TYfield{k}{d}{\theta}}{\TYfield{k}{d}{\theta}} \\ - \BinopTy{{*}}{\TYfield{k}{d}{\theta}}{\TYreal}{\TYfield{k}{d}{\theta}} + \BinopTy{\OP{*}}{\TYreal}{\TYfield{k}{d}{\theta}}{\TYfield{k}{d}{\theta}} \\ + \BinopTy{\OP{*}}{\TYfield{k}{d}{\theta}}{\TYreal}{\TYfield{k}{d}{\theta}} \end{array}% \end{displaymath}% -\noindent{}Scalar division: +\noindent{}\point Scalar division: \begin{displaymath} - \BinopTy{{/}}{\TYfield{k}{d}{\theta}}{\TYreal}{\TYfield{k}{d}{\theta}} + \BinopTy{\OP{/}}{\TYfield{k}{d}{\theta}}{\TYreal}{\TYfield{k}{d}{\theta}} \end{displaymath}% -\noindent{}Negation: +\noindent{}\point Negation: \begin{displaymath} - \UnopTy{-}{\TYfield{k}{d}{\theta}}{\TYfield{k}{d}{\theta}} + \UnopTy{\OP{-}}{\TYfield{k}{d}{\theta}}{\TYfield{k}{d}{\theta}} \end{displaymath}% -\noindent{}Addition: +\noindent{}\point Addition: \begin{displaymath} \begin{array}{c} \BinopTy{{\odot}}{\TYfield{k}{d}{\theta}}{\theta}{\TYfield{k}{d}{\theta}} \\ \BinopTy{{\odot}}{\theta}{\TYfield{k}{d}{\theta}}{\TYfield{k}{d}{\theta}} \\ \BinopTy{{\odot}}{\TYfield{k_1}{d}{\theta}}{\TYfield{k_2}{d}{\theta}}{\TYfield{\min(k_1,k_2)}{d}{\theta}} \end{array}% - \qquad\text{for $\odot\in\SET{{+},{-}}$} + \qquad\text{for $\odot\in\SET{\OP{+},\OP{-}}$} \end{displaymath}% -\noindent{}Differentiation: +\noindent{}\point Differentiation: \begin{displaymath} - \UnopTy{\OPdiff}{\TYfield{k}{d}{\TYtensor{o}{d}}}{\TYfield{k-1}{d}{\TYtensor{o+1}{d}}} + \UnopTy{\OPdiff}{\TYfield{k}{d'}{\TYtensor{\Seq{d}}}}{\TYfield{k-1}{d'}{\TYtensor{d'\Seq{d}}}} \qquad\text{for $k > 0$} \end{displaymath}% -\noindent{}Probing: +\noindent{}\point Probing: \begin{displaymath} - \BinopTy{@}{\TYfield{k}{d}{\theta}}{\TYvec{d}}{\theta} + \BinopTy{\OP{@}}{\TYfield{k}{d}{\theta}}{\TYvec{d}}{\theta} \end{displaymath}% \end{document}
Click to toggle
does not end with </html> tag
does not end with </body> tag
The output has ended thus: + \BinopTy{\OP{@}}{\TYfield{k}{d}{\theta}}{\TYvec{d}}{\theta} \end{displaymath}% \end{document}