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
{{ message }}
This repository was archived by the owner on May 18, 2019. It is now read-only.
The cat operator calls ExpressionSimplify.evalCat which has been
rewritten to be a higher-order function that allows you to perform
cat on any tree structure (to reduce maintenance effort).
Belonging to [master]:
- #2243
Error.assertion(j == max(listHead(d) for d in dimsLst), getInstanceName() +": cat got uneven dimensions for dim="+String(i) +" "+ExpressionDump.printExpStr(DAE.LIST(exps)), sourceInfo());
1652
+
Error.assertion(j == max(listHead(d) for d in dimsLst), getInstanceName() +": cat got uneven dimensions for dim="+String(i) +" "+stringDelimitList(list(toString(e) for e inexps), ", "), sourceInfo());
1638
1653
firstDims := j :: firstDims;
1639
1654
dimsLst := list(listRest(d) for d in dimsLst);
1640
1655
end for;
@@ -1658,33 +1673,42 @@ algorithm
1658
1673
end for;
1659
1674
// Convert the flat array structure to a tree array structure with the
1660
1675
// correct dimensions
1661
-
arr := arrayList(expArr);
1662
-
outExp :=Expression.listToArray(arr, listReverse(DAE.DIM_INTEGER(d) for d inreverseDims));
1676
+
outExps := arrayList(expArr);
1677
+
outDims := listReverse(reverseDims);
1663
1678
end evalCat;
1664
1679
1665
-
protected function evalCatGetFlatArray
1666
-
input DAE.Exp e;
1680
+
protected function evalCatGetFlatArray<Exp>
1681
+
input Exp e;
1667
1682
input Integer dim;
1668
-
output list<DAE.Exp> outExps={};
1683
+
input GetArrayContents getArrayContents;
1684
+
input ToString toString;
1685
+
output list<Exp> outExps={};
1669
1686
output list<Integer> outDims={};
1687
+
partial function GetArrayContents
1688
+
input Exp e;
1689
+
output list<Exp> es;
1690
+
end GetArrayContents;
1691
+
partial function ToString
1692
+
input Exp e;
1693
+
output String s;
1694
+
end ToString;
1670
1695
protected
1671
-
list<DAE.Exp> arr;
1696
+
list<Exp> arr;
1672
1697
list<Integer> dims;
1673
-
DAE.Type tp;
1674
1698
Integer i;
1675
1699
algorithm
1676
1700
if dim ==1 then
1677
-
outExps :=Expression.getArrayOrMatrixContents(e);
1701
+
outExps :=getArrayContents(e);
1678
1702
outDims := {listLength(outExps)};
1679
1703
return;
1680
1704
end if;
1681
1705
i :=0;
1682
-
for exp in listReverse(Expression.getArrayOrMatrixContents(e)) loop
0 commit comments