Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
[NF] Update tests.
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - OpenModelica/OMCompiler#2731
  - #1055
  • Loading branch information
perost authored and OpenModelica-Hudson committed Oct 19, 2018
1 parent 54b3544 commit 13d784a
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions flattening/modelica/scodeinst/End3.mo
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ model End3
Real y = last(x);
end End3;


// Result:
// function last
// input Real[:] x;
Expand All @@ -29,9 +30,8 @@ end End3;
// Real x[1];
// Real x[2];
// Real x[3];
// Real y = last(x);
// Real y = last({x[1], x[2], x[3]});
// equation
// x = {1.0, 2.0, 3.0};
// end End3;
// endResult

2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/EqualityConstraint1.mo
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ end EqualityConstraint1;
// Real oc2[2];
// Real oc2[3];
// equation
// OC.equalityConstraint(oc1, oc2);
// OC.equalityConstraint({oc1[1], oc1[2], oc1[3]}, {oc2[1], oc2[2], oc2[3]});
// end EqualityConstraint1;
// endResult
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/FuncBuiltinScalar2.mo
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ end FuncBuiltinScalar2;
//
// class FuncBuiltinScalar2
// Real x[1];
// Real y = FuncBuiltinScalar2.f(x);
// Real y = FuncBuiltinScalar2.f({x[1]});
// equation
// x = {1.0};
// end FuncBuiltinScalar2;
Expand Down
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/FuncUnknownDim1.mo
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ end FuncUnknownDim1;
// Real x[2];
// Real x[3];
// equation
// f(x);
// f({x[1], x[2], x[3]});
// end FuncUnknownDim1;
// endResult
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/FuncVectorization2.mo
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ end FuncVectorization2;
// Integer g[2,2];
// Integer g[2,3];
// equation
// g = array(FuncVectorization2.F(b[$i1,$i2], 1) for $i2 in 1:3, $i1 in 1:2);
// g = array(FuncVectorization2.F({b[$i1,$i2,1], b[$i1,$i2,2], b[$i1,$i2,3], b[$i1,$i2,4]}, 1) for $i2 in 1:3, $i1 in 1:2);
// end FuncVectorization2;
// endResult
6 changes: 3 additions & 3 deletions flattening/modelica/scodeinst/FuncVectorizationMap1.mo
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ end FuncVectorizationMap1;
// Real g[2,2];
// Real g[2,3];
// equation
// g = array(FuncVectorizationMap1.F(b[$i1,$i2], 1.0) for $i2 in 1:3, $i1 in 1:2);
// g = array(array(FuncVectorizationMap1.F(b[i,$i1], 1.0) for $i1 in 1:3) for i in 1:2);
// g = array(FuncVectorizationMap1.F(b[i,j], 1.0) for j in 1:3, i in 1:2);
// g = array(FuncVectorizationMap1.F({b[$i1,$i2,1], b[$i1,$i2,2], b[$i1,$i2,3], b[$i1,$i2,4]}, 1.0) for $i2 in 1:3, $i1 in 1:2);
// g = array(array(FuncVectorizationMap1.F({b[i,$i1,1], b[i,$i1,2], b[i,$i1,3], b[i,$i1,4]}, 1.0) for $i1 in 1:3) for i in 1:2);
// g = array(FuncVectorizationMap1.F({b[i,j,1], b[i,j,2], b[i,j,3], b[i,j,4]}, 1.0) for j in 1:3, i in 1:2);
// end FuncVectorizationMap1;
// endResult
4 changes: 2 additions & 2 deletions flattening/modelica/scodeinst/OperatorOverloadComplex.mo
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ end OperatorOverloadComplex;
// c6 = Complex.'*'.multiply(c5, c4);
// c7 = Complex.'-'.subtract(Complex.'+'(Complex.'*'.multiply(Complex.'*'.multiply(Complex.'/'(c6, c5), Complex.'^'(c4, c3)), Complex.'constructor'.fromReal(1.0, 0.0)), c2), c1);
// c8 = Complex.'0'();
// ca1 = Complex.'-'.negateArr(ca2);
// c1 = Complex.'*'.scalarProduct(ca2, ca3);
// ca1 = Complex.'-'.negateArr({ca2[1], ca2[2], ca2[3]});
// c1 = Complex.'*'.scalarProduct({ca2[1], ca2[2], ca2[3]}, {ca3[1], ca3[2], ca3[3]});
// end OperatorOverloadComplex;
// endResult
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/Subscript5.mo
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ end Subscript5;
// Real x[3,1];
// Real x[3,2];
// Real x[3,3];
// Real y = f(x, x);
// Real y = f({{x[1,1], x[1,2], x[1,3]}, {x[2,1], x[2,2], x[2,3]}, {x[3,1], x[3,2], x[3,3]}}, {{x[1,1], x[1,2], x[1,3]}, {x[2,1], x[2,2], x[2,3]}, {x[3,1], x[3,2], x[3,3]}});
// equation
// x = {{time, 1.0, 2.0}, {3.0, 4.0, 5.0}, {6.0, 7.0, 8.0}};
// end Subscript5;
Expand Down
14 changes: 7 additions & 7 deletions flattening/modelica/scodeinst/TestSampleNoClock.mos
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ instantiateModel(Modelica.Blocks.Examples.BooleanNetwork1); getErrorString();
// pre(triggeredAdd.y) = triggeredAdd.y_start;
// pre(rSFlipFlop.pre.u) = rSFlipFlop.pre.pre_u_start;
// initial algorithm
// (booleanTable.index, booleanTable.nextTime, booleanTable.y) := Modelica.Blocks.Sources.BooleanTable.getFirstIndex(booleanTable.table, time, booleanTable.startValue);
// (booleanTable.index, booleanTable.nextTime, booleanTable.y) := Modelica.Blocks.Sources.BooleanTable.getFirstIndex({booleanTable.table[1], booleanTable.table[2], booleanTable.table[3], booleanTable.table[4], booleanTable.table[5], booleanTable.table[6], booleanTable.table[7]}, time, booleanTable.startValue);
// equation
// showValue.activePort = showValue.showActive;
// showValue2.activePort = showValue2.showActive;
Expand Down Expand Up @@ -294,7 +294,7 @@ instantiateModel(Modelica.Blocks.Examples.BooleanNetwork1); getErrorString();
// onDelay.y = showValue6.activePort;
// sampleTriggerSet.y = rSFlipFlop.S;
// sampleTriggerReset.y = rSFlipFlop.R;
// and1.y = Modelica.Math.BooleanVectors.allTrue(and1.u);
// and1.y = Modelica.Math.BooleanVectors.allTrue({and1.u[1], and1.u[2], and1.u[3]});
// when sample(booleanPulse1.startTime, booleanPulse1.period) then
// booleanPulse1.pulsStart = time;
// end when;
Expand All @@ -304,10 +304,10 @@ instantiateModel(Modelica.Blocks.Examples.BooleanNetwork1); getErrorString();
// end when;
// booleanPulse2.y = time >= booleanPulse2.pulsStart and time < booleanPulse2.pulsStart + booleanPulse2.Twidth;
// booleanStep.y = if time >= booleanStep.startTime then not booleanStep.startValue else booleanStep.startValue;
// or1.y = Modelica.Math.BooleanVectors.anyTrue(or1.u);
// xor1.y = Modelica.Math.BooleanVectors.oneTrue(xor1.u);
// nand1.y = not Modelica.Math.BooleanVectors.allTrue(nand1.u);
// or2.y = not Modelica.Math.BooleanVectors.anyTrue(or2.u);
// or1.y = Modelica.Math.BooleanVectors.anyTrue({or1.u[1], or1.u[2]});
// xor1.y = Modelica.Math.BooleanVectors.oneTrue({xor1.u[1], xor1.u[2]});
// nand1.y = not Modelica.Math.BooleanVectors.allTrue({nand1.u[1], nand1.u[2]});
// or2.y = not Modelica.Math.BooleanVectors.anyTrue({or2.u[1], or2.u[2]});
// nor1.y = not nor1.u;
// if onDelay.delaySignal then
// onDelay.y = time >= onDelay.t_next;
Expand All @@ -316,7 +316,7 @@ instantiateModel(Modelica.Blocks.Examples.BooleanNetwork1); getErrorString();
// end if;
// rising.y = edge(rising.u);
// set1.expr = {false, true};
// set1.firstActiveIndex = Modelica.Math.BooleanVectors.firstTrueIndex(set1.u);
// set1.firstActiveIndex = Modelica.Math.BooleanVectors.firstTrueIndex({set1.u[1], set1.u[2]});
// set1.y = if set1.firstActiveIndex == 0 then if set1.use_pre_as_default then pre(set1.y) else set1.y_default else set1.expr[set1.firstActiveIndex];
// falling.y = edge(falling.not_u);
// changing.y = change(changing.u);
Expand Down

0 comments on commit 13d784a

Please sign in to comment.