59,117 reputation
6176266
bio website mathprogramming-intro.org
location St. Petersburg, Russia
age 38
visits member for 2 years, 9 months
seen 16 mins ago

Ok, an obligatory note: opinions expressed here are mine and not those of my employer.


Oct
2
comment Evaluating arguments of module (inside compile)
@Jansen Glad I could help, thanks for the accept. Re: book - good to know that it is useful!
Oct
1
awarded  Great Answer
Oct
1
comment InstallR on OS X with external R installation on 10.0.1.0
Unfortunately, this will have to wait for a bit, can't spend any time on this probably until the weekend. Are you able to fall back to using 10.0.0 for your work with RLink, for the time being?
Oct
1
answered Where can I put my conditions?
Oct
1
comment Recursive partitioning: Is there a better way to do this?
@Tangshutao It is not really faster, but it avoids recursion.
Oct
1
comment Recursive partitioning: Is there a better way to do this?
@celtschk Shared variables (between the body and the condition) is a nice way to use the pattern-matcher, because it allows you to do some computation, and only then determine the fact of the match. If the condition doesn't hold, the pattern-matcher considers the rule not matched, pretending that those computations inside never happened. So, it will go on trying further rules, if the function has some more rules defined. I use this construct all the time.
Oct
1
comment Recursive partitioning: Is there a better way to do this?
@Tangshutao That's intentional. Have a closer look at the question as formulated by the OP.
Oct
1
comment Recursive partitioning: Is there a better way to do this?
@paw Well, it doesn't have the $RecursionLimit limitation, for one thing. The speed can't be very significantly improved simply because, for most actual use cases, the main time will be spent inside Partition, in both cases.
Oct
1
answered Recursive partitioning: Is there a better way to do this?
Sep
30
awarded  Explainer
Sep
30
awarded  Good Answer
Sep
29
comment InstallR on OS X with external R installation on 10.0.1.0
I'll have to check this. Will get back when I'm done, perhaps one or two days. We did check this before release, and it worked. So, I'll have to look closer and reproduce this. In the mean time, out of curiosity, try "RVersion"->"3.1.1" - which is what we used. If it works, please ping me here (it anyway looks like a bug, but it would be easier to localize). Thanks.
Sep
29
comment Temporal database reconstruction in mathematica
It would help if you provide some sample data, and a few sample specific queries you'd like to do, in addition to this general description. The set of sample queries would ideally cover the use cases you have in mind reasonably well. You are then more likely to get more people interested in answering.
Sep
29
comment InstallR on OS X with external R installation on 10.0.1.0
Yes, I forgot to mention, that "RVersion" option has not yet been documented (but neither has the use of RLink with external R on Mac OS X :)).
Sep
29
comment InstallR on OS X with external R installation on 10.0.1.0
This might be a bug (or, rather, the defaults not set quite right). What version of external R do you use? Generally, you can fix this by providing it explicitly, as indicated in the error message: try adding an explicit option "RVersion" -> "R-3.1.0", for example.
Sep
28
comment What is the recommended way to define numeric function with special cases?
@Jens Two reasons: it makes the code harder to extend (and actually, harder to read) and more error-prone when there are several branches (you would need nested If or Which), and also it tends to be somewhat slower (not by much). But, I'd agree that this is largely a matter of taste. Philosophically, the closer you are to the core language constructs, the better, and patterns / rules are certainly closer to the core than the If/Which statements, because the core of Mathematica is a term-rewriting engine.
Sep
28
comment What is the recommended way to define numeric function with special cases?
Use PieceWise, UnitStep and friends, if you want your function to integrate well with mathematical functionality such as simplifications, etc. Otherwise use rules. The If is inferior to both of those ways, in most cases.
Sep
26
awarded  scoping
Sep
25
comment Evaluating arguments of module (inside compile)
@Jansen Ok, the problem there was that on one hand, you want it to be partially evaluated, on another hand, Plus and Times are Listable, so one has to fight that during the partial computation of your expression. I didn't have the time to make the code pretty, but that part has now been corrected. At this point, it becomes clear that your problem is complex enough that a custom expression parser / code generator would be much cleaner than what I wrote. No time for this at the moment though. But I do realize that the code above can be hard to digest.
Sep
25
revised Evaluating arguments of module (inside compile)
Corrected to fight listability in Plus and Times