# Array Comparison in Fortran 90/95

 Register Blogs Members List Search Today's Posts Mark Forums Read

 September 11, 2008, 10:50 Array Comparison in Fortran 90/95 #1 M Malik 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, 11:10 Re: Array Comparison in Fortran 90/95 #2 M Malik 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, 12:55 Re: Array Comparison in Fortran 90/95 #3 Jed 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, 13:41 Re: Array Comparison in Fortran 90/95 #4 M Malik 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, 14:14 Re: Array Comparison in Fortran 90/95 #5 Jed 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?

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post morteza08 Main CFD Forum 0 June 20, 2011 04:32 Mohan CFX 20 March 30, 2011 18:56 yfyap Main CFD Forum 20 November 2, 2008 22:57 CFD Student Main CFD Forum 0 May 10, 2008 07:59 Krishna Main CFD Forum 0 December 6, 2004 04:23

All times are GMT -4. The time now is 09:40.