Skip to main content
18 events
when toggle format what by license comment
Apr 13, 2017 at 12:55 history edited CommunityBot
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Dec 1, 2012 at 5:44 history edited Mechanical snail
edited tags
Apr 26, 2012 at 2:57 vote accept rcollyer
Apr 26, 2012 at 2:56 history edited rcollyer CC BY-SA 3.0
added update
Apr 23, 2012 at 19:05 comment added Leonid Shifrin @rcollyer Ok, I see.
Apr 23, 2012 at 18:30 comment added rcollyer @LeonidShifrin well, I was going to overload the function with treeInsert[tree_, DirectedInfinity[d_]] and set a flag that can be handled later. It would still involve processing the elements one at a time, as opposed to within a compiled for loop, and would likely have to involve Internal`Bag instead of a List.
Apr 23, 2012 at 18:24 comment added Leonid Shifrin @rcollyer I see. But if the problem is only about infinities, then, since the resulting list will be sorted, they can only be the first and last elements of the resulting list, if present. What I usually do is to replace them temporarily with Min[list]-1 and Max[list]+1, then use Compile, then replace back. This way, you can keep it almost as fast as without infinities.
Apr 23, 2012 at 18:22 comment added rcollyer @LeonidShifrin I did see that answer, and I like it a lot. Unfortunately, $\pm\infty$ is not a real number, so it would have to be dealt with separately. However, I was thinking along those lines when it occurred to me that I did not know of a way to adapt memoization to this particular solution.
Apr 23, 2012 at 18:16 comment added Leonid Shifrin This does not use memoization, but have you seen this answer? It is quite fast (being compiled), and along the same lines as what you discuss.
Apr 23, 2012 at 17:10 history tweeted twitter.com/#!/StackMma/status/194473311978266624
Apr 23, 2012 at 16:21 history edited rcollyer CC BY-SA 3.0
added minor speed up
Apr 23, 2012 at 16:07 answer added Rojo timeline score: 10
Apr 23, 2012 at 15:12 answer added Pillsy timeline score: 8
Apr 23, 2012 at 14:59 answer added user21 timeline score: 7
Apr 23, 2012 at 14:42 comment added rcollyer @ruebenko no it didn't. Posted it before I finished the thought, apparently. It's fixed, now.
Apr 23, 2012 at 14:42 history edited rcollyer CC BY-SA 3.0
added 95 characters in body
Apr 23, 2012 at 14:41 comment added user21 I think the Scan[(tr= part of the post did not make it onto the page.
Apr 23, 2012 at 14:33 history asked rcollyer CC BY-SA 3.0