private void constructAliasTableArray(Long2DoubleMap seedsWithWeights,long[] indexArray,int[] aliasTableArray){
  int index=0;
  int averageWeight=0;
  for (  Long2DoubleMap.Entry entry : seedsWithWeights.long2DoubleEntrySet()) {
    long seed=entry.getLongKey();
    double seedWeight=entry.getDoubleValue();
    indexArray[index]=seed;
    int finalWeight=(int)(Math.round(MULTIPER_FOR_ALIASTABLE * seedWeight * bipartiteGraph.getLeftNodeDegree(seed)));
    IntArrayAliasTable.setEntry(aliasTableArray,index,index);
    IntArrayAliasTable.setWeight(aliasTableArray,index,finalWeight);
    averageWeight+=finalWeight;
    index++;
  }
  IntArrayAliasTable.setAliasTableSize(aliasTableArray,index);
  IntArrayAliasTable.setAliasTableAverageWeight(aliasTableArray,averageWeight / index);
  AliasTableUtil.constructAliasTable(aliasTableArray);
}

private void constructAliasTableArray ( Long2DoubleMap seedsWithWeights , long [ ] indexArray , int [ ] aliasTableArray ) { int index = 0 ; int averageWeight = 0 ; for ( Long2DoubleMap . Entry entry : seedsWithWeights . long2DoubleEntrySet ( ) ) { long seed = entry . getLongKey ( ) ; double seedWeight = entry . getDoubleValue ( ) ; indexArray [ index ] = seed ; int finalWeight = ( int ) ( Math . round ( MULTIPER_FOR_ALIASTABLE * seedWeight * bipartiteGraph . getLeftNodeDegree ( seed ) ) ) ; IntArrayAliasTable . setEntry ( aliasTableArray , index , index ) ; IntArrayAliasTable . setWeight ( aliasTableArray , index , finalWeight ) ; averageWeight += finalWeight ; index ++ ; } IntArrayAliasTable . setAliasTableSize ( aliasTableArray , index ) ; IntArrayAliasTable . setAliasTableAverageWeight ( aliasTableArray , averageWeight / index ) ; AliasTableUtil . constructAliasTable ( aliasTableArray ) ; }
construct a index array and an alias table given the lhs seed nodes with weights . the probability for a lhs seed node u to be sampled should be proportional to degree ( u ) * weight ( u )
