Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross references to assignment of subscripted array variable #2737

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 5 additions & 6 deletions chapters/arrays.tex
Expand Up @@ -1037,12 +1037,11 @@ \section{Scalar, Vector, Matrix, and Array Operator Functions}\label{scalar-vect

\subsection{Equality and Assignment}\label{equality-and-assignment}

Equality \lstinline!a = b! and assignment \lstinline!a := b! of scalars, vectors, matrices, and
arrays is defined element-wise and require both objects to have the same
number of dimensions and corresponding dimension sizes. The operands
need to be type equivalent. This is legal for the simple types and all
types satisfying the requirements for a record, and is in the latter
case applied to each component-element of the records.
Equality \lstinline!a = b! and assignment \lstinline!a := b! of scalars, vectors, matrices, and arrays is defined element-wise and require both objects to have the same number of dimensions and corresponding dimension sizes.
See \cref{array-indexing} regarding assignments to array variables with repeated subscripts.
henrikt-ma marked this conversation as resolved.
Show resolved Hide resolved

The operands need to be type equivalent.
This is legal for the simple types and all types satisfying the requirements for a record, and is in the latter case applied to each component-element of the records.

\begin{table}[H]
\caption{Equality and assignment of arrays and scalars. The scalar \tablehead{Operation} applies for all $j$ in $1,\, \ldots,\, n$ and $k$ in $1,\, \ldots,\, m$.}
Expand Down
9 changes: 6 additions & 3 deletions chapters/statements.tex
Expand Up @@ -125,8 +125,11 @@ \subsection{Simple Assignment Statements}\label{simple-assignment-statements}
component-reference ":=" expression
\end{lstlisting}

The \lstinline!expression! is evaluated. The resulting value is stored into the
variable denoted by \lstinline!component-reference!.
The \lstinline[language=grammar]!expression! is evaluated.
The resulting value is stored into the variable denoted by \lstinline[language=grammar]!component-reference!.

Assignment to array variables with subscripts is described in \cref{array-indexing}.


\subsubsection{Assignments from Called Functions with Multiple Results}\label{assignments-from-called-functions-with-multiple-results}

Expand All @@ -143,7 +146,7 @@ \subsubsection{Assignments from Called Functions with Multiple Results}\label{as

It is possible to omit receiving variables from this list:
\begin{lstlisting}[language=modelica]
(out1,, out3) := function_name(in1, in2, in3, in4);
(out1, , out3) := function_name(in1, in2, in3, in4);
\end{lstlisting}

\begin{example}
Expand Down