[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: uniq function?

From: John W. Eaton
Subject: Re: uniq function?
Date: Tue, 3 Nov 1998 17:55:11 -0600 (CST)

On  3-Nov-1998, Daniel Heiserer <address@hidden> wrote:

| Well intersection bases on create_set as far as I have seen. 
| Here a little benchmark between "create_set" and "unique".
| Unique is a factor 70 faster!!!!
| octave:3> a=1:1000000;
| octave:4> b=[a,a];
| octave:5> b=sort(b);
| octave:6> tic;c=unique(b);toc
| ans = 11
| octave:7> tic;d=create_set(b);toc
| ans = 721
| octave:8> e=find(c-d)
| e = [](0x0)

The trouble is that create_set and intersection (and union, because it
calls create_set) use loops when they should probably use find or some
other method instead.  The comments in those files say that I wrote
them, but I think that is incorrect.  They were added a long time ago
and I don't remember who contributed them.  I'll see if I can figure
out who did and fix the comments.

Any volunteers for speeding them up?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]