Skip to content

Commit

Permalink
- added function Expression.isNotComplex and ComponentReference.crefI…
Browse files Browse the repository at this point in the history
…nLst

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@19909 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Volker Waurich committed Apr 1, 2014
1 parent 3f9172d commit b7260c7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Compiler/FrontEnd/ComponentReference.mo
Expand Up @@ -893,6 +893,14 @@ algorithm
outBoolean := crefEqualNoStringCompare(inComponentRef1,inComponentRef2);
end crefEqual;

public function crefInLst "returns true if the cref is in the list of crefs"
input DAE.ComponentRef cref;
input list<DAE.ComponentRef> lst;
output Boolean b;
algorithm
b := List.isMemberOnTrue(cref,lst,crefEqual);
end crefInLst;

public function crefEqualVerySlowStringCompareDoNotUse
"Returns true if two component references are equal,
comparing strings in no other solution is found"
Expand Down
21 changes: 21 additions & 0 deletions Compiler/FrontEnd/Expression.mo
Expand Up @@ -8385,6 +8385,27 @@ algorithm
end match;
end isRecordType;

public function isNotComplex "returns true if the exp is 1-dimensional"
input DAE.Exp e;
output Boolean b;
algorithm
b := match(e)
local
case(DAE.CALL(path=_,expLst=_,attr=_))
then
false;
case(DAE.RECORD(path=_,exps=_, comp=_,ty=_))
then
false;
case(DAE.ARRAY(ty=_,scalar=_,array=_))
then
false;
else
then
true;
end match;
end isNotComplex;

public function isRealType
"Return true if the type is Real."
input DAE.Type inType;
Expand Down

0 comments on commit b7260c7

Please sign in to comment.