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

Commit 2b8ffc9

Browse files
rfrankeOpenModelica-Hudson
authored andcommitted
Consider ADD_ARR and SUB_ARR when solving equations
Belonging to [master]: - #2768 - OpenModelica/OpenModelica-testsuite#1070
1 parent 3e8df38 commit 2b8ffc9

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Compiler/FrontEnd/Expression.mo

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2759,6 +2759,26 @@ algorithm
27592759
then
27602760
(resx,res);
27612761

2762+
case (DAE.BINARY(exp1 = e1,operator = DAE.ADD_ARR(),exp2 = e2))
2763+
equation
2764+
(fx1,f1) = allTermsForCref(e1, cr, inFunc);
2765+
(fx2,f2) = allTermsForCref(e2, cr, inFunc);
2766+
res = listAppend(f1, f2);
2767+
resx = listAppend(fx1, fx2);
2768+
then
2769+
(resx, res);
2770+
2771+
case (DAE.BINARY(exp1 = e1,operator = DAE.SUB_ARR(),exp2 = e2))
2772+
equation
2773+
(fx1,f1) = allTermsForCref(e1, cr, inFunc);
2774+
(fx2,f2) = allTermsForCref(e2, cr, inFunc);
2775+
f2 = List.map(f2, negate);
2776+
fx2 = List.map(fx2, negate);
2777+
res = listAppend(f1, f2);
2778+
resx = listAppend(fx1, fx2);
2779+
then
2780+
(resx,res);
2781+
27622782
// terms( a*(b+c)) => {a*b, c*b}
27632783
case (DAE.BINARY(e1,DAE.MUL(_),e2))
27642784
guard inFunc(e2,cr)

0 commit comments

Comments
 (0)