Skip to content

Commit

Permalink
Update pure function optimization example, avoiding long lines
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Nov 10, 2020
1 parent 671e4b2 commit 8425d51
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion chapters/functions.tex
Expand Up @@ -366,7 +366,11 @@ \section{Pure Modelica Functions}\label{pure-modelica-functions}

Examples of restrictions on optimizing pure functions:
\begin{lstlisting}[language=modelica]
Real x = if noEvent(abs(x)) < 1 then asin(x) else 0; // Cannot move asin(x) out of then
Real x =
if noEvent(abs(x)) < 1 then
asin(x) // Cannot move asin(x) out of if-branch.
else
0;
algorithm
assertCheck(p, T); // Must call function
algorithm
Expand Down

0 comments on commit 8425d51

Please sign in to comment.