Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions chapters/arrays.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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*}

Expand Down
4 changes: 1 addition & 3 deletions chapters/operatorsandexpressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Expand Down