Class KllDoublesSketchSortedView

    • Constructor Detail

      • KllDoublesSketchSortedView

        public KllDoublesSketchSortedView​(KllDoublesSketch sketch)
        Constructs this Sorted View given the sketch
        Parameters:
        sketch - the given KllDoublesSketch.
    • Method Detail

      • getCumulativeWeights

        public long[] getCumulativeWeights()
        Description copied from interface: SortedView
        Returns the array of cumulative weights from the sketch. Also known as the natural ranks, which are the Natural Numbers on the interval [1, N].
        Specified by:
        getCumulativeWeights in interface SortedView
        Returns:
        the array of cumulative weights (or natural ranks).
      • getMaxItem

        public double getMaxItem()
        Description copied from interface: DoublesSortedView
        Returns the maximum item of the stream. This may be distinct from the largest item retained by the sketch algorithm.
        Specified by:
        getMaxItem in interface DoublesSortedView
        Returns:
        the maximum item of the stream
      • getMinItem

        public double getMinItem()
        Description copied from interface: DoublesSortedView
        Returns the minimum item of the stream. This may be distinct from the smallest item retained by the sketch algorithm.
        Specified by:
        getMinItem in interface DoublesSortedView
        Returns:
        the minimum item of the stream
      • getN

        public long getN()
        Description copied from interface: SortedView
        Returns the total number of items presented to the sourcing sketch.
        Specified by:
        getN in interface SortedView
        Returns:
        the total number of items presented to the sourcing sketch.
      • getQuantile

        public double getQuantile​(double rank,
                                  QuantileSearchCriteria searchCrit)
        Description copied from interface: DoublesSortedView
        Gets the approximate quantile of the given normalized rank and the given search criterion.
        Specified by:
        getQuantile in interface DoublesSortedView
        Parameters:
        rank - the given normalized rank, a double in the range [0.0, 1.0].
        searchCrit - If INCLUSIVE, the given rank includes all quantiles ≤ the quantile directly corresponding to the given rank. If EXCLUSIVE, he given rank includes all quantiles < the quantile directly corresponding to the given rank.
        Returns:
        the approximate quantile given the normalized rank.
        See Also:
        QuantileSearchCriteria
      • getQuantiles

        public double[] getQuantiles()
        Description copied from interface: DoublesSortedView
        Returns an array of all retained quantiles by the sketch.
        Specified by:
        getQuantiles in interface DoublesSortedView
        Returns:
        an array of all retained quantiles by the sketch.
      • getRank

        public double getRank​(double quantile,
                              QuantileSearchCriteria searchCrit)
        Description copied from interface: DoublesSortedView
        Gets the normalized rank corresponding to the given a quantile.
        Specified by:
        getRank in interface DoublesSortedView
        Parameters:
        quantile - the given quantile
        searchCrit - if INCLUSIVE the given quantile is included into the rank.
        Returns:
        the normalized rank corresponding to the given quantile.
        See Also:
        QuantileSearchCriteria
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: SortedView
        Returns true if this sorted view is empty.
        Specified by:
        isEmpty in interface SortedView
        Returns:
        true if this sorted view is empty.