Examples of FloatArrayList


Examples of it.unimi.dsi.fastutil.floats.FloatArrayList

   
    @Override
    public Explanation explain(int doc){
      String[] vals = _array.getTranslatedData(doc, _dataCache.valArray);
     
      FloatList scoreList = new FloatArrayList(_dataCache.valArray.size());
      ArrayList<Explanation> explList = new ArrayList<Explanation>(scoreList.size());
      for (String val : vals)
      {
        int idx = _dataCache.valArray.indexOf(val);
        if (idx>=0){
          scoreList.add(_function.score(_dataCache.freqs[idx], _boostList[idx]));
          explList.add(_function.explain(_dataCache.freqs[idx], _boostList[idx]));
        }
      }
      Explanation topLevel = _function.explain(scoreList.toFloatArray());
      for (Explanation sub : explList){
        topLevel.addDetail(sub);
      }
      return topLevel;
    }
View Full Code Here

Examples of it.unimi.dsi.fastutil.floats.FloatArrayList

    @Override
    public Explanation explain(int doc){
      int encoded=_dataCache.orderArray.get(doc);
     
      int count=1;
      FloatList scoreList = new FloatArrayList(_dataCache.valArray.size());
      ArrayList<Explanation> explList = new ArrayList<Explanation>(scoreList.size());
      while(encoded != 0)
      {
        if ((encoded & 0x00000001) != 0x0){
          int idx = count -1;
          scoreList.add(_function.score(_dataCache.freqs[idx], _boostList[idx]));
          explList.add(_function.explain(_dataCache.freqs[idx], _boostList[idx]));
        }
        count++;
        encoded >>>= 1;
      }
      Explanation topLevel = _function.explain(scoreList.toFloatArray());
      for (Explanation sub : explList){
        topLevel.addDetail(sub);
      }
      return topLevel;
    }
View Full Code Here

Examples of it.unimi.dsi.fastutil.floats.FloatArrayList

   
    @Override
    public Explanation explain(int doc){
      String[] vals = _array.getTranslatedData(doc, _dataCache.valArray);
     
      FloatList scoreList = new FloatArrayList(_dataCache.valArray.size());
      ArrayList<Explanation> explList = new ArrayList<Explanation>(scoreList.size());
      for (String val : vals)
      {
        int idx = _dataCache.valArray.indexOf(val);
        if (idx>=0){
          scoreList.add(_function.score(_dataCache.freqs[idx], _boostList[idx]));
          explList.add(_function.explain(_dataCache.freqs[idx], _boostList[idx]));
        }
      }
      Explanation topLevel = _function.explain(scoreList.toFloatArray());
      for (Explanation sub : explList){
        topLevel.addDetail(sub);
      }
      return topLevel;
    }
View Full Code Here

Examples of it.unimi.dsi.fastutil.floats.FloatArrayList

  @Override
  protected List<?> buildPrimitiveList(int capacity)
  {
    _type = Float.class;
    return capacity > 0 ? new FloatArrayList(capacity) : new FloatArrayList();
  }
View Full Code Here

Examples of it.unimi.dsi.fastutil.floats.FloatArrayList

    @Override
    public Explanation explain(int doc){
      int encoded=_dataCache.orderArray.get(doc);
     
      int count=1;
      FloatList scoreList = new FloatArrayList(_dataCache.valArray.size());
      ArrayList<Explanation> explList = new ArrayList<Explanation>(scoreList.size());
      while(encoded != 0)
      {
        if ((encoded & 0x00000001) != 0x0){
          int idx = count -1;
          scoreList.add(_function.score(_dataCache.freqs[idx], _boostList[idx]));
          explList.add(_function.explain(_dataCache.freqs[idx], _boostList[idx]));
        }
        count++;
        encoded >>>= 1;
      }
      Explanation topLevel = _function.explain(scoreList.toFloatArray());
      for (Explanation sub : explList){
        topLevel.addDetail(sub);
      }
      return topLevel;
    }
View Full Code Here

Examples of jodd.util.collection.FloatArrayList

    }

    if (value instanceof Iterable) {
      Iterable iterable = (Iterable) value;

      FloatArrayList floatArrayList = new FloatArrayList();

      for (Object element : iterable) {
        float convertedValue = convertType(element);
        floatArrayList.add(convertedValue);
            }

      return floatArrayList.toArray();
    }

    if (value instanceof CharSequence) {
      String[] strings = StringUtil.splitc(value.toString(), ArrayConverter.NUMBER_DELIMITERS);
      return convertArrayToArray(strings);
View Full Code Here

Examples of org.apache.hadoop.hbase.regionserver.idx.support.arrays.FloatArrayList

        break;
      case INT:
        keyStore = new IntegerArrayList();
        break;
      case FLOAT:
        keyStore = new FloatArrayList();
        break;
      case BIG_DECIMAL:
        keyStore = new BigDecimalArrayList();
        break;
      case CHAR_ARRAY:
View Full Code Here

Examples of org.apache.mahout.math.list.FloatArrayList

   * #forEachKey(FloatProcedure)}. <p> This method can be used to iterate over the keys of the receiver.
   *
   * @return the keys.
   */
  public FloatArrayList keys() {
    FloatArrayList list = new FloatArrayList(size());
    keys(list);
    return list;
  }
View Full Code Here

Examples of org.apache.mahout.math.list.FloatArrayList

   * (8,6,7)</tt>
   *
   * @param keyList the list to be filled, can have any size.
   */
  public void keysSortedByValue(FloatArrayList keyList) {
    pairsSortedByValue(keyList, new FloatArrayList(size()));
  }
View Full Code Here

Examples of org.apache.mahout.math.list.FloatArrayList

  /**
   * Returns a string representation of the receiver, containing the String representation of each key-value pair,
   * sorted ascending by key.
   */
  public String toString() {
    FloatArrayList theKeys = keys();
    //theKeys.sort();

    StringBuilder buf = new StringBuilder();
    buf.append('[');
    int maxIndex = theKeys.size() - 1;
    for (int i = 0; i <= maxIndex; i++) {
      float key = theKeys.get(i);
      buf.append(String.valueOf(key));
      buf.append("->");
      buf.append(String.valueOf(get(key)));
      if (i < maxIndex) {
        buf.append(", ");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.