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

Commit

Permalink
Use ZeroCrossingSet where necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
hkiel committed Apr 11, 2019
1 parent 14eabaa commit f476758
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Compiler/BackEnd/FindZeroCrossings.mo
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ end findZeroCrossingsIfEqns;
protected function findZeroCrossingsinJacobians
input BackendDAE.StrongComponents inStrongComponents;
input BackendDAE.ZeroCrossingSet zeroCrossingLst;
input DoubleEndedList<BackendDAE.ZeroCrossing> relationsLst;
input BackendDAE.ZeroCrossingSet relationsLst;
input BackendDAE.ZeroCrossingSet samplesLst;
input BackendDAE.Variables allVariables;
input BackendDAE.Variables globalKnownVars;
Expand Down Expand Up @@ -855,7 +855,7 @@ end findZeroCrossingsinJacobians;
protected function replaceZCExpinFullJacobian
input BackendDAE.FullJacobian fullJac;
input BackendDAE.ZeroCrossingSet zeroCrossingLst;
input DoubleEndedList<BackendDAE.ZeroCrossing> relationsLst;
input BackendDAE.ZeroCrossingSet relationsLst;
input BackendDAE.ZeroCrossingSet samplesLst;
input BackendDAE.Variables allVariables;
input BackendDAE.Variables globalKnownVars;
Expand All @@ -881,7 +881,7 @@ end replaceZCExpinFullJacobian;
protected function replaceZCExpinSymJacobian
input BackendDAE.SymbolicJacobian symJac;
input BackendDAE.ZeroCrossingSet zeroCrossingLst;
input DoubleEndedList<BackendDAE.ZeroCrossing> relationsLst;
input BackendDAE.ZeroCrossingSet relationsLst;
input BackendDAE.ZeroCrossingSet samplesLst;
input BackendDAE.Variables allVariables;
input BackendDAE.Variables globalKnownVars;
Expand All @@ -900,7 +900,7 @@ end replaceZCExpinSymJacobian;
protected function replaceZeroCrossingsJacBackend
input BackendDAE.BackendDAE inBackendDAE;
input BackendDAE.ZeroCrossingSet zeroCrossingLst;
input DoubleEndedList<BackendDAE.ZeroCrossing> relationsLst;
input BackendDAE.ZeroCrossingSet relationsLst;
input BackendDAE.ZeroCrossingSet samplesLst;
input BackendDAE.Variables allVariables;
input BackendDAE.Variables globalKnownVars;
Expand Down
1 change: 1 addition & 0 deletions Compiler/BackEnd/ZeroCrossings.mo
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ algorithm
comp := match (zc1, zc2)
local
DAE.Exp e1, e2, e3, e4;
Integer i1, i2;

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, _, _})))
then Expression.compare(e1,e2);
Expand Down
4 changes: 2 additions & 2 deletions Compiler/SimCode/SimCodeMain.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ protected
list<DAE.ComponentRef> discreteModelVars;
list<BackendDAE.TimeEvent> timeEvents;
BackendDAE.ZeroCrossingSet zeroCrossingsSet, sampleZCSet;
DoubleEndedList<BackendDAE.ZeroCrossing> de_relations;
BackendDAE.ZeroCrossingSet de_relations;
list<BackendDAE.ZeroCrossing> zeroCrossings, sampleZC, relations;

BackendDAE.Variables daeVars, resVars, algStateVars, auxVars;
Expand Down Expand Up @@ -1179,7 +1179,7 @@ algorithm
timeEvents := inBackendDAE.shared.eventInfo.timeEvents;
(zeroCrossings,relations,sampleZC) := match inBackendDAE.shared.eventInfo
case BackendDAE.EVENT_INFO(zeroCrossings=zeroCrossingsSet, relations=de_relations, samples=sampleZCSet)
then (ZeroCrossings.toList(zeroCrossingsSet), DoubleEndedList.toListNoCopyNoClear(de_relations), ZeroCrossings.toList(sampleZCSet));
then (ZeroCrossings.toList(zeroCrossingsSet), ZeroCrossings.toList(de_relations), ZeroCrossings.toList(sampleZCSet));
end match;

// initialization stuff
Expand Down

0 comments on commit f476758

Please sign in to comment.