Skip to content

Commit

Permalink
improved inStream
Browse files Browse the repository at this point in the history
simplify/evaluate bounds before compare with zero

Belonging to [master]:
  - OpenModelica/OMCompiler#2338
  • Loading branch information
vruge authored and OpenModelica-Hudson committed Apr 4, 2018
1 parent acd54fc commit 862a097
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Compiler/BackEnd/BackendDAEOptimize.mo
Expand Up @@ -208,9 +208,24 @@ algorithm
isZero := match bound
local
Real r;
Boolean b;
DAE.Exp expr;

case SOME(DAE.RCONST(r))
then if neg then r<= 0.0 else r >= 0.0;
then if neg then r<= 0.0 else r >= 0.0;

case SOME(expr)
//guard Expression.isConst(expr)
algorithm
expr := ExpressionSimplify.simplify(expr);
b := match expr
case DAE.RCONST(r)
then if neg then r<= 0.0 else r >= 0.0;
else
false;
end match;
then
b;

else false;
end match;
Expand Down

0 comments on commit 862a097

Please sign in to comment.