Skip to content

Commit

Permalink
- Linear equation systems are now allocated on stack instead of the m…
Browse files Browse the repository at this point in the history
…emory pool

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@9666 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Aug 22, 2011
1 parent d90df7d commit 793add8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Compiler/susan_codegen/SimCode/SimCodeC.tpl
Expand Up @@ -1653,8 +1653,9 @@ case SES_LINEAR(__) then
SIM_PROF_TICK_EQ(SIM_PROF_EQ_<%index%>);<%\n%>
#endif<%\n%>
>> %>
declare_matrix(<%aname%>, <%size%>, <%size%>);
declare_vector(<%bname%>, <%size%>);
/* Linear equation system */
double <%aname%>[<%intMul(listLength(vars),listLength(vars))%>] = {0};
double <%bname%>[<%size%>] = {0};
<%simJac |> (row, col, eq as SES_RESIDUAL(__)) =>
let &preExp = buffer "" /*BUFD*/
let expPart = daeExp(eq.exp, context, &preExp /*BUFC*/, &varDecls /*BUFD*/)
Expand Down Expand Up @@ -4062,6 +4063,7 @@ case STMT_NORETCALL(__) then




end algStmtNoretcall;


Expand Down
5 changes: 5 additions & 0 deletions Compiler/susan_codegen/SimCode/SimCodeTV.mo
Expand Up @@ -27,6 +27,11 @@ package builtin
output Integer c;
end intAdd;

function intMul
input Integer a;
input Integer b;
output Integer c;
end intMul;

function intDiv
input Integer a;
Expand Down

0 comments on commit 793add8

Please sign in to comment.