[Avida-SVN] r2593 - development/source/analyze

kaben at myxo.css.msu.edu kaben at myxo.css.msu.edu
Fri May 23 06:39:34 PDT 2008


Author: kaben
Date: 2008-05-23 09:39:33 -0400 (Fri, 23 May 2008)
New Revision: 2593

Modified:
   development/source/analyze/cAnalyzeTreeStats_Gamma.cc
Log:
Again, update Game's gamma statistic calculation to use 64 bit integers. Hope it sticks this time.


Modified: development/source/analyze/cAnalyzeTreeStats_Gamma.cc
===================================================================
--- development/source/analyze/cAnalyzeTreeStats_Gamma.cc	2008-05-22 20:30:40 UTC (rev 2592)
+++ development/source/analyze/cAnalyzeTreeStats_Gamma.cc	2008-05-23 13:39:33 UTC (rev 2593)
@@ -346,15 +346,15 @@
    */
   tArray<int> g = tArray<int>(2, 0) + inode_dists;
   
-  int T = 0;
+  unsigned long long T = 0;
   for(int j = 2; j <= n; j++) { T += j*g[j]; }
 
   // si: interior summation values, cached
-  tArray<int> si(n, 0);
+  tArray<unsigned long long> si(n, 0);
   for(int k = 2; k <= n-1; k++) { si[k] = k*g[k] + si[k-1]; }    
 
   // so: exterior summation
-  int so = 0;
+  unsigned long long so = 0;
   for(int i = 2; i <= n-1; i++) { so += si[i]; }
   
   m_gamma = ( ( (1./(n-2.)) * so ) - (T/2.) ) / ( T*sqrt( 1. / (12.*(n-2.)) ) );




More information about the Avida-cvs mailing list