Arrays Intersection



Hi All,

I have received so many nice answers in this newsgroup that I
thought I could ask one more question. I am trying to find the
intersection of 2 one-dimensional integer arrays, where "intersection"
means the common elements in both arrays, i.e.:

a = [1,2,3,4,5,6]
b = [5, 6, 7]

intersection(a, b) ==> [5, 6]

At the moment I am working with Python, which handles very well sets,
lists and structures for which it's easy to define an "intersection",
but as I have many many arrays to compare, this is becoming a bit slow
so I thought to use fortran. Unfortunately, my google-fu failed me as
I couldn't find anything related to "array intersection" in Fortran.

Does anyone know what I should do in order to achieve a fast solution
to this problem?

Thank you very much for your suggestions.

Andrea.
.



Relevant Pages