Commit 747c67f
committed
Resize buffers in
With this patch the output buffers to `sparse!` are resized in order to
satisfy the buffer length checks in the `SparseMatrixCSC` constructor
that were introduced in JuliaLang/julia#40523. Previously `csccolptr`
was never resized, and `cscrowval` and `cscnzval` were only resized if
the buffers were too short (i.e. never truncated).
The requirement `length(csccolptr) >= n + 1` could be kept, but seems
unnecessary since all buffers need to be resized anyway (to pass the
constructor checks).
In particular this fixes calling `sparse!` with `I`, `J`, `V` as both
input and output buffers: `sparse!(I, J, V, m, n, ..., I, J, V)`.
Fixes #313.
(cherry picked from commit 85a381b)sparse! to satisfy buffer checks in constructor (#314)1 parent 6811df2 commit 747c67f
File tree
2 files changed
+87
-6
lines changed- src
- test
2 files changed
+87
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1064 | 1064 | | |
1065 | 1065 | | |
1066 | 1066 | | |
1067 | | - | |
1068 | | - | |
1069 | | - | |
| 1067 | + | |
| 1068 | + | |
1070 | 1069 | | |
1071 | 1070 | | |
1072 | 1071 | | |
| |||
1077 | 1076 | | |
1078 | 1077 | | |
1079 | 1078 | | |
| 1079 | + | |
1080 | 1080 | | |
1081 | 1081 | | |
1082 | 1082 | | |
| |||
1131 | 1131 | | |
1132 | 1132 | | |
1133 | 1133 | | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
1134 | 1137 | | |
1135 | 1138 | | |
1136 | 1139 | | |
| |||
1175 | 1178 | | |
1176 | 1179 | | |
1177 | 1180 | | |
1178 | | - | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
1179 | 1185 | | |
1180 | | - | |
1181 | | - | |
| 1186 | + | |
| 1187 | + | |
1182 | 1188 | | |
1183 | 1189 | | |
1184 | 1190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1598 | 1598 | | |
1599 | 1599 | | |
1600 | 1600 | | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
1601 | 1676 | | |
0 commit comments