34,388 reputation
481209
bio website
location ND
age 29
visits member for 1 year, 4 months
seen 4 hours ago
stats profile views 3,154

contact details

Visit Mathematica.SE


Feb
27
comment Mathematica Fractals
Does this only happen when rendering the fractal or with any 3D graphics in Mathematica? Have you upgraded your graphics drivers to their latest version? If you haven't, it's something worth doing.
Feb
27
awarded  Nice Answer
Feb
27
awarded  Good Answer
Feb
27
comment Mathematica2tikz an equivalent function
@rcollyer Normal[] fixes GraphicsComplex. Now the difficult part will be styles I guess. It's not trivial to determine the style of each primitive in Mathematica.
Feb
27
comment Mathematica2tikz an equivalent function
@celtschk FullGraphics is pretty broken. It misplaces labels, renders grids completely differently, etc. It seems to have been an emulation of the real rendering which they failed to update recently ... Since you guys know TikZ, why don't you write an answer? Then I'll delete mine.
Feb
27
comment Mathematica2tikz an equivalent function
@rcollyer I suggested that because I assumed that the structure would not be completely equivalent, and it's much easier to do transformations in symbolic form (even just reorderings). So if there's an intermediate symbolic representation, it'll be easier to extend or modify. Otherwise one would always need to tinker with the string translation code. E.g. the example code didn't seem to have anything that directly corresponds to a line primitive. Instead it had a plot object (??).
Feb
27
comment Finding all elements within a certain range in a sorted list
@LeonidShifrin We should really start a site blog (please see the chat room). Would you like to volunteer for a couple of posts on these topics? I think it's better suited for a blog than answers.
Feb
27
comment How to compile effectively?
My point (just didn't have time to test it fully when I wrote the first comment) was that if we take cf = Compile[{{r, _Real, 1}}, Boole[1. < # < 10.] & /@ r], it compiles fine. But if we remove Boole, it does not (it calls back to MainEvaluate). It seems a compiled function can't return a vector of booleans, but Boole is an effective way to work around this. I have never thought of it this way before. (Of course this specific function is better vectorized, as in ruebenko's recent answer on my question, but it was just for illustration)
Feb
27
answered Mathematica2tikz an equivalent function
Feb
27
comment Finding all elements within a certain range in a sorted list
Now, for this particular solution: it is more than twice as fast the kguler's Map solution, and compilation is not really needed (it doesn't seem to influence the timing as everything is vectorized anyway), so types are not an issue. But in general I do wonder: isn't it maybe better to just let Mathematica auto-compile through Map or a similar function when we want a general function that works for several input types? Or is it possible to create a compiled function that will work for several input types (maybe it'll auto-select the correct version to run internally)?
Feb
27
comment Finding all elements within a certain range in a sorted list
One interesting thing about kguler's solution compared to this is that it will autos-specialize to the type of input. I only managed to get explicitly compiled solutions (like this one) working if I specified the type of the input (_Real or _Integer). When we let Map auto-compile, it seems to choose the correct one automatically. Of course in this particular situation using a function that works with reals will also work with integers (in practice). But if it is compiled specifically for integers, it will be faster on an integer vector.
Feb
27
comment Mathematica2tikz an equivalent function
Thanks, but by example I meant source code. What do you need to convert a Graphics expression into? How do you draw a curved line or axes with tikz?
Feb
27
comment Finding all elements within a certain range in a sorted list
It is really not so obvious why this is so fast. If you regularly use this pattern then could you include some additional explanations? Select is more natural here, but it's also much slower (due to unpacking?) Related: mathematica.stackexchange.com/a/11/12 and mathematica.stackexchange.com/q/1803/12
Feb
27
comment How to compile effectively?
I did not at first realize how essential the use of Boole was in this solution. The same thing could be more easily written using a Select, but that is much slower. It seems Boole allowed the auto-compilation to happen, or perhaps the speedup is only because Boole enabled packed arrays as you mentioned in your comment. Maybe it's worth investigating this further and including it in this answer of your, or perhaps here: mathematica.stackexchange.com/q/2/12
Feb
27
revised Finding all elements within a certain range in a sorted list
added 105 characters in body
Feb
27
revised Finding all elements within a certain range in a sorted list
added 603 characters in body
Feb
27
revised Finding all elements within a certain range in a sorted list
added 33 characters in body
Feb
27
revised Finding all elements within a certain range in a sorted list
added 3 characters in body
Feb
27
comment Mathematica2tikz an equivalent function
If you give some examples of what Tikz syntax looks like / what sort of output you desire, you might get more / better answers. I think many people will not reply only because they are not familiar with Tikz. Generating other representations from a Graphics object should usually be easy (but tedious).
Feb
27
comment Finding all elements within a certain range in a sorted list
I was always curious about how Nearest worked, and I don't know much about data structures, so I finally asked on SO.