673 reputation
312
bio website people.su.se/~peal0658
location Sweden
age 27
visits member for 2 years, 2 months
seen Apr 15 at 16:27

Graduate student in mathematics. Languages: Java, C, C++, Mathematica, Php, HTML, CSS, LaTeX.

Interests in computer science: Fractals, genetic algorithms and AI programming.


Mar
28
comment Creating sculptural forms using graphics primitives
Thanks! Absolutely not, I was just a bit lazy to add it myself :)
Mar
16
comment Finding lags of time series with `Do`
Oh, L[t_]:=t-k; should most definitely work. But dont use capital letters as variable names, these might already be used by Mathematica, in any case, it is bad practice.
Mar
16
comment Finding lags of time series with `Do`
Oh, you want ListPlot[L/@Range[5,100]]
Mar
16
comment Finding lags of time series with `Do`
Hm, ok, well, I am not entirely sure what info you got, and what is unknown...
Mar
5
comment Generating Gelfand-Tsetlin patterns
@belisarius cf = Flatten[stuff,1] can be optimized to cf = Join@@(stuff).
Mar
5
comment Generating Gelfand-Tsetlin patterns
@IstvánZachar Are there any performance issues with Return? I read that it is a bit quirky, and is more "procedural" than "functional", so is it something to avoid in general?
Mar
5
comment Generating Gelfand-Tsetlin patterns
@IstvánZachar Oh, ok, is there a particular reason why one wish to avoid return? I am probalby just used to Java, so it feels easier to read in this manner.
Mar
5
comment Generating Gelfand-Tsetlin patterns
Wow, this is very efficient! How does the algorithm work? I took the liberty of adding an extra check in findPaths; looks like some corner cases mess up your code otherwise.
Mar
1
comment Dot shading a.k.a. Stippling effect
Ah, cool! I had some feeling I might have seen it somewhere, so yes, it is perhaps best to close this. Thanks!
Feb
25
comment Generating Gelfand-Tsetlin patterns
I have some other functionality that I have coded that does not exist in Sage. Besides, I am not sure, but I don't think Sage supports skew patterns, only "regular" ones.
Feb
21
comment Finding connected components in an array
Oh, I am looking forward to that post!
Feb
20
comment Finding connected components in an array
Looks interesting, I will try it out tomorrow :). Good performance there!
Feb
16
comment Finding connected components in an array
But, the arrays i am interested in, as in the example, all rows are weakly decreasing, and also the same holds for the two diagonals (in some directions)... this might affect which algorithm performs better...
Feb
16
comment Finding connected components in an array
I added onepts = #[[3]] & /@ weirdNeighbors[array]; tiles = First[#[[4 ;;]]] & /@ weirdNeighbors[array]; tiles = Join @@ tiles; onepts = List /@ (Join @@ onepts); Join[onepts, tiles];
Feb
16
comment Finding connected components in an array
Notice that I modified the accepted answer a bit. Can you please also account for turning your output into the specified form? I tied your code, and it is slower on my machine, (but then, I added code for changing the output.)
Feb
16
comment Finding connected components in an array
Ok, I modified it a bit, see the code in the bottom of the post. Thank you! Works like a charm!
Feb
16
comment Finding connected components in an array
I guess it suffices to add clusters = clusters /. {{r_Integer, c_Integer} :> If[OddQ[r + c], Sequence @@ {}, {r, (c - r)/2 + 1}]};
Feb
16
comment Finding connected components in an array
Looks nice! I can't really follow the code, but how do you make the output use the coordinates in l1? Your output also give coordinates to points which do not correspond to elements in l1... Is it possible to work in the native coordinates of l1, or should one simply "fix" your output somehow?
Feb
16
comment Finding connected components in an array
@Aky; What I mean is to imagine the array arranged in a rectangular pattern (which is how I represent these shapes internally). In THIS representation, then the rules I describe apply.
Feb
15
comment Finding connected components in an array
So yeah, it is sort of Morphological components, if you tilt your head 45 degrees left.