Reputation
70,538
Next tag badge:
215/100 score
20/20 answers
Badges
7 212 301
Impact
~449k people reached

Mar
15
comment Time range selector à la InteractiveTradingChart
Mike Honeychurch has an interesting blog post about this.
Mar
15
awarded  Nice Answer
Mar
15
comment How to memoize a function with Options?
@Ryogi Glad I could help. Thanks for the accept.
Mar
14
comment How to memoize a function with Options?
@AlbertRetey Thanks :-). I use self-blocking from time to time, when I want to avoid tedious passing of some arguments. Basically, a function blocks itself inside its external call, then defines itself there inside Block, and then executes. This allows me to embed those arguments which don't change,right to the body of those definitions, so they can be simpler. But, as I said, here we have an extra bonus of global access to all OptionValue-s (one - arg "magical" form of them) across the execution stack, which seems pretty neat to me.
Mar
14
comment How to memoize a function with Options?
@AlbertRetey But this is the first problem I have seen where the self-blocking technique brings more than just convenience to not pass some arguments explicitly - here also one can globally call single-argument OptionValue across the full recursive execution stack. I think this is pretty cool.
Mar
14
comment How to memoize a function with Options?
@AlbertRetey Oh, come on :-)
Mar
14
revised How to memoize a function with Options?
added 259 characters in body
Mar
14
comment How to memoize a function with Options?
@Ryogi Your biggest problem was that you did not pass options down to recursive calls, but you used the option in the memoized part as cfibon[n, k -> OptionValue[k]] = ..., so your memoized definitions were actually never used.
Mar
14
comment How to memoize a function with Options?
@AlbertRetey See my update with a meta-programming code - it takes care of that as well (as of many other things).
Mar
14
revised How to memoize a function with Options?
Added a general and more optimal metaprogramming-based solution
Mar
14
answered How to memoize a function with Options?
Mar
14
comment Unwanted hold in recursive function
The problem you have is because Thread evaluates its arguments, which leads to the picture described by @OleksandrR. This will work: F[mat_] := If[mat[[0]] === List, Thread[Unevaluated@F[mat]], f[mat]].
Mar
14
answered How to efficiently find positions of duplicates?
Mar
14
comment High quantum harmonic eigenfunctions?
You have to compute the functions on numbers of that precision. So, if you want to use Plot, you may need some tricks like N[Rationalize[x],30] instead of x in your function (or whatever precision you want to set). This will however slow things down considerably. You could also use interpolation on some fine grid, and then plot that interpolated function, I guess.
Mar
14
comment High quantum harmonic eigenfunctions?
At some point, you may actually be better off, in terms of computations, by using the WKB - approximated functions, for large values of the quantum number (where WKB works quite well).
Mar
14
comment High quantum harmonic eigenfunctions?
But that's what I mean: those oscillations are constructed by a high-degree polynomial plus the exponent - so the right oscillatory behavior is a result of non-trivial cancellation of individual terms in the polynomials (and exponent), which are quite large for large x.
Mar
14
comment High quantum harmonic eigenfunctions?
Also, it would be best to include complete self-contained examples, so that we don't have to guess what your real problem is.
Mar
14
comment High quantum harmonic eigenfunctions?
Chances are that you get into trouble using machine precision, since for higher eigenfunctions massive cancellations of large quantities lead to accumulation of errors. Try to increase the precision, and, generally, work at fixed precision - then Mathematica will track the precision for you and you will see how reliable your results are.
Mar
14
comment How can I get Mathematica to recognize the documentation for a newly installed package?
I would recommend to use the Workbench to build the documentation, for the package you want to install. The relevant Workbench documentation contains a description of how you do this. This is a fairly automatic process by itself, but the biggest issue will possibly be that the format of the documentation files changed in version 6, so you may have to use Documentation Tools palette to create new documentation files based on old ones. I am not sure if there are any automatic conversion tools for this task.
Mar
14
comment Running out of memory when filtering a large data set
If your expression is very large, it may make sense to have some serialization mechanism, so that its parts can be read separately. In general, doing this in chunks, similar to what was suggested by Mr.Wizard, on in my linked answer, seems to be the way to go.