Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 2
    $\begingroup$ This question might be useful $\endgroup$ Commented Jun 27, 2012 at 9:12
  • $\begingroup$ This discussion may also be relevant. $\endgroup$ Commented Jun 27, 2012 at 9:39
  • 1
    $\begingroup$ @Mr.Wizard Yes, I can. But then, have a look at the listSplit function in my third post here :-) $\endgroup$ Commented Jun 27, 2012 at 9:56
  • 2
    $\begingroup$ @Mr.Wizard dynP is about 40-50 % faster on my test: test = Flatten[Range /@ Range[5000]];, and then dynP[test, Range[5000]], and similarly for the internal function. $\endgroup$ Commented Jun 27, 2012 at 10:08
  • 1
    $\begingroup$ @Mr.Wizard But, if we convert test to packed array with Developer`ToPackedArray, then the internal function is a little faster. I would generally mention in your answer that for packed arrays, your function creates a ragged list where however all sublists remain packed (because Part does not unpack). This allows for much faster execution and vastly more efficient storage as well, even though the resulting array is ragged. $\endgroup$ Commented Jun 27, 2012 at 10:29