Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
niklwors committed Aug 25, 2015
2 parents c3509db + b03469d commit b0af03a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions openmodelica/cppruntime/functionPointerTest.mos
Expand Up @@ -16,9 +16,10 @@ package FunctionPointer
function func
input Real u;
input Real v;
input Integer[:] w;
output Real y;
algorithm
y := u + v;
y := u + v + sum(w);
end func;

function feval
Expand All @@ -34,14 +35,14 @@ package FunctionPointer
input Real u;
output Real y;
algorithm
y := f(u) + feval(function func(v = u), u);
y := f(u) + feval(function func(v = u, w = {integer(u)}), u);
end feval2;

model Test
input Real u = 0; // prevent presolving
Real y;
equation
y = feval2(function func(v = 2), u + 1);
y = feval2(function func(v = 1, w = {2, 3}), u + 4);
end Test;
end FunctionPointer;
");
Expand All @@ -61,6 +62,6 @@ getErrorString();
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'FunctionPointer.Test', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = ""
// end SimulationResult;
// 5.0
// 22.0
// ""
// endResult

0 comments on commit b0af03a

Please sign in to comment.