62,247 reputation
6188280
bio website mathprogramming-intro.org
location St. Petersburg, Russia
age 38
visits member for 3 years
seen 15 mins ago

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


Feb
5
comment How to define a package without adding it to $ContextPath
@RolfMertig I think this is by design. But I am not the most knowledgable person with regard to these issues :)
Feb
5
answered How to define a package without adding it to $ContextPath
Feb
5
comment Position of a pattern-matched part of an expression
Have to really go to get some sleep now, will come back to it tomorrow. Looks somewhat similar to mine, as you mentioned, but the devil is in the details. Also, your code is more compact than mine. So,+1 for now, and more on this later.
Feb
4
comment Passing back “NaN`” and “Inf`” to C via MathLink
Sure - my comments were intended to be rather tangential to your question, since I don't know the answer to it.I seem to remember playing with these (Inf` etc) long time ago, and back then I decided to not use them, but I don't remember the reason alas.
Feb
4
comment Passing back “NaN`” and “Inf`” to C via MathLink
We decided to not include the reverse transfer for these quantites for the first version of RLink. If we get some feedback requesting it, we'll implement it in the future versions.
Feb
4
comment Passing back “NaN`” and “Inf`” to C via MathLink
But, the point is, we do support the transfer of these quantities from R to Mathematica. So, the recipe so far is simple: just don't send them back to R. I have a hard time coming up with something meaningful that R can do with those quantities if it receives them from Mathematica. The reverse is not necessariy true due to symbolic nature of Mathematica.
Feb
4
comment Passing back “NaN`” and “Inf`” to C via MathLink
FWIW, I did not yet implement sending such quantities to R via RLink, partly intentionally: can you envision any meaningful application of them on the "other side"?
Feb
4
comment Position of a pattern-matched part of an expression
@Rojo No problem. I am sure there are better solutions which just did not occur to me.
Feb
4
answered Position of a pattern-matched part of an expression
Feb
3
comment Initialization Time Out (Weighted Financial Data)
Sure, no problem.
Feb
3
comment Initialization Time Out (Weighted Financial Data)
Sure. Mu suggestion was anyway coming from general common sense and not necessarily taking into account your specific situation.
Feb
3
comment How do I find the Euclidean distance between one point and all the points in a list?
@OleksandrR. You are right. This explanation crossed my mind, but I was too lazy to test it :-)
Feb
2
comment How do I find the Euclidean distance between one point and all the points in a list?
@YvesKlett Actually, I was surprised but it does pretty well when used in Map - about 1.5 times slower than Sqrt[Total[(x1 - #)^2]] & only (so, obviously, also auto-compiled). I seem to remember testing it before and results were worse.
Feb
2
comment How do I find the Euclidean distance between one point and all the points in a list?
Also related
Feb
2
comment How do I find the Euclidean distance between one point and all the points in a list?
@PlatoManiac If efficiency is important, one can gain an order of magnitude speedup by using Sqrt[Total[(x1 - #)^2]] & /@ y1 instead, due to auto-compilation (EuclideanDistance is not compilable). Slightly faster still can be a vectorized solution like Sqrt[Total[(Transpose[y1] - x1)^2]].
Feb
2
comment Initialization Time Out (Weighted Financial Data)
First thing I'd do is to pay close attention to the reason of slow initialization. A quick guess is that this is due to FinancialData, so I'd start by caching it outside your Manipulate code if I were you.
Feb
2
comment Looking for “Longest Common Substring” solution
@OleksandrR. Thanks for trying it out, and comments! Regarding the quotes, I do have the corrected version, just have to put it here. Also, I really need to put this on GitHub. The real reason why I did not do all this yet is that I was working on a general code-sharing system for us, and it is almost ready, but I had almost zero time to work on it during the last month. Hopefully I will finish it very soon. As to the path to Java, thanks - this is a good suggestion. The problem is that most JREs do not come with javac (compiler) - WRI's JRE is non-standard in this respect.
Feb
1
comment MathLink C API: sending a List[] of so far unknown length
@rcollyer I generally dislike C++ (while I very much like C), but don't have much experience with it, so my words here don't weigh much. I can well imagine cases where it is appropriate however, perhaps including your suggestion.
Feb
1
comment MathLink C API: sending a List[] of so far unknown length
@rcollyer Ok, good point. In addition to what you suggested, one could create a data structure incorporating the link and the counter (a struct), and pass that one. This will however require one to also define new functions for putting various types on the link, which would increment the counter, so this is still some work.
Feb
1
comment MathLink C API: sending a List[] of so far unknown length
@rcollyer But why would one have to need it? Such a counter is easy to set up, if necessary, during putting pieces onto the link, seems to me.