CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Main CFD Forum

Array Comparison in Fortran 90/95

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 11, 2008, 10:50
Default 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
  Reply With Quote

Old   September 11, 2008, 11:10
Default 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
  Reply With Quote

Old   September 11, 2008, 12:55
Default 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.
  Reply With Quote

Old   September 11, 2008, 13:41
Default 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!
  Reply With Quote

Old   September 11, 2008, 14:14
Default 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?
  Reply With Quote

Reply

Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
An unknown array definition in fortran morteza08 Main CFD Forum 0 June 20, 2011 04:32
CFX11 + Fortran compiler ? Mohan CFX 20 March 30, 2011 18:56
largest one-dimensional array in fortran 77 yfyap Main CFD Forum 20 November 2, 2008 21:57
Compaq Visual Fortran - array, debug CFD Student Main CFD Forum 0 May 10, 2008 07:59
Array Visualizer in Visual Fortran Krishna Main CFD Forum 0 December 6, 2004 03:23


All times are GMT -4. The time now is 22:52.