MathGroup Archive 2009

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

Search the Archive

Re: Re: Fast calculation of pair correlation function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg101453] Re: [mg101444] Re: Fast calculation of pair correlation function
  • From: Carl Woll <carlw at wolfram.com>
  • Date: Wed, 8 Jul 2009 07:06:59 -0400 (EDT)
  • References: <200904141019.GAA07830@smc.vnet.net> <h2v30e$ldj$1@smc.vnet.net> <200907071147.HAA27562@smc.vnet.net>

markus wrote:
> indeed, there was an error in my first post: it should be "histogr
> [[ ... ]]++ " (see my latest post).
> Anyway, I found that Mathematica is too slow for this type of
> calculations, at least if the array has more than 10000 entries.
> I'm using now a C program, which I call from Mathematica, for that.
>
>   
If I understand correctly what you are trying to do, here's a 
Mathematica version that takes less than 8 seconds for a 10^4 list (on a 
64-bit Vista machine). I use a delta of .001:

Needs["HierarchicalClustering`"]

data = RandomReal[1, {10^4, 3}];

In[7]:= res =
   Sort@Tally@
     Ceiling[(Flatten@
         Sqrt@DistanceMatrix[data])/.001]; // AbsoluteTiming

Out[7]= {7.4340000, Null}

In[8]:= res[[;; 10]]

Out[8]= {{0, 10000}, {2, 2}, {3, 4}, {4, 14}, {5, 12}, {6, 42}, {7,
  44}, {8, 62}, {9, 76}, {10, 116}}

Carl Woll
Wolfram Research


  • Prev by Date: Re: piechart with percent...
  • Next by Date: Re: put some elements to zero
  • Previous by thread: Re: Fast calculation of pair correlation function
  • Next by thread: Re: Fast calculation of pair correlation function