From ee77d06b37583acf67edec222ab68c494c789936 Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Tue, 10 Nov 2020 15:42:16 +0100 Subject: [PATCH] Rephrase introduction to vectorization rules The previous formulation had a passive form that didn't really work as an introduction to the list of rules. --- chapters/functions.tex | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/chapters/functions.tex b/chapters/functions.tex index 0560d2e9d..8501eb2a9 100644 --- a/chapters/functions.tex +++ b/chapters/functions.tex @@ -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.