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

Commit 46f06d4

Browse files
committed
treat ZC relations with different index as unique
1 parent b107bcd commit 46f06d4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Compiler/BackEnd/ZeroCrossings.mo

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ algorithm
146146
comp := match (zc1, zc2)
147147
local
148148
DAE.Exp e1, e2, e3, e4;
149+
Integer i1, i2;
149150

150151
case (BackendDAE.ZERO_CROSSING(relation_=DAE.CALL(path=Absyn.IDENT("sample"), expLst={e1, _, _})), BackendDAE.ZERO_CROSSING(relation_=DAE.CALL(path=Absyn.IDENT("sample"), expLst={e2, _, _})))
151152
then Expression.compare(e1,e2);
@@ -169,6 +170,10 @@ algorithm
169170
comp := Expression.compare(e1,e3);
170171
then if comp==0 then Expression.compare(e2, e4) else comp;
171172

173+
case (BackendDAE.ZERO_CROSSING(relation_=DAE.RELATION(index=i1)), BackendDAE.ZERO_CROSSING(relation_=DAE.RELATION(index=i2)))
174+
guard not intEq(i1,i2)
175+
then if (i1-i2) > 0 then 1 else -1;
176+
172177
case (BackendDAE.ZERO_CROSSING(relation_=e1), BackendDAE.ZERO_CROSSING(relation_=e2))
173178
then Expression.compare(e1, e2);
174179
end match;

0 commit comments

Comments
 (0)