Reputation
68,493
Next tag badge:
211/100 score
19/20 answers
Badges
6 200 293
Newest
 Enlightened
Impact
~437k people reached

Mar
8
comment OpenCL Dot Product
The problem is that you can't do this directly using the out-of-the-box solution for a dot product, since GPU-s are directly helpful for massively parallel problems, while this one directly is not. What I would do is to glue all vectors you want to multiple into two large vectors, and pass them to GPU together with a list of lengths. Then, you will have to write your own custom thread scheduler, so that effectively a thread which is finished with one vector pair is rescheduled to another one. Should be doable, but some work. Besides, you need a really powerful GPU for all this to pay off.
Mar
7
comment Variant of the cutting-stock problem in Mathematica
@JacobAkkerboom Thanks. But keep in mind that the above function is not tail-recursive, and besides, tail-recursion in Mathematica has its own peculiarities
Mar
7
revised Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs
Added a more interesting example
Mar
7
comment Using ReadList and Skip to read a file with periodic alternation of useful and useless data
Alas, currently not an option for the files of ~ Gb size, see e.g. this discussion
Mar
7
revised Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs
edited tags
Mar
7
comment Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs
I modified the title because the problem you faced in an instance of a more general and quite important issue. But if you don't like the new one, please feel free to roll back.
Mar
6
comment Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs
@acl See if you like the new title I just made for it.
Mar
6
revised Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs
Made a title more general
Mar
6
comment Reading periodic elements from a large file
@s0rce If this is a problem still, you could read the file in chunks, requesting these chunks from Mathematica. This would need some Java code modification though.
Mar
6
comment Reading periodic elements from a large file
@s0rce Yes, Java heap space can be a problem. You can increase it by using command line parameters via "CommandLine" option in InstallJava (you will actually need to call ReinstallJava with the same option). You can read up on the web what the heap parameters should be, this is described in a million of places.
Mar
6
comment Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs
@Mr.Wizard No problem. This is an important topic, so sooner or later we had to cover it somewhere.
Mar
6
comment Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs
@ecoxlinux These renamings are excessive, it seems - and it is also mentioned in the docs. So, yes, it sees the conflict in the body but does renamings of function's variables.
Mar
6
comment Reading periodic elements from a large file
@s0rce Ok, see here
Mar
6
comment Reading periodic elements from a large file
@s0rce But why do you need to modify it at all? It has already a method getFloatColumn, and above there is an example of how to use it. All you have to do is to compute the offsets and total byte count of a row - and then just use it.
Mar
6
comment Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs
I hope it did not insult you that I changed your original post considerably. Please feel free to roll back if you don't like it.
Mar
6
comment Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs
@Szabolcs I did not really study the internal implementation, so all I can say about this has a status of an educated guess. I tried to describe this mechanism above, in my edit - see if you find this a satisfactory answer to your question.
Mar
6
comment Looking for “Longest Common Substring” solution
@s0rce Thanks for this input. I really have to set the time to fix this thing on all platforms. Hope to do this very soon.
Mar
6
revised Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs
Added some discussion on general mechanism of renaming
Mar
6
comment Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs
I think it is still not clear enough. Do you mind if I contribute to your answer?
Mar
6
comment Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs
@Szabolcs It is Module that we are trying to fool here, not Function, thus this behavior - see my comment below Mr.Wizard's answer.