Skip to content

Commit

Permalink
State that promote is part of Modelica
Browse files Browse the repository at this point in the history
  • Loading branch information
HansOlsson committed Jun 18, 2020
1 parent 59d768b commit 9fbebc3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions chapters/arrays.tex
Expand Up @@ -184,7 +184,7 @@ \section{Built-in Array Functions}\doublelabel{built-in-array-functions}

Modelica provides a number of built-in functions that are applicable to arrays.

The following \lstinline!promote! function cannot be used in Modelica, but is
The following \lstinline!promote! function is
utilized below to define other array operators and functions:
\begin{longtable}[]{|l|p{9cm}|}
\caption{Promote function (cannot be used in Modelica).}\\
Expand All @@ -195,10 +195,14 @@ \section{Built-in Array Functions}\doublelabel{built-in-array-functions}
\lstinline[mathescape=true]!size(C, $j$)! = $1$ for $n_{\mathrm{A}} + 1 \leq j \leq n$, \lstinline[mathescape=true]!C[$i_{1}$, $\ldots$, $i_{n_{\mathrm{A}}}$, 1, $\ldots$, 1]! =
\lstinline[mathescape=true]!A[$i_{1}$, $\ldots$, $i_{n_{\mathrm{A}}}$]!\\ \hline
\end{longtable}
The argument $n$ must be literal or a constant that can be evaluated during translation because it determines
the number of dimensions of the returned array.

\begin{nonnormative}
The function \lstinline!promote! cannot be used in Modelica, because the number of dimensions of the returned array cannot be determined at compile time
if $n$ is a variable. Below, \lstinline!promote! is only used for constant $n$.
Below, \lstinline!promote! is only used for constant $n$.

Varying $n$ for \lstinline!promote! complicates matrix handling as it
can change matrix-equations in subtle ways (e.g.\ changing inner products to matrix multiplication).
\end{nonnormative}

\begin{nonnormative}
Expand Down

0 comments on commit 9fbebc3

Please sign in to comment.