Forum

Finding eaquals in subspreads with different bin size

okey this is one of the most complicated small problem i ever had:

you have two lists:

h x
1 3
1 6
1 50
2 4
2 50
2 51
2 53
3 2
3 4

How would a module look like that finds out if one of the x at h=1 also exists in one of the x at h=2 and if one of the x at h=2 does also exist at h=3? without iteration of course…

so it should return

0
0
1
1
0
0
0
0
0

because 50 is in h=1 and h=2 and 4 is in h=2 and h=3

so you basically would compare bin1 with bin2 and bin2 with bin3 and so on. but most of the time the bin size is different.

thinking about it for two days now ~ so ideas are welcome!

Sift node might help

i have a question depending your return, it should be like:

0
0
1
1
1
0
0
0
1

because all the values which existing in different bins are marked.

or do you want to have only the first occurence marked with a one?

i thin k i got it, but there is definitely a more elegant way… i used so many nodes…

findingequals.v4p (10.4 kB)

as i understand it, only the ones which exist in the next bin. i think writing a plugin would be the way to go.

otherwise its index and cross/combination mayhem… :)

thank you very much hrovac. this brings me further now. It’s only sorting out for the first occurrenc from there on. yes. Actually it is for highlighting connected points by a line with different alpha values and therefore the correct slices of the line segments has to be found.