Skip to content

Commit

Permalink
Fix misc styling of array reductions
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Jun 16, 2020
1 parent e143772 commit 32f8c4f
Showing 1 changed file with 39 additions and 44 deletions.
83 changes: 39 additions & 44 deletions chapters/arrays.tex
Original file line number Diff line number Diff line change
Expand Up @@ -350,87 +350,82 @@ \subsection{Reduction Functions and Operators}\doublelabel{reduction-functions-a
\lstinline!min(A)!
&
Returns the least element of array expression \lstinline!A!; as defined by \lstinline!<!.\\ \hline
\lstinline!min(x,y)!
\lstinline!min(x, y)!
&
Returns the least element of the scalars \lstinline!x! and \lstinline!y!; as defined by \lstinline!<!.\\ \hline
\begin{tabular}{@{}p{4cm}@{}}
\lstinline!min(e(i, ..., j)!\\
\lstinline! for i in u,!\\
\lstinline! ..., j in v)!
\lstinline[mathescape=true]!min(e(i, $\ldots$, j)!\\
\lstinline[mathescape=true]! for i in u,!\\
\lstinline[mathescape=true]! $\ldots$, j in v)!
\end{tabular}
&
\begin{tabular}{@{}p{10cm}@{}}
Also described in \autoref{reduction-expressions}\\
Returns the least value (as defined by \lstinline!<!) of the scalar
expression \lstinline!e(i, ..., j)! evaluated for all combinations of \lstinline!i! in \lstinline!u!, \ldots, \lstinline!j!
in \lstinline!v!:
Also described in \autoref{reduction-expressions}. Returns the least value (as defined by \lstinline!<!) of the scalar expression
\lstinline[mathescape=true]!e(i, $\ldots$, j)! evaluated for all combinations of \lstinline!i! in \lstinline!u!, \ldots, \lstinline!j! in \lstinline!v!.
\end{tabular}\\ \hline
\lstinline!max(A)!
&
Returns the greatest element of array expression \lstinline!A!; as defined by
\lstinline!>!.\\ \hline
\lstinline!max(x,y)!
\lstinline!max(x, y)!
&
Returns the greatest element of the scalars \lstinline!x! and \lstinline!y!; as defined by
\lstinline!>!.\\ \hline
\begin{tabular}{@{}p{4cm}@{}}
\lstinline!max(e(i, ..., j)!\\
\lstinline! for i in u,!\\
\lstinline! ..., j in v)!
\lstinline[mathescape=true]!max(e(i, $\ldots$, j)!\\
\lstinline[mathescape=true]! for i in u, $\ldots$,!\\
\lstinline[mathescape=true]! j in v)!
\end{tabular}
&
\begin{tabular}{@{}p{10cm}@{}}
Also described in \autoref{reduction-expressions}
Returns the greatest value (as defined by \lstinline!>!) of the scalar
expression \lstinline!e(i, ..., j)! evaluated for all combinations of \lstinline!i! in \lstinline!u!, \ldots, \lstinline!j!
in \lstinline!v!:
Also described in \autoref{reduction-expressions}. Returns the greatest value (as defined by \lstinline!>!) of the scalar expression
\lstinline[mathescape=true]!e(i, $\ldots$, j)! evaluated for all combinations of \lstinline!i! in \lstinline!u!, \ldots, \lstinline!j! in \lstinline!v!.
\end{tabular}\\ \hline
\lstinline!sum(A)!
&
\begin{tabular}{@{}p{10cm}@{}}
Returns the scalar sum of all the elements of array expression:\\
\lstinline!=sum(A[j,k,...]) for j,k,...!
Returns the scalar sum of all the elements of array expression \lstinline!A!:\\
\lstinline[mathescape=true]!= sum(A[j, k, $\ldots$] for j, k, $\ldots$)!
\end{tabular}\\ \hline
\begin{tabular}{@{}p{5cm}@{}}
\lstinline!sum(e(i, ..., j)!\\
\lstinline! for i in u,!\\
\lstinline! ..., j in v)!
\lstinline[mathescape=true]!sum(e(i, $\ldots$, j)!\\
\lstinline[mathescape=true]! for i in u, $\ldots$,!\\
\lstinline[mathescape=true]! j in v)!
\end{tabular}
&
\begin{tabular}{@{}p{10cm}@{}}
Also described in \autoref{reduction-expressions}\\
Returns the sum of the expression e(i, ..., j) evaluated for all
combinations of i in u, ..., j in v: For \lstinline!Integer! indexing this is
e(u{[}1{]},...
,v{[}1{]})+e(u{[}2{]},... ,v{[}1{]})+... +e(u{[}end{]},...
,v{[}1{]})+...+e(u{[}end{]},... ,v{[}end{]})
For non-\lstinline!Integer! indexing this uses all valid indices instead of 1..\lstinline!end!.
The type of sum(e(i, ..., j) for i in u, ..., j
in v) is the same as the type of e(i,...j).
Also described in \autoref{reduction-expressions}. Returns the sum of the expression \lstinline[mathescape=true]!e(i, $\ldots$, j)! evaluated for all
combinations of \lstinline[mathescape=true]!i in u!, $\ldots$, \lstinline[mathescape=true]!j in v!: For \lstinline!Integer! indexing this is
\begin{lstlisting}[language=modelica,mathescape=true]
e(u[1], $\ldots$, v[1]) + e(u[2], $\ldots$, v[1]) + $\ldots$
+ e(u[end], $\ldots$, v[1]) + $\ldots$
+ e(u[end], $\ldots$, v[end])
\end{lstlisting}
For non-\lstinline!Integer! indexing this uses all valid indices instead of 1..\lstinline!end!.
The type of \lstinline[mathescape=true]!sum(e(i, $\ldots$, j) for i in u, $\ldots$, j in v)! is the same as the type of \lstinline[mathescape=true]!e(i, $\ldots$, j)!.
\end{tabular}\\ \hline
\lstinline!product(A)!
&
\begin{tabular}{@{}p{10cm}@{}}
Returns the scalar product of all the elements of array expression A.\\
\lstinline!=product(A[j,k,...] for j,k,...!
Returns the scalar product of all the elements of array expression \lstinline!A!:\\
\lstinline[mathescape=true]!= product(A[j, k, $\ldots$] for j, k, $\ldots$)!
\end{tabular}\\ \hline
\begin{tabular}{@{}p{4cm}@{}}
\lstinline!product(e(i, ..., j)!\\
\lstinline! for i in u,!\\
\lstinline! ..., j in v)!
\lstinline[mathescape=true]!product(e(i, $\ldots$, j)!\\
\lstinline[mathescape=true]! for i in u, $\ldots$,!\\
\lstinline[mathescape=true]! j in v)!
\end{tabular}
&
\begin{tabular}{@{}p{10cm}@{}}
Also described in \autoref{reduction-expressions}.\\
Returns the product of the scalar expression e(i, ..., j) evaluated for
all combinations of i in u, ..., j in v: For \lstinline!Integer! indexing this is
\begin{lstlisting}[language=modelica]
e(u[1],...,v[1])*e(u[2],...,v[1])*...
*(u[end],...,v[1])*...*e(u[end],...,v[end])
Also described in \autoref{reduction-expressions}. Returns the product of the scalar expression \lstinline[mathescape=true]!e(i, $\ldots$, j)! evaluated for
all combinations of \lstinline!i in u!, \ldots, \lstinline!j in v!: For \lstinline!Integer! indexing this is
\begin{lstlisting}[language=modelica,mathescape=true]
e(u[1], $\ldots$, v[1]) * e(u[2], $\ldots$, v[1]) * $\ldots$
* e(u[end], $\ldots$, v[1]) * $\ldots$
* e(u[end], $\ldots$, v[end])
\end{lstlisting}
For non-\lstinline!Integer! indexing this uses all valid indices instead of 1..\lstinline!end!.
The type of product(e(i, ..., j) for i in u, ..., j
in v) is the same as the type of e(i,...j).
For non-\lstinline!Integer! indexing this uses all valid indices instead of 1..\lstinline!end!.
The type of \lstinline[mathescape=true]!product(e(i, $\ldots$, j) for i in u, $\ldots$, j in v)! is the same as the type of \lstinline[mathescape=true]!e(i, $\ldots$, j)!.
\end{tabular}
\\ \hline
\end{longtable}
Expand Down

0 comments on commit 32f8c4f

Please sign in to comment.