|
[Sponsors] |
September 11, 2008, 11:50 |
Array Comparison in Fortran 90/95
|
#1 |
Guest
Posts: n/a
|
Hi FORTRAN 90/95 Users: Want to know some efficient way of comparing two or more large size arrays in FORTRAN 90/95. Thanks
|
|
September 11, 2008, 12:10 |
Re: Array Comparison in Fortran 90/95
|
#2 |
Guest
Posts: n/a
|
To be a little more specific: The arrays could be of different lengths and want to compare them for duplication. -Malik
|
|
September 11, 2008, 13:55 |
Re: Array Comparison in Fortran 90/95
|
#3 |
Guest
Posts: n/a
|
Oh, they are integer arrays representing sets? You want to determine what integers appear in both arrays? If the range of possible values is known and reasonable, you can mask a bit-array. Otherwise, just sort the arrays.
|
|
September 11, 2008, 14:41 |
Re: Array Comparison in Fortran 90/95
|
#4 |
Guest
Posts: n/a
|
Thanks Jed. Yes, I have integer arrays. The range is not known all the time. Comparison by sorting turns out to be very time consuming. Some other suggestion, please!
|
|
September 11, 2008, 15:14 |
Re: Array Comparison in Fortran 90/95
|
#5 |
Guest
Posts: n/a
|
Keep the arrays sorted or partially sorted. If you don't sort, you end up with O(n^2) which is much worse. A radix sort shouldn't be that bad. Where do these arrays come from? How big are they? I assume you solve equations at some point? Or is this for mesh manipulation? Would a different data structure be better?
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
An unknown array definition in fortran | morteza08 | Main CFD Forum | 0 | June 20, 2011 05:32 |
CFX11 + Fortran compiler ? | Mohan | CFX | 20 | March 30, 2011 19:56 |
largest one-dimensional array in fortran 77 | yfyap | Main CFD Forum | 20 | November 2, 2008 22:57 |
Compaq Visual Fortran - array, debug | CFD Student | Main CFD Forum | 0 | May 10, 2008 08:59 |
Array Visualizer in Visual Fortran | Krishna | Main CFD Forum | 0 | December 6, 2004 04:23 |