Examples of floatVal()


Examples of org.apache.lucene.queries.function.FunctionValues.floatVal()

    for (AtomicReaderContext leaf : leaves) {
      int maxDoc = leaf.reader().maxDoc();
      FunctionValues vals =  source.getValues(context, leaf);
      for (int i=0; i<maxDoc; i++) {

      float val = vals.floatVal(i);
      if ((Float.floatToRawIntBits(val) & (0xff<<23)) == 0xff<<23) {
        // if the exponent in the float is all ones, then this is +Inf, -Inf or NaN
        // which don't make sense to factor into the scale function
        continue;
      }
View Full Code Here

Examples of org.apache.lucene.queries.function.FunctionValues.floatVal()

    final FunctionValues vals =  source.getValues(context, readerContext);

    return new FloatDocValues(this) {
      @Override
      public float floatVal(int doc) {
        return (vals.floatVal(doc) - minSource) * scale + min;
      }
      @Override
      public String toString(int doc) {
        return "scale(" + vals.toString(doc) + ",toMin=" + min + ",toMax=" + max
                + ",fromMin=" + minSource
View Full Code Here

Examples of org.apache.lucene.queries.function.FunctionValues.floatVal()

  public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
    final FunctionValues vals =  source.getValues(context, readerContext);
    return new FloatDocValues(this) {
      @Override
      public float floatVal(int doc) {
        float val = vals.floatVal(doc);
        return (val>=min && val<=max) ? target : (defaultVal == null ? val : defaultVal);
      }
      @Override
      public String toString(int doc) {
        return "map(" + vals.toString(doc) + ",min=" + min + ",max=" + max + ",target=" + target + ")";
View Full Code Here

Examples of org.apache.lucene.queries.function.FunctionValues.floatVal()

    assertEquals(1, reader.leaves().size());
    AtomicReaderContext leaf = reader.leaves().get(0);
    FunctionValues values = vs.getValues(new HashMap<String,Object>(), leaf);
   
    assertEquals(10, values.doubleVal(0), 0);
    assertEquals(10, values.floatVal(0), 0);
    assertEquals(10, values.longVal(0));
    assertEquals(10, values.intVal(0));
    assertEquals(10, values.shortVal(0));
    assertEquals(10, values.byteVal(0));
    assertEquals("10.0", values.strVal(0));
View Full Code Here

Examples of org.apache.lucene.queries.function.FunctionValues.floatVal()

    assertEquals(10, values.byteVal(0));
    assertEquals("10.0", values.strVal(0));
    assertEquals(new Double(10), values.objectVal(0));
   
    assertEquals(40, values.doubleVal(1), 0);
    assertEquals(40, values.floatVal(1), 0);
    assertEquals(40, values.longVal(1));
    assertEquals(40, values.intVal(1));
    assertEquals(40, values.shortVal(1));
    assertEquals(40, values.byteVal(1));
    assertEquals("40.0", values.strVal(1));
View Full Code Here

Examples of org.apache.lucene.queries.function.FunctionValues.floatVal()

    assertEquals(40, values.byteVal(1));
    assertEquals("40.0", values.strVal(1));
    assertEquals(new Double(40), values.objectVal(1));
   
    assertEquals(4, values.doubleVal(2), 0);
    assertEquals(4, values.floatVal(2), 0);
    assertEquals(4, values.longVal(2));
    assertEquals(4, values.intVal(2));
    assertEquals(4, values.shortVal(2));
    assertEquals(4, values.byteVal(2));
    assertEquals("4.0", values.strVal(2));
View Full Code Here

Examples of org.apache.lucene.queries.function.FunctionValues.floatVal()

        return ifVals.boolVal(doc) ? trueVals.shortVal(doc) : falseVals.shortVal(doc);
      }

      @Override
      public float floatVal(int doc) {
        return ifVals.boolVal(doc) ? trueVals.floatVal(doc) : falseVals.floatVal(doc);
      }

      @Override
      public int intVal(int doc) {
        return ifVals.boolVal(doc) ? trueVals.intVal(doc) : falseVals.intVal(doc);
View Full Code Here

Examples of org.apache.lucene.queries.function.FunctionValues.floatVal()

          vals[1] = y.longVal(doc);
        }
        @Override
        public void floatVal(int doc, float[] vals) {
          vals[0] = x.floatVal(doc);
          vals[1] = y.floatVal(doc);
        }
        @Override
        public void doubleVal(int doc, double[] vals) {
          vals[0] = x.doubleVal(doc);
          vals[1] = y.doubleVal(doc);
View Full Code Here

Examples of org.apache.lucene.queries.function.FunctionValues.floatVal()

    for (AtomicReaderContext leaf : leaves) {
      int maxDoc = leaf.reader().maxDoc();
      FunctionValues vals =  source.getValues(context, leaf);
      for (int i=0; i<maxDoc; i++) {

      float val = vals.floatVal(i);
      if ((Float.floatToRawIntBits(val) & (0xff<<23)) == 0xff<<23) {
        // if the exponent in the float is all ones, then this is +Inf, -Inf or NaN
        // which don't make sense to factor into the scale function
        continue;
      }
View Full Code Here

Examples of org.apache.lucene.queries.function.FunctionValues.floatVal()

    final FunctionValues vals =  source.getValues(context, readerContext);

    return new FloatDocValues(this) {
      @Override
      public float floatVal(int doc) {
        return (vals.floatVal(doc) - minSource) * scale + min;
      }
      @Override
      public String toString(int doc) {
        return "scale(" + vals.toString(doc) + ",toMin=" + min + ",toMax=" + max
                + ",fromMin=" + minSource
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.