Package org.apache.sysds.runtime.matrix.data.sketch.countdistinctapprox

# Class SmallestPriorityQueue

java.lang.Object
org.apache.sysds.runtime.matrix.data.sketch.countdistinctapprox.SmallestPriorityQueue

public class SmallestPriorityQueue extends Object
Deceiving name, but is used to contain the k smallest values inserted. TODO: Replace Standard Java Set and Priority Queue with optimized versions.

## Constructor Summary

Constructors
Constructor
Description
`SmallestPriorityQueue(int k)`

## Method Summary

Modifier and Type
Method
Description
`void`
`add(double v)`
`void`
`clear()`
`boolean`
`isEmpty()`
`double`
`peek()`
`double`
`poll()`
`int`
`size()`
`String`
`toString()`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### SmallestPriorityQueue

public SmallestPriorityQueue(int k)

## Method Details

### add

public void add(double v)

### size

public int size()

### peek

public double peek()

### poll

public double poll()

### isEmpty

public boolean isEmpty()

### clear

public void clear()

### toString

public String toString()

Overrides:
  `toString` in class `Object`