532 reputation
111
bio website
location
age
visits member for 1 year, 10 months
seen Oct 21 at 17:03

Jul
15
comment How can I define a 3D version of the built-in VoronoiDiagram (VoronoiMesh in V10) function?
The free package Voro++ does all the tricks, but it is in C++. This package is used in LAMMPS (Large-scale Atomic/Molecular Massively Parallel Simulator) math.lbl.gov/voro++
Jul
2
awarded  Curious
Jun
23
comment How can I create a function with optional arguments and options?
@AndyRoss, as to your nr = x_/;!OptionQ[x], according to The Standard Evaluation Procedure, in f[x_,y:nr:2,z:nr:3,OptionsPattern[]]:=..., the patterns x_,y:nr:2,z:nr:3,OptionsPattern[] will firstly be evaluated in order. If any of the y or z Condition fails then the entire definition of f will be considered unmatched and the follwing SetDelayed will not be applied. As a result, if we call f[1,"g"->(#^2&)] then the "g"->(#^2&) will firstly be checked with the y:nr:2 which yields unmatch.
May
28
comment Extracting graphics primitives from a Graphics expression with ReplaceAll
Throw, Catch, Sow, and Reap can be used almost anywhere in any code, such powerful attribute might also be heavily used in the built-in code of Trace, and I think they are at very fundamental level of Mathematica language.
May
28
comment Extracting graphics primitives from a Graphics expression with ReplaceAll
Concise and enlightening, you have my gratitude!
May
28
accepted Extracting graphics primitives from a Graphics expression with ReplaceAll
May
28
comment Extracting graphics primitives from a Graphics expression with ReplaceAll
@rcollyer, From the result point of view, your parser partly resembles the combination of Extract and Position. I like it, because it is a beautiful attack to reveal the internal of Mathematica, to some extent. This is very useful to me, thank you.
May
28
comment Extracting graphics primitives from a Graphics expression with ReplaceAll
@Szabolcs, I intuitively agree with you about your insight on Cases and ReplaceAll. Although they all follow the standard evaluation procedure of Mathematica - each expression is evaluated until no further definitions apply - they may be controlled differently by kernel. It is a pity that there is little talk about the internal algorithm. I believe that my question can be solved by using a similiar code like the built-in code for Trace which has very amazing capabilities with various options, like TraceAbove and TraceOriginal.
May
27
comment Extracting graphics primitives from a Graphics expression with ReplaceAll
@mfvonh, Any insight is welcome, because I am trying to get sharper understanding of Mathematica...
May
27
comment Extracting graphics primitives from a Graphics expression with ReplaceAll
@Jacob Akkerboom, Thank you in advance.
May
27
comment Extracting graphics primitives from a Graphics expression with ReplaceAll
@Kuba, thanks, your code is a third way to get the points. But it highly exploits the built-in functions of Mathematica, like Cases. I am looking for a way to do this using simple pattern matching only with ReplaceAll.
May
27
comment Extracting graphics primitives from a Graphics expression with ReplaceAll
@mfvonh, Yes, this could be enlightening.
May
27
comment Extracting graphics primitives from a Graphics expression with ReplaceAll
For the first step, we can just try to pick out the discrete point data from plt, using pattern matching.
May
27
asked Extracting graphics primitives from a Graphics expression with ReplaceAll
May
1
revised Performance tuning - Explicitly set Mathematica use Nvidia GPU for rendering
added 119 characters in body
Apr
30
comment Performance tuning - Explicitly set Mathematica use Nvidia GPU for rendering
@Szabolcs, That would probably be a computer with AMD GPU, which can be manually switched on/off wth its Dynamic Switchable Graphics technique. There is no way to do this with Nvidia GPU due to the Optimus technique, cause Nvidia and AMD perfer to be different from each other. Sigh...
Apr
29
revised Performance tuning - Explicitly set Mathematica use Nvidia GPU for rendering
deleted 36 characters in body; edited title
Apr
29
comment Performance tuning - Explicitly set Mathematica use Nvidia GPU for rendering
@rasher, As Rom38 said, I already did this but it had no effect. The very easy way to see if Nvidia GPU is running is to use the GPU meter, addgadgets.com/gpu_meter
Apr
29
revised Performance tuning - Explicitly set Mathematica use Nvidia GPU for rendering
edited body
Apr
29
comment Performance tuning - Explicitly set Mathematica use Nvidia GPU for rendering
@Yves Klett, Configuration posted. On my machine the performance is always bad no matter using battery or not.