Skip to content

Commit

Permalink
try to improve solveLinearSystem
Browse files Browse the repository at this point in the history
  • Loading branch information
Willi Braun authored and OpenModelica-Hudson committed Mar 22, 2016
1 parent de2cd14 commit c3889ed
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Compiler/BackEnd/ExpressionSolve.mo
Expand Up @@ -1773,6 +1773,7 @@ algorithm
DAE.ComponentRef cr;
DAE.Exp rhs;
DAE.Type tp;
Integer i;

// cr = (e1-e2)/(der(e1-e2,cr))
case (_,_,DAE.CREF(componentRef = cr))
Expand All @@ -1788,7 +1789,11 @@ algorithm
false = Expression.expHasCrefNoPreOrStart(dere, cr);
tp = Expression.typeof(inExp3);
(z,_) = Expression.makeZeroExpression(Expression.arrayDimension(tp));
((e,_)) = Expression.replaceExp(e, inExp3, z);
((e,i)) = Expression.replaceExp(e, inExp3, z);
// replace at least once, otherwise it's wrong
if i < 1 then
fail();
end if;
(e,_) = ExpressionSimplify.simplify(e);
rhs = Expression.negate(Expression.makeDiv(e,dere));
then
Expand Down

0 comments on commit c3889ed

Please sign in to comment.