Skip to content

Commit

Permalink
Remove arrayLayout since most tools have not implemented it. (modelic…
Browse files Browse the repository at this point in the history
…a#3196)

* Remove arrayLayout since most tools have not implemented it.
As far as currently known no library uses it.
Closes modelica#3189
* EndExample
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
  • Loading branch information
HansOlsson committed Jun 23, 2022
1 parent b345cb7 commit d89fa50
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions chapters/functions.tex
Expand Up @@ -2073,7 +2073,7 @@ \subsubsection{Arrays}\label{arrays-1}
The type {\lstinline[language=C]!size_t!} is a C unsigned integer type.
\end{nonnormative}

Arrays are by default stored in row-major order when calling C functions and in column-major order when calling FORTRAN~77 functions. These defaults can be overridden by the {\lstinline!arrayLayout!} annotation. See the example below.
Arrays are stored in row-major order when calling C functions and in column-major order when calling FORTRAN~77 functions.

The table below shows the mapping of an array argument in the absence of an explicit external function call when calling a C function.
The type {\lstinline!T!} is allowed to be any of the simple types which can be passed to C as defined in \cref{simple-types} or a record type as defined in \cref{records} and it is mapped to the type $T'$ as defined in these sections for input arguments.
Expand Down Expand Up @@ -2196,21 +2196,6 @@ \subsubsection{Arrays}\label{arrays-1}
$\ldots$
END
\end{lstlisting}

This example shows how to pass an array in column major order to a C function.

\begin{lstlisting}[language=modelica]
function fie
input Real[:,:] a;
output Real b;
external;
annotation(arrayLayout = "columnMajor");
end fie;
\end{lstlisting}
This corresponds to the following C prototype:
\begin{lstlisting}[language=C]
double fie(const double *, size_t, size_t);
\end{lstlisting}
\end{example}

\subsubsection{Records}\label{records}
Expand Down

0 comments on commit d89fa50

Please sign in to comment.