Commit e7f4fa4
committed
fix(math): preserve non-differenced dimension shape in diff for 2D arrays
When diff is applied to a 2D array and the number of differences (n)
exceeds the size of the operated dimension, the function previously
returned allocate(y(0, 0)), incorrectly collapsing both dimensions.
This fix preserves the size of the non-differenced dimension:
- dim=1: allocate(y(0, size(x, 2)))
- dim=2: allocate(y(size(x, 1), 0))1 parent ee33055 commit e7f4fa4
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
95 | 99 | | |
96 | 100 | | |
97 | 101 | | |
| |||
0 commit comments