Package de.torstennahm.math

Examples of de.torstennahm.math.IntEntry


   
    entryNums = new int[nonZeroEntries];
    entryVals = new int[nonZeroEntries];
   
    for (int pos = 0; iter.hasNext(); pos++)  {
      IntEntry entry = iter.next();
      entryNums[pos] = entry.getNumber();
      entryVals[pos] = entry.getValue();
      hashCode = newHash(hashCode, entry.getNumber(), 0, entry.getValue());
    }
  }
View Full Code Here


        }
       
        final int i = index;
        index++;
       
        return new IntEntry() {
          public int getNumber() {
            return entryNums[i];
          }
          public int getValue() {
            return entryVals[i];
View Full Code Here

        left--;
      }
    } else {
      Iterator<IntEntry> iter = subIndex.iterator();
      if (iter.hasNext()) {
        IntEntry entry = iter.next();
        int num = entry.getNumber();
        if (num + 1 == dimension) {
          lengthFinished = true;
        } else {
          left += entry.getValue() - 1;
          subIndex = subIndex.set(num, 0);
          subIndex = subIndex.add(num + 1, 1);
        }
      } else {
        lengthFinished = true;
View Full Code Here

      if (mode == GEOMETRIC) {
        double logSum = 0.0;
       
        int entries = 0;
        for (Iterator<IntEntry> iter = index.iterator(); iter.hasNext(); entries++) {
          IntEntry entry = iter.next();
          Index pred = index.add(entry.getNumber(), -1);
         
          EstimateData predData = indexMap.get(pred);
          logSum += Math.log(Math.abs(predData.contribution));
        }
       
        return Math.exp(logSum / entries);
      } else if (mode == MINIMUM) {
        double estimate = Double.POSITIVE_INFINITY;
       
        for (IntEntry entry : index) {
          Index pred = index.add(entry.getNumber(), -1);
          EstimateData predData = indexMap.get(pred);
          estimate = Math.min(Math.abs(predData.contribution), estimate);
        }
       
        return estimate;
      } else if (mode == MAXIMUM) {
        double estimate = 0.0;
       
        for (IntEntry entry : index) {
          Index pred = index.add(entry.getNumber(), -1);
          EstimateData predData = indexMap.get(pred);
          estimate = Math.max(Math.abs(predData.contribution), estimate);
        }
       
        return estimate;
View Full Code Here

TOP

Related Classes of de.torstennahm.math.IntEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.