diff --git a/chapters/arrays.tex b/chapters/arrays.tex index 744de603c..daf4d366e 100644 --- a/chapters/arrays.tex +++ b/chapters/arrays.tex @@ -254,8 +254,8 @@ \subsection{Dimension and Size Functions}\label{array-dimension-and-size-functio \hline \hline {\lstinline!ndims($A$)!} & Number of dimensions & \Cref{modelica:ndims} \\ -{\lstinline!size($A$, $i$)!} & Size of single array dimension & \Cref{modelica:size-of-dim} \\ {\lstinline!size($A$)!} & Sizes of all array dimensions & \Cref{modelica:size-vector} \\ +{\lstinline!size($A$, $i$)!} & Size of single array dimension & \Cref{modelica:size-of-dim} \\ \hline \end{tabular} \end{center} @@ -269,25 +269,24 @@ \subsection{Dimension and Size Functions}\label{array-dimension-and-size-functio \end{semantics} \end{operatordefinition} -\begin{operatordefinition*}[size]\label{modelica:size-of-dim}\index{size@\robustinline{size}!of single array dimension} +\begin{operatordefinition*}[size]\label{modelica:size-vector}\index{size@\robustinline{size}!of all array dimensions} \begin{synopsis}\begin{lstlisting} -size($A$, $i$) +size($A$) \end{lstlisting}\end{synopsis} \begin{semantics} -Returns the size of dimension $i$ of array expression $A$ where $1 \leq i \leq$ \lstinline!ndims($A$)!. +Returns a vector of length \lstinline!ndims($A$)! containing the dimension sizes of $A$. -If $A$ refers to a component of an expandable connector, then the component must be a declared component of the expandable connector, and it must not use colon (\lstinline!:!) to specify the array size of dimension $i$. +If $A$ refers to a component of an expandable connector, then the component must be a declared component of the expandable connector, and it must not use colon (\lstinline!:!) to specify the size of any array dimension. \end{semantics} \end{operatordefinition*} -\begin{operatordefinition*}[size]\label{modelica:size-vector}\index{size@\robustinline{size}!of all array dimensions} +\begin{operatordefinition*}[size]\label{modelica:size-of-dim}\index{size@\robustinline{size}!of single array dimension} \begin{synopsis}\begin{lstlisting} -size($A$) +size($A$, $i$) \end{lstlisting}\end{synopsis} \begin{semantics} -Returns a vector of length \lstinline!ndims($A$)! containing the dimension sizes of $A$. - -If $A$ refers to a component of an expandable connector, then the component must be a declared component of the expandable connector, and it must not use colon (\lstinline!:!) to specify the size of any array dimension. +Syntactic sugar for \lstinline!(size($A$))[$i$]!, that is, the size of dimension $i$ of array expression $A$. +(It follows that it is required that $1 \leq i \leq$ \lstinline!ndims($A$)!.) \end{semantics} \end{operatordefinition*} diff --git a/chapters/operatorsandexpressions.tex b/chapters/operatorsandexpressions.tex index 373d02d3a..bdb53a05e 100644 --- a/chapters/operatorsandexpressions.tex +++ b/chapters/operatorsandexpressions.tex @@ -1617,7 +1617,7 @@ \subsection{Evaluable Expressions}\label{evaluable-expressions} Some function calls are evaluable expressions even if one or more arguments are not: \begin{itemize} \item - \lstinline!size(A)! (including \lstinline!size(A, j)! where \lstinline!j! is an evaluable expression) if \lstinline!A! is variable declared in a non-function class. + \lstinline!size(A)! if \lstinline!A! is variable declared in a non-function class. \item \lstinline!delay($x$, $\ldots$)! where $x$ is an evaluable expression. \item @@ -1642,8 +1642,6 @@ \subsection{Parameter Expressions}\label{parameter-expressions} \item Some function calls are parameter expressions even if one or more arguments are not: \begin{itemize} - \item - \lstinline!size(A, j)! where \lstinline!j! is a parameter expression, if \lstinline!A! is variable declared in a non-function class. \item \lstinline!delay($x$, $\ldots$)! where $x$ is a parameter expression. \end{itemize}