public class MinGapDataCuller extends java.lang.Object implements DataCuller
Specifically, this algorithm eliminates the point the leaves the smallest gap (i.e. has the closest neighbors). The first and last data point are never touched.
In case of ties, it chooses the first. This is meant to make the older data sparse while keeping more/most of the fresh data. Few gaps change between removes (2 old are merged, 1 new is introduced; 1. I could cache the gap sums 2. I could use a heap (although the tie breaking might be off)
For efficiency reasons, multiple points are dropped in one culling. The suggested (default) amount of points dropped in one culling is 50%.
Constructor and Description |
---|
MinGapDataCuller(int maxPointCount) |
MinGapDataCuller(int maxPointCount,
int pointCountAfterCulling) |
Modifier and Type | Method and Description |
---|---|
IntBag |
cull(double[] xValues,
boolean sortedOutput) |
static IntBag |
cullToSize(double[] xValues,
int size,
IntBag droppedIndices) |
boolean |
tooManyPoints(int currentPointCount) |
public MinGapDataCuller(int maxPointCount)
public MinGapDataCuller(int maxPointCount, int pointCountAfterCulling)
public boolean tooManyPoints(int currentPointCount)
tooManyPoints
in interface DataCuller
public IntBag cull(double[] xValues, boolean sortedOutput)
cull
in interface DataCuller