Skip to content

Commit

Permalink
- Added test case for array expansion of outer parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
perost committed May 26, 2015
1 parent a9d51ea commit c798dca
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
33 changes: 33 additions & 0 deletions flattening/modelica/arrays/ArrayOuterParamExpand.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// name: ArrayOuterParamExpand
// keywords: array inner outer parameter
// status: correct
//
// Checks that outer parameters are expanded correctly.
//

model A
outer parameter Real[3] p1;
parameter Real[3] p2;
Real v;
equation
v = p1 * p2;
end A;

model ArrayOuterParamExpand
inner parameter Real[3] p1;
A a;
end ArrayOuterParamExpand;

// Result:
// class ArrayOuterParamExpand
// parameter Real p1[1];
// parameter Real p1[2];
// parameter Real p1[3];
// parameter Real a.p2[1];
// parameter Real a.p2[2];
// parameter Real a.p2[3];
// Real a.v;
// equation
// a.v = p1[1] * a.p2[1] + p1[2] * a.p2[2] + p1[3] * a.p2[3];
// end ArrayOuterParamExpand;
// endResult
1 change: 1 addition & 0 deletions flattening/modelica/arrays/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ ArrayMulMatrixSimplifier.mo \
ArrayMultiplication.mo \
ArrayMult.mo \
ArrayOperators.mo \
ArrayOuterParamExpand.mo \
ArrayRange.mo \
ArrayRecursiveDim1.mo \
ArrayReduce2.mo \
Expand Down

0 comments on commit c798dca

Please sign in to comment.