Skip to content

Commit

Permalink
+ Support for overloading of Modelica element-wise operators.
Browse files Browse the repository at this point in the history
  Now these are deduced from the scalar versions whenever necessary.
+ Normal operators can also be vectorized now if there is no other option.  
  That is: when there is no exact match found for operating on arrays but 
  there is/are some for corresponding scalars.
+ This is full support for operator overloading.
+ There are some deviations from the Specifications. 
  See comments in testsuite/records/OperatorOverloadComplexArray.mo and Static.mo 


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10975 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
mahge committed Jan 30, 2012
1 parent 03e55d5 commit de4f237
Show file tree
Hide file tree
Showing 3 changed files with 257 additions and 95 deletions.
14 changes: 7 additions & 7 deletions Compiler/FrontEnd/Dump.mo
Expand Up @@ -4845,13 +4845,13 @@ algorithm
case (Absyn.UMINUS()) then "-";
case (Absyn.UPLUS()) then "+";
/* element-wise arithmetic operators */
case (Absyn.ADD_EW()) then ".+";
case (Absyn.SUB_EW()) then ".-";
case (Absyn.MUL_EW()) then ".*";
case (Absyn.DIV_EW()) then "./";
case (Absyn.POW_EW()) then ".^";
case (Absyn.UMINUS_EW()) then ".-";
case (Absyn.UPLUS_EW()) then ".+";
case (Absyn.ADD_EW()) then "+";
case (Absyn.SUB_EW()) then "-";
case (Absyn.MUL_EW()) then "*";
case (Absyn.DIV_EW()) then "/";
case (Absyn.POW_EW()) then "^";
case (Absyn.UMINUS_EW()) then "-";
// case (Absyn.UPLUS_EW()) then "+";
/* logical operators */
case (Absyn.AND()) then "and";
case (Absyn.OR()) then "or";
Expand Down

0 comments on commit de4f237

Please sign in to comment.