Skip to content

Commit

Permalink
fix for smooth in cpp template
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@17955 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
niklwors committed Oct 31, 2013
1 parent 49a08e6 commit ea663ef
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -5047,6 +5047,9 @@ end daeExpRange;






template daeExpReduction(Exp exp, Context context, Text &preExp /*BUFP*/,
Text &varDecls /*BUFP*/,SimCode simCode)
"Generates code for a reduction expression. The code is quite messy because it handles all
Expand Down Expand Up @@ -5301,6 +5304,9 @@ end daeExpArray;






//template daeExpAsub(Exp exp, Context context, Text &preExp /*BUFP*/,
// Text &varDecls /*BUFP*/,SimCode simCode)
// "Generates code for an asub expression."
Expand Down Expand Up @@ -5687,13 +5693,16 @@ template daeExpCall(Exp call, Context context, Text &preExp /*BUFP*/,
'<%retVar%>'
case CALL(path=IDENT(name="smooth"),
expLst={e1,e2},attr=attr as CALL_ATTR(__)) then
let argStr = (expLst |> exp => '<%daeExp(exp, context, &preExp /*BUFC*/, &varDecls /*BUFD*/,simCode)%>' ;separator=", ")
/*let argStr = (expLst |> exp => '<%daeExp(exp, context, &preExp /*BUFC*/, &varDecls /*BUFD*/,simCode)%>' ;separator=", ")

let retType = expTypeShort(attr.ty)
let retVar = tempDecl(retType, &varDecls /*BUFD*/)
let &preExp += '<%retVar%> = smooth(<%argStr%>);<%\n%>'
'<%retVar%>'

*/
let var1 = daeExp(e1, context, &preExp, &varDecls,simCode)
let var2 = daeExp(e2, context, &preExp, &varDecls,simCode)
'<%var2%>'
case CALL(path=IDENT(name="exp"),
expLst={e1},attr=attr as CALL_ATTR(__)) then
let argStr = (expLst |> exp => '<%daeExp(exp, context, &preExp /*BUFC*/, &varDecls /*BUFD*/,simCode)%>' ;separator=", ")
Expand Down

0 comments on commit ea663ef

Please sign in to comment.