Package gnu.trove

Examples of gnu.trove.TIntDoubleHashMap


   *        of the result file to evaluate.
   */
  public void evaluate(String resultFilename) {
  //  //logger.info("Result file: "+resultFilename);
    queryNumbers = new TIntHashSet();
    recipRank = new TIntDoubleHashMap();
    //initialise the arr
    arr = 0.0d;
    inTop50 = 0;
    inTop20 = 0;
    inTop10 = 0;
View Full Code Here


    this.averagePrecisionOfEachQuery = new double[effQueryCounter];
   
    TIntDoubleHashMap[] precisionAtRankByQuery = new TIntDoubleHashMap[effQueryCounter];
    TIntDoubleHashMap[] precisionAtRecallByQuery = new TIntDoubleHashMap[effQueryCounter];
    for (int i = 0; i < effQueryCounter; i++) {
      precisionAtRankByQuery[i] = new TIntDoubleHashMap();
      precisionAtRecallByQuery[i] = new TIntDoubleHashMap();
    }
   
    double[] ExactPrecision = new double[effQueryCounter];
    double[] RPrecision = new double[effQueryCounter];
    Arrays.fill(ExactPrecision, 0.0d);
View Full Code Here

   */
  public AccumulatorResultSet(int numberOfDocuments)
  {
    lock = new ReentrantLock();
   
    scoresMap = new TIntDoubleHashMap();
    occurrencesMap = new TIntShortHashMap();

    resultSize = numberOfDocuments;
    exactResultSize = numberOfDocuments;
  }
View Full Code Here

   
    this.averagePrecisionOfEachQuery = new double[effQueryCounter];
    TIntDoubleHashMap[] precisionAtRankByQuery = new TIntDoubleHashMap[effQueryCounter];
    TIntDoubleHashMap[] precisionAtRecallByQuery = new TIntDoubleHashMap[effQueryCounter];
    for (int i = 0; i < effQueryCounter; i++) {
      precisionAtRankByQuery[i] = new TIntDoubleHashMap();
      precisionAtRecallByQuery[i] = new TIntDoubleHashMap();
    }
   
//    int[] PrecisionAt1 = new int[effQueryCounter];
//    //Modified by G.AMATI 7th May 2002
//    int[] PrecisionAt2 = new int[effQueryCounter];
View Full Code Here

  private double calculateDenom(SparseVector a, SparseVector b) {

    double result = 0;

    TIntDoubleHashMap diff = new TIntDoubleHashMap();

    for (int i = 0; i < a.numEntries(); i++) {
      int ind = a.getIndexAt(i);
      double val = a.getValueAt(i);
      if (!diff.containsKey(ind)) {
        diff.put(ind, 0);
      }
      diff.put(ind, diff.get(ind) + val);
    }

    for (int i = 0; i < b.numEntries(); i++) {
      int ind = b.getIndexAt(i);
      double val = b.getValueAt(i);
      if (!diff.containsKey(ind)) {
        diff.put(ind, 0);
      }
      diff.put(ind, diff.get(ind) - val);
    }

    for (TIntDoubleIterator iterator = diff.iterator(); iterator.hasNext();) {
      iterator.advance();
      result += Math.pow(iterator.value(), 2);
    }

    return result;
View Full Code Here

  private double calculateDenom(SparseVector a, SparseVector b) {

    double result = 0;

    TIntDoubleHashMap diff = new TIntDoubleHashMap();

    for (int i = 0; i < a.numEntries(); i++) {
      int ind = a.getIndexAt(i);
      double val = a.getValueAt(i);
      if (!diff.containsKey(ind)) {
        diff.put(ind, 0);
      }
      diff.put(ind, diff.get(ind) + val);
    }

    for (int i = 0; i < b.numEntries(); i++) {
      int ind = b.getIndexAt(i);
      double val = b.getValueAt(i);
      if (!diff.containsKey(ind)) {
        diff.put(ind, 0);
      }
      diff.put(ind, diff.get(ind) - val);
    }

    for (TIntDoubleIterator iterator = diff.iterator(); iterator.hasNext();) {
      iterator.advance();
      result += Math.pow(iterator.value(), 2);
    }

    return result;
View Full Code Here

    res.next();
    limitID = res.getInt(1);
   
   
    // read inlink counts 
    inlinkMap = new TIntDoubleHashMap(limitID);
   
    int targetID, numInlinks;
    res = stmtLink.executeQuery(strAllInlinks);
    while(res.next()){
      targetID = res.getInt(1);
View Full Code Here

    res.next();
    limitID = res.getInt(1);
   
   
    // read inlink counts 
    inlinkMap = new TIntDoubleHashMap(limitID);
   
    int targetID, numInlinks;
    res = stmtLink.executeQuery(strAllInlinks);
    while(res.next()){
      targetID = res.getInt(1);
View Full Code Here

  private TIntDoubleHashMap valueMap;
  private int size;
 
  public TroveConceptVector(int size ) {
    this.size = size;
    valueMap = new TIntDoubleHashMap(size);   
  }
View Full Code Here

TOP

Related Classes of gnu.trove.TIntDoubleHashMap

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.