comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: comparing and concatenating arrays...please help!!
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: comparing and concatenating arrays...please help!! [message #37590 is a reply to message #37587] Thu, 08 January 2004 13:22 Go to previous messageGo to previous message
Michael Wallace is currently offline  Michael Wallace
Messages: 409
Registered: December 2003
Senior Member
> Hi Pepijn,
>
> Many thanks for your reply.
>
> My files are _huge_. File 1 is about 250000 lines and file2 about half
> that. which is why my code was taking about 4 days!
>
> I'll give the sorting a try, but if anyone else has any suggestions,
> they'll be gratefully received. I'm not a newbie, but am daunted by
> some of the operations you suggested below... I certainly take
> inspiration from all you guys though!

I'd try the sorting attack myself -- sort first and then merge the
sorted data. I don't know what kind of memory and processing
constraints you're under, so this might not be applicable if you have
sufficient memory. If you run into a memory problem trying to sort this
much data, you can divide the sort into chunks. Read and sort the first
X many lines, then read and sort the next X many, and so on. Then take
all the chunks and merge them. Finally, merge of the sorted file1 and
sorted file2. While there will be more operations than the first
approach, the running time will still be on the order of n*log(n) which
is still better than your original running time of n^2, and you will
chew up a lot less memory. Again, this is just a suggestion if you run
into memory problems trying to do such a large sort.

Mike W
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Passing from from IDL to external lib (DLM)
Next Topic: Re: Problem masking multiple regions.

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 06:01:49 PDT 2025

Total time taken to generate the page: 1.44044 seconds