Package gnu.trove.map.hash

Examples of gnu.trove.map.hash.TDoubleDoubleHashMap$TKeyView


   *
   * @param n the degree of freedom
   * @param values the t-values
   */
  private static void put(int n, double[] values) {
    TDoubleDoubleMap map = new TDoubleDoubleHashMap();
    map.put(_6000, values[0]);
    map.put(_8000, values[1]);
    map.put(_9000, values[2]);
    map.put(_9500, values[3]);
    map.put(_9750, values[4]);
    map.put(_9900, values[5]);
    map.put(_9950, values[6]);
    map.put(_9990, values[7]);
    map.put(_9995, values[8]);

    map.put(_4000, -values[0]);
    map.put(_2000, -values[1]);
    map.put(_1000, -values[2]);
    map.put(_0500, -values[3]);
    map.put(_0250, -values[4]);
    map.put(_0100, -values[5]);
    map.put(_0050, -values[6]);
    map.put(_0010, -values[7]);
    map.put(_0005, -values[8]);
    tValues.put(n, map);
  }
View Full Code Here


  CanFindThresholdApproximation gaussianThresholdEstimator() {
    return new GaussianThresholdEstimator<PWM, BackgroundModel>(pwm, background);
  }

  protected TDoubleDoubleMap initialCountDistribution() {
    TDoubleDoubleMap scores = new TDoubleDoubleHashMap();
    scores.put(0.0, 1.0);
    return scores;
  }
View Full Code Here

    result.setBestScore(pwm.best_score());
    return result;
  }

  private TDoubleDoubleMap recalc_score_hash(TDoubleDoubleMap scores, double[] column, double least_sufficient) {
    TDoubleDoubleMap new_scores = new TDoubleDoubleHashMap(scores.size());
    TDoubleDoubleIterator iterator = scores.iterator();
    while(iterator.hasNext()) {
      iterator.advance();
      double score = iterator.key();
      double count = iterator.value();
      for (int letter = 0; letter < 4; ++letter) {
        double new_score = score + column[letter];
        if (new_score >= least_sufficient) {
          double add = count * background.count(letter);
          new_scores.adjustOrPutValue(new_score, add, add);
        }
      }
    }
    return new_scores;
  }
View Full Code Here

    List<TDoubleObjectHashMap<TDoubleDoubleHashMap>> scores;
    scores = new ArrayList<TDoubleObjectHashMap<TDoubleDoubleHashMap>>(4);
    for (int last_letter_index = 0; last_letter_index < 4; ++last_letter_index) {
      TDoubleObjectHashMap<TDoubleDoubleHashMap> scores_by_letter;
      scores_by_letter = new TDoubleObjectHashMap<TDoubleDoubleHashMap>();
      scores_by_letter.put(0.0, new TDoubleDoubleHashMap(new double[] {0.0},
                                                         new double[] {dibackground.countAnyFirstLetter(last_letter_index)}) );
      scores.add(scores_by_letter);
    }
    return scores;
  }
View Full Code Here

        while (iterator.hasNext()) {
          iterator.advance();
          double score_first = iterator.key();
          double new_score_first = score_first + firstColumn[4*first_letter + last_letter];
          if (new_score_first >= leastSufficientScoresFirst[last_letter]) {
            partiallyRecalculatedSeed.put(new_score_first, new TDoubleDoubleHashMap());
          }
        }
      }
      result.add(partiallyRecalculatedSeed);
    }
View Full Code Here

      TDoubleObjectIterator<TDoubleDoubleHashMap> iterator = scores.get(first_letter).iterator();
      while (iterator.hasNext()) {
        iterator.advance();
        double score_first = iterator.key();

        TDoubleDoubleHashMap second_scores = iterator.value();

        TDoubleDoubleIterator second_iterator = second_scores.iterator();
        while (second_iterator.hasNext()) {
          second_iterator.advance();
          double score_second = second_iterator.key();
          double count = second_iterator.value();
View Full Code Here

  }

  protected TDoubleDoubleMap[] initialCountDistribution() {
    TDoubleDoubleMap[] scores = new TDoubleDoubleMap[4];
    for(int i = 0; i < 4; ++i) {
      scores[i] = new TDoubleDoubleHashMap();
      scores[i].put(0.0, dibackground.countAnyFirstLetter(i));
    }
    return scores;
  }
View Full Code Here

  }

  private TDoubleDoubleMap[] recalc_score_hash(TDoubleDoubleMap[] scores, double[] column, double[] least_sufficient) {
    TDoubleDoubleMap[] new_scores = new TDoubleDoubleMap[4];
    for(int i = 0; i < 4; ++i) {
      new_scores[i] = new TDoubleDoubleHashMap();
    }
    for(int previousLetter = 0; previousLetter < 4; ++previousLetter) {
      TDoubleDoubleIterator iterator = scores[previousLetter].iterator();
      while(iterator.hasNext()) {
        iterator.advance();
View Full Code Here

    }
    return new_scores;
  }

  TDoubleDoubleMap combine_scores(TDoubleDoubleMap[] scores) {
    TDoubleDoubleMap combined_scores = new TDoubleDoubleHashMap();
    for (int i = 0; i < 4; ++i) {
      TDoubleDoubleIterator iterator = scores[i].iterator();
      while(iterator.hasNext()) {
        iterator.advance();
        double score = iterator.key();
        double count = iterator.value();
        combined_scores.adjustOrPutValue(score, count, count);
      }
    }
    return combined_scores;
  }
View Full Code Here

  }

  // 2d-score hash before first step
  private TDoubleObjectHashMap<TDoubleDoubleHashMap> initialScoreHash() {
    TDoubleObjectHashMap<TDoubleDoubleHashMap> scores = new TDoubleObjectHashMap<TDoubleDoubleHashMap>();
    scores.put(0.0, new TDoubleDoubleHashMap(new double[] {0},
                                             new double[] {1}) );
    return scores;
  }
View Full Code Here

TOP

Related Classes of gnu.trove.map.hash.TDoubleDoubleHashMap$TKeyView

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.