Examples of DoubleOpenHashSet


Examples of com.carrotsearch.hppc.DoubleOpenHashSet

    @Override
    public Filter fieldDataTermsFilter(List values, @Nullable QueryParseContext context) {
        IndexNumericFieldData fieldData = context.getForField(this);
        if (fieldData.getNumericType().isFloatingPoint()) {
            // create with initial size large enough to avoid rehashing
            DoubleOpenHashSet terms =
                    new DoubleOpenHashSet((int) (values.size() * (1 + DoubleOpenHashSet.DEFAULT_LOAD_FACTOR)));
            for (int i = 0, len = values.size(); i < len; i++) {
                terms.add(parseDoubleValue(values.get(i)));
            }

            return FieldDataTermsFilter.newDoubles(fieldData, terms);
        } else {
            // create with initial size large enough to avoid rehashing
            LongOpenHashSet terms =
                    new LongOpenHashSet((int) (values.size() * (1 + LongOpenHashSet.DEFAULT_LOAD_FACTOR)));
            for (int i = 0, len = values.size(); i < len; i++) {
                terms.add(parseLongValue(values.get(i)));
            }

            return FieldDataTermsFilter.newLongs(fieldData, terms);
        }
    }
View Full Code Here

Examples of com.carrotsearch.hppc.DoubleOpenHashSet

        final IndexNumericFieldData indexFieldData = getForField("value");
        final AtomicNumericFieldData atomicFieldData = indexFieldData.load(refreshReader());
        final SortedNumericDocValues data = atomicFieldData.getLongValues();
        final SortedNumericDoubleValues doubleData = atomicFieldData.getDoubleValues();
        final LongOpenHashSet set = new LongOpenHashSet();
        final DoubleOpenHashSet doubleSet = new DoubleOpenHashSet();
        for (int i = 0; i < values.size(); ++i) {
            final LongOpenHashSet v = values.get(i);

            data.setDocument(i);
            assertThat(data.count() > 0, equalTo(!v.isEmpty()));
            doubleData.setDocument(i);
            assertThat(doubleData.count() > 0, equalTo(!v.isEmpty()));

            set.clear();
            data.setDocument(i);
            int numValues = data.count();
            for (int j = 0; j < numValues; j++) {
                set.add(data.valueAt(j));
            }
            assertThat(set, equalTo(v));

            final DoubleOpenHashSet doubleV = new DoubleOpenHashSet();
            final boolean[] states = v.allocated;
            final long[] keys = v.keys;
            for (int j = 0; j < states.length; j++) {
                if (states[j]) {
                    doubleV.add((double) keys[j]);
                }
            }
            doubleSet.clear();
            doubleData.setDocument(i);
            numValues = doubleData.count();
View Full Code Here

Examples of it.unimi.dsi.fastutil.doubles.DoubleOpenHashSet

 
 
  @Override
  public boolean containsAny(Object set)
  {
    DoubleOpenHashSet setDouble = (DoubleOpenHashSet)set;
    for(int i=0; i< this._length; i++)
      if( setDouble.contains(((TermDoubleList) _mTermList).getPrimitiveValue(_buf[i])) )
        return true;
             
    return false;
  }
View Full Code Here

Examples of it.unimi.dsi.fastutil.doubles.DoubleOpenHashSet

          {
            hs.add(values.getInt(k));
          }
          break;
        case RelevanceJSONConstants.TYPENUMBER_SET_DOUBLE:
          hs = new DoubleOpenHashSet();
          for (int k = 0; k < values.length(); k++)
          {
            hs.add(values.getDouble(k));
          }
          break;
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.