mahout-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dawid Weiss <dawid.we...@cs.put.poznan.pl>
Subject Re: Performance of primitive collections
Date Wed, 05 Jun 2013 12:49:16 GMT
> But that's absolutely weird. The mixing function should take care of that.

> But that's absolutely weird. The mixing function should take care of that.

Sure, unless you don't have any... This is what's currently in Mahout
(look closely at the first line!):

  public static int hash(int value) {
    return value;

    //return value * 0x278DDE6D; // see
org.apache.mahout.math.jet.random.engine.DRand

    /*
    value &= 0x7FFFFFFF; // make it >=0
    int hashCode = 0;
    do hashCode = 31*hashCode + value%10;
    while ((value /= 10) > 0);

    return 28629151*hashCode; // spread even further; h*31^5
    */
  }

So there is no redistributing of keys. In my opinion this is a bug
that should be addressed.

Dawid

Mime
View raw message