Class Interpolate

java.lang.Object
io.nosqlbench.virtdata.library.basics.shared.from_long.to_long.Interpolate
All Implemented Interfaces:
java.util.function.LongUnaryOperator

public class Interpolate
extends java.lang.Object
implements java.util.function.LongUnaryOperator
Return a value along an interpolation curve. This allows you to sketch a basic density curve and describe it simply with just a few values. The number of values provided determines the resolution of the internal lookup table that is used for interpolation. The first value is always the 0.0 anchoring point on the unit interval. The last value is always the 1.0 anchoring point on the unit interval. This means that in order to subdivide the density curve in an interesting way, you need to provide a few more values in between them. Providing two values simply provides a uniform sample between a minimum and maximum value. The input range of this function is, as many of the other functions in this library, based on the valid range of positive long values, between 0L and Long.MAX_VALUE inclusive. This means that if you want to combine interpolation on this curve with the effect of pseudo-random sampling, you need to put a hash function ahead of it in the flow.
  • Constructor Summary

    Constructors 
    Constructor Description
    Interpolate​(double... values)  
  • Method Summary

    Modifier and Type Method Description
    long applyAsLong​(long input)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.function.LongUnaryOperator

    andThen, compose
  • Constructor Details

    • Interpolate

      public Interpolate​(double... values)
  • Method Details

    • applyAsLong

      public long applyAsLong​(long input)
      Specified by:
      applyAsLong in interface java.util.function.LongUnaryOperator