MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

DeleteDuplicates is too slow?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg107150] DeleteDuplicates is too slow?
  • From: "Zeringue, Clint M Civ USAF AFMC AFRL/RDLAF" <Clint.Zeringue at kirtland.af.mil>
  • Date: Thu, 4 Feb 2010 06:26:02 -0500 (EST)

Hello,

Suppose you have the following.

Data = RandomReal[1,{N,2}];

sameQ[_,_]=False;
sameQ[{x_,y_},{x_,z_}]=True;

Timing[DeleteDuplicates[data,sameQ]][[1]];

If N is a large number this takes an ungodly amount of time?

Is there a more efficient way to delete the duplicate entries of Data ?

ie.

Data = {{1.,2.},{1.,3.},{2.,3.}};

Would become:
{{1.,2.},{ 2.,3.}};


Thanks,


Clint Zeringue


  • Prev by Date: Could you prove this proposition:the i-th prime gap p[i+1]-p[i]<=i
  • Next by Date: Re: Using "If" and "NDSolve" together
  • Previous by thread: Re: Could you prove this proposition:the i-th prime gap p[i+1]-p[i]<=i
  • Next by thread: Re: DeleteDuplicates is too slow?