Skip to content

Commit

Permalink
Add cross references to description of assignment to subscripted arra…
Browse files Browse the repository at this point in the history
…y variables
  • Loading branch information
henrikt-ma committed Nov 24, 2020
1 parent 85248df commit d04200f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
11 changes: 5 additions & 6 deletions chapters/arrays.tex
Original file line number Diff line number Diff line change
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.

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
7 changes: 5 additions & 2 deletions chapters/statements.tex
Original file line number Diff line number Diff line change
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 Down

0 comments on commit d04200f

Please sign in to comment.