Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit ed95fad

Browse files
perostOpenModelica-Hudson
authored andcommitted
[NF] Constant evaluation fixes.
- Implement evaluation of smooth. - Declare pre, change, edge and sample as impure. Belonging to [master]: - #2435
1 parent 6aa87b5 commit ed95fad

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Compiler/NFFrontEnd/NFCeval.mo

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,6 +1212,7 @@ algorithm
12121212
case "sinh" then evalBuiltinSinh(listHead(args));
12131213
case "sin" then evalBuiltinSin(listHead(args));
12141214
case "skew" then evalBuiltinSkew(listHead(args));
1215+
case "smooth" then listGet(args, 2);
12151216
case "sqrt" then evalBuiltinSqrt(listHead(args));
12161217
case "String" then evalBuiltinString(args);
12171218
case "sum" then evalBuiltinSum(listHead(args));

Compiler/NFFrontEnd/NFModelicaBuiltin.mo

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ annotation(Documentation(info="<html>
158158
</html>"));
159159
end semiLinear;
160160

161-
function edge "Indicate rising edge"
161+
impure function edge "Indicate rising edge"
162162
input Boolean b;
163163
output Boolean edgeEvent;
164164
// TODO: Ceval parameters? Needed to remove the builtin handler
@@ -485,7 +485,7 @@ function noEvent "Turn off event triggering"
485485
</html>"));
486486
end noEvent;
487487

488-
function pre<PodCref> "Refer to left limit"
488+
impure function pre<PodCref> "Refer to left limit"
489489
discrete input PodCref y;
490490
output PodCref p;
491491
external "builtin";
@@ -494,7 +494,7 @@ function pre<PodCref> "Refer to left limit"
494494
</html>"));
495495
end pre;
496496

497-
function change<PodCref> "Indicate discrete variable changing"
497+
impure function change<PodCref> "Indicate discrete variable changing"
498498
discrete input PodCref y;
499499
output Boolean p;
500500
external "builtin";
@@ -512,7 +512,7 @@ function reinit<RealOrArrayCref, RealOrArrayExpr> "Reinitialize state variable"
512512
</html>"));
513513
end reinit;
514514

515-
function sample "Overloaded operator to either trigger time events or to convert between continuous-time and clocked-time representation"
515+
impure function sample "Overloaded operator to either trigger time events or to convert between continuous-time and clocked-time representation"
516516
parameter input Real start;
517517
parameter input Real interval;
518518
output Boolean b;

0 commit comments

Comments
 (0)