Skip to content

Commit

Permalink
Rephrase introduction to vectorization rules
Browse files Browse the repository at this point in the history
The previous formulation had a passive form that didn't really work as an introduction to the list of rules.
  • Loading branch information
henrikt-ma committed Nov 10, 2020
1 parent 8425d51 commit ee77d06
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions chapters/functions.tex
Expand Up @@ -822,10 +822,9 @@ \subsection{Scalar Functions Applied to Array Arguments}\label{scalar-functions-

Functions with one scalar return value can be applied to arrays element-wise, e.g.\ if \lstinline!A! is a vector of reals, then \lstinline!sin(A)! is a vector where each element is the result of applying the function \lstinline!sin! to the corresponding element in \lstinline!A!. Only \lstinline!function! classes that are transitively non-replaceable (\cref{transitively-non-replaceable} and \cref{restrictions-on-base-classes-and-constraining-types-to-be-transitively-non-replaceable}) may be called vectorized.

Consider the expression \lstinline!f(arg1, $\ldots$, argn)!, an application of the function \lstinline!f! to the arguments \lstinline!arg1!, \ldots, \lstinline!argn! is defined.

For each passed argument, the type of the argument is checked against
the type of the corresponding formal parameter of the function.
Consider the expression \lstinline!f(arg1, $\ldots$, argn)!, an application of the function \lstinline!f! to the arguments \lstinline!arg1!, \ldots, \lstinline!argn!.
Potential vectorization of this call is defined as follows.
For each passed argument, the type of the argument is checked against the type of the corresponding formal parameter of the function:
\begin{enumerate}
\item\label{argument-type-check-match}
If the types match, nothing is done.
Expand Down

0 comments on commit ee77d06

Please sign in to comment.