7
$\begingroup$

Bug introduced in 10.0 and fixed in 11.1


On Windows 10, 64 bit, version 11.0.1, my kernel just started crashing for no reason as for as I can see. Does/should the following crash your kernel?

sparse = SparseArray[ArrayRules[RandomInteger[{1, 10}, 20] // N]];
Fold[Partition, sparse, {2, 5}]

It crashes only when the sparse array is all nonzero (nonsparse), and when the entries are not _Integer, and when the sparse array is created by rules. I use the workaround Fold[Partition, Normal@sparse, {2, 5}], but I don't think Normal should need be there.

$\endgroup$
9
  • $\begingroup$ Crashes for me as well (same system configuration). $\endgroup$ Commented Feb 2, 2017 at 19:31
  • $\begingroup$ Crashed for me too (v11.0.1 on macOS Sierra). Good way to reset the In[]:= numbers, though ;-) $\endgroup$ Commented Feb 2, 2017 at 21:09
  • $\begingroup$ It's definitely not Fold: doing sp1 = Partition[sparse, 2]; Partition[sp1, 5] crashes the kernel for me (Mac OSX 10.5, M V10.0.1), but sp1 = Partition[sparse, 2] // Normal; Partition[sp1, 5] doesn't. So Partitioning the two-index SparseArray here is a problem. $\endgroup$ Commented Feb 2, 2017 at 21:12
  • $\begingroup$ But this works fine?! mat = N@RandomInteger[{1, 10}, {10, 2}]; Partition[SparseArray@mat, 5] $\endgroup$ Commented Feb 2, 2017 at 21:16
  • 4
    $\begingroup$ reported it. It's the second partition that does it. $\endgroup$ Commented Feb 3, 2017 at 2:04

1 Answer 1

4
$\begingroup$

This bug has been fixed in the just released Mathematica 11.1.

sparse = 
  SparseArray[ArrayRules[RandomInteger[{1, 10}, 20] // N]];
Fold[Partition, sparse, {2, 5}] // Head

(* SparseArray *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.