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

Commit 862a097

Browse files
vrugeOpenModelica-Hudson
authored andcommitted
improved inStream
simplify/evaluate bounds before compare with zero Belonging to [master]: - #2338
1 parent acd54fc commit 862a097

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

Compiler/BackEnd/BackendDAEOptimize.mo

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,24 @@ algorithm
208208
isZero := match bound
209209
local
210210
Real r;
211+
Boolean b;
212+
DAE.Exp expr;
211213

212214
case SOME(DAE.RCONST(r))
213-
then if neg then r<= 0.0 else r >= 0.0;
215+
then if neg then r<= 0.0 else r >= 0.0;
216+
217+
case SOME(expr)
218+
//guard Expression.isConst(expr)
219+
algorithm
220+
expr := ExpressionSimplify.simplify(expr);
221+
b := match expr
222+
case DAE.RCONST(r)
223+
then if neg then r<= 0.0 else r >= 0.0;
224+
else
225+
false;
226+
end match;
227+
then
228+
b;
214229

215230
else false;
216231
end match;

0 commit comments

Comments
 (0)