You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Examples of scalars vs.\ array slices created with the colon index.
995
995
The examples make use of the array variables \lstinline!x[$n$, $m$]!, \lstinline!v[$k$]!, and \lstinline!z[$i$, $j$, $p$]!.
996
996
}
@@ -1069,7 +1069,7 @@ \subsection{Equality and Assignment}\label{equality-and-assignment}
1069
1069
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.
1070
1070
1071
1071
\begin{table}[H]
1072
-
\caption{%
1072
+
\caption{
1073
1073
Equality and assignment of arrays and scalars.
1074
1074
The scalar \tablehead{Operation} applies for all $j$ in $1,\,\ldots,\, n$ and $k$ in $1,\,\ldots,\, m$.
1075
1075
}
@@ -1095,7 +1095,7 @@ \subsection{Addition, Subtraction, and String Concatenation}\label{array-element
1095
1095
Addition \lstinline!a + b! of string scalars, vectors, matrices, and arrays is defined as element-wise string concatenation of corresponding elements from \lstinline!a! and \lstinline!b!, and require \lstinline!size(a) = size(b)!.
1096
1096
1097
1097
\begin{table}[H]
1098
-
\caption{%
1098
+
\caption{
1099
1099
Array addition, subtraction, and string concatenation.
1100
1100
In this table the symbolic operator $\pm$ represents either \lstinline!+! or \lstinline!-!.
1101
1101
The scalar \tablehead{Operation} applies for all $j$ in $1,\,\ldots,\, n$ and $k$ in $1,\,\ldots,\, m$.
@@ -1121,7 +1121,7 @@ \subsection{Addition, Subtraction, and String Concatenation}\label{array-element
1121
1121
Element-wise addition \lstinline!a .+ b! of string scalars, vectors, matrices, and arrays is defined as element-wise string concatenation of corresponding elements from \lstinline!a! and \lstinline!b!, and require either \lstinline!size(a) = size(b)! or scalar \lstinline!a! or scalar \lstinline!b!.
1122
1122
1123
1123
\begin{table}[H]
1124
-
\caption{%
1124
+
\caption{
1125
1125
Array element-wise addition, subtraction, and string concatenation.
1126
1126
In this table the symbolic operator $\pm$ represents either \lstinline!+! or \lstinline!-!, and when preceded by a dot (\lstinline!.$\pm$!), either \lstinline!.+! or \lstinline!.-!.
1127
1127
The scalar \tablehead{Operation} applies for all $j$ in $1,\,\ldots,\, n$ and $k$ in $1,\,\ldots,\, m$.
@@ -1143,7 +1143,7 @@ \subsection{Addition, Subtraction, and String Concatenation}\label{array-element
1143
1143
\end{table}
1144
1144
1145
1145
\begin{table}[H]
1146
-
\caption{%
1146
+
\caption{
1147
1147
Unary operators.
1148
1148
In this table the symbolic operator $\pm$ represents either unary \lstinline!+! or unary \lstinline!-!.
1149
1149
The element-wise (\lstinline!.+!, \lstinline!.-!) and normal (\lstinline!+!, \lstinline!-!) operators give the same results.
Scalar multiplication \lstinline!s * a! or \lstinline!a * s! with numeric scalar s and numeric scalar, vector, matrix or array \lstinline!a! is defined element-wise:
1170
1170
\begin{table}[H]
1171
-
\caption{%
1171
+
\caption{
1172
1172
Scalar and scalar to array multiplication of numeric elements.
1173
1173
The scalar \tablehead{Operation} applies for all $j$ in $1,\,\ldots,\, n$ and $k$ in $1,\,\ldots,\, m$.
Element-wise multiplication \lstinline!a .* b! of numeric scalars, vectors, matrices or arrays \lstinline!a! and \lstinline!b! requires a numeric type class for \lstinline!a! and \lstinline!b! and either \lstinline!size(a) = size(b)! or scalar \lstinline!a! or scalar \lstinline!b!.
1192
1192
1193
1193
\begin{table}[H]
1194
-
\caption{%
1194
+
\caption{
1195
1195
Array element-wise multiplication.
1196
1196
The scalar \tablehead{Operation} applies for all $j$ in $1,\,\ldots,\, n$ and $k$ in $1,\,\ldots,\, m$.
1197
1197
}
@@ -1216,7 +1216,7 @@ \subsection{Multiplication of Matrices and Vectors}\label{matrix-and-vector-mult
1216
1216
1217
1217
Multiplication \lstinline!a * b! of numeric vectors and matrices is defined only for the following combinations:
1218
1218
\begin{table}[H]
1219
-
\caption{%
1219
+
\caption{
1220
1220
Matrix and vector multiplication of arrays with numeric elements.
1221
1221
The scalar \tablehead{Operation} applies for all $i$ in $1,\,\ldots,\, l$ and $j$ in $1,\,\ldots,\, n$, and the summation over $k$ goes from 1 to $m$.
1222
1222
}
@@ -1254,7 +1254,7 @@ \subsection{Division by Numeric Scalars}\label{division-by-numeric-scalars}
1254
1254
In order to get integer division with truncation, use the function \lstinline!div!.
1255
1255
1256
1256
\begin{table}[H]
1257
-
\caption{%
1257
+
\caption{
1258
1258
Division of scalars and arrays by numeric elements.
1259
1259
The scalar \tablehead{Operation} applies for all $j$ in $1,\,\ldots,\, n$ and $k$ in $1,\,\ldots,\, m$.
Element-wise exponentiation \lstinline!a .^ b! of numeric scalars, vectors, matrices, or arrays \lstinline!a! and \lstinline!b! requires a numeric type class for \lstinline!a! and \lstinline!b! and either \lstinline!size(a) = size(b)! or scalar \lstinline!a! or scalar \lstinline!b!.
1335
1335
1336
1336
\begin{table}[H]
1337
-
\caption{%
1337
+
\caption{
1338
1338
Element-wise exponentiation of arrays.
1339
1339
The scalar \tablehead{Operation} applies for all $j$ in $1,\,\ldots,\, n$ and $k$ in $1,\,\ldots,\, m$.
Copy file name to clipboardExpand all lines: chapters/operatorsandexpressions.tex
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ \section{Operator Precedence and Associativity}\label{operator-precedence-and-as
42
42
43
43
The following table presents the precedence and associativity of all the expression operators, consistent with and complementing information that can be derived from the Modelica grammar in \cref{modelica-concrete-syntax}.
44
44
\begin{table}[H]
45
-
\caption{%
45
+
\caption{
46
46
Operators in order of precedence from highest to lowest.
47
47
Operators with different precedence are separated by horizontal lines.
48
48
All operators are binary except array index, member access, function call, those shown as unary together with \emph{expr}, the conditional operator, the array construction operator
Roots of package hierarchies, e.g., \lstinline!Modelica!, \lstinline!MyLib!, and \lstinline!ComplexNumbers! in \lstinline!MODELICAPATH! = \filename{C:\textbackslash{}library;C:\textbackslash{}lib1;C:\textbackslash{}lib2}.
0 commit comments