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.


Feb
22
asked Generating Gelfand-Tsetlin patterns
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
revised Finding connected components in an array
added 119 characters in body
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
accepted Finding connected components in an array
Feb
16
revised Finding connected components in an array
added modified solution
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
16
revised Finding connected components in an array
added example output
Feb
15
answered How to find integer solutions?
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.
Feb
15
comment Finding connected components in an array
Ok, added a better description i think.
Feb
15
revised Finding connected components in an array
added 1447 characters in body
Feb
15
comment Finding connected components in an array
Oh, and it feels a bit overkill/inefficient(?) to use connectedcomponents for graphs,
Feb
15
asked Finding connected components in an array