You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[NB] introduce inlining of array constructors (#13035)
* [NB] introduce inlining of array constructors
* [NB] fix inlining of record constructors
- use correct equation and not auxiliary variable index
- update how nesting is handled
- dumping updates for equations
* [NB] small fix
Copy file name to clipboardExpand all lines: OMCompiler/Compiler/NBackEnd/Classes/NBEquation.mo
+23-3Lines changed: 23 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -157,6 +157,20 @@ public
157
157
end if;
158
158
end fromFrames;
159
159
160
+
function addFrames
161
+
input output Iterator iter;
162
+
input list<Frame> frames;
163
+
protected
164
+
list<ComponentRef> names1, names2;
165
+
list<Expression> ranges1, ranges2;
166
+
algorithm
167
+
ifnot listEmpty(frames) then
168
+
(names1, ranges1) := getFrames(iter);
169
+
(names2, ranges2) :=List.unzip(frames);
170
+
iter := fromFrames(List.zip(listAppend(names1, names2), listAppend(ranges1, ranges2)));
171
+
end if;
172
+
end addFrames;
173
+
160
174
function getFrames
161
175
input Iterator iter;
162
176
output list<ComponentRef> names;
@@ -855,8 +869,12 @@ public
855
869
protected
856
870
Pointer<Variable> residualVar;
857
871
algorithm
858
-
residualVar := getResidualVar(eqn);
859
-
name :=BVariable.getVarName(residualVar);
872
+
if isDummy(Pointer.access(eqn)) then
873
+
name :=ComponentRef.EMPTY();
874
+
else
875
+
residualVar := getResidualVar(eqn);
876
+
name :=BVariable.getVarName(residualVar);
877
+
end if;
860
878
end getEqnName;
861
879
862
880
function getResidualVar
@@ -3646,7 +3664,9 @@ public
3646
3664
new_eq :=func(eq);
3647
3665
ifnot referenceEq(eq, new_eq) then
3648
3666
// Do not update the expandable array entry, but the pointer itself
3649
-
ifdebugandUnorderedSet.contains(ComponentRef.toString(Equation.getEqnName(eq_ptr)), debug_eqns) andnotEquation.equalName(Pointer.create(eq), Pointer.create(new_eq)) then
0 commit comments