lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject svn commit: r1388919 - /lucene.net/trunk/src/contrib/Spatial/Util/ReciprocalFloatFunction.cs
Date Sat, 22 Sep 2012 23:05:09 GMT
Author: synhershko
Date: Sat Sep 22 23:05:09 2012
New Revision: 1388919

URL: http://svn.apache.org/viewvc?rev=1388919&view=rev
Log:
Implementing RFF's GetHashCode

Modified:
    lucene.net/trunk/src/contrib/Spatial/Util/ReciprocalFloatFunction.cs

Modified: lucene.net/trunk/src/contrib/Spatial/Util/ReciprocalFloatFunction.cs
URL: http://svn.apache.org/viewvc/lucene.net/trunk/src/contrib/Spatial/Util/ReciprocalFloatFunction.cs?rev=1388919&r1=1388918&r2=1388919&view=diff
==============================================================================
--- lucene.net/trunk/src/contrib/Spatial/Util/ReciprocalFloatFunction.cs (original)
+++ lucene.net/trunk/src/contrib/Spatial/Util/ReciprocalFloatFunction.cs Sat Sep 22 23:05:09
2012
@@ -92,11 +92,9 @@ namespace Lucene.Net.Spatial.Util
 
         public override int GetHashCode()
         {
-            throw new NotImplementedException();
-            //TODO
-            //int h = Float.floatToIntBits(a) + Float.floatToIntBits(m);
-            //h ^= (h << 13) | (h >>> 20);
-            //return h + (Float.floatToIntBits(b)) + source.hashCode();
+            int h = (int) BitConverter.DoubleToInt64Bits(a) + (int) BitConverter.DoubleToInt64Bits(m);
+            h ^= (h << 13) | (int)((uint)h >> 20);
+            return h + ((int) BitConverter.DoubleToInt64Bits(b)) + source.GetHashCode();
         }
     }
 }



Mime
View raw message