@Shareable public class TopNTruncator extends java.lang.Object implements VectorTruncator, java.io.Serializable
A VectorTruncator
that will retain the top n entries.
Constructor and Description |
---|
TopNTruncator(int n) |
TopNTruncator(int n,
Threshold threshold) |
Modifier and Type | Method and Description |
---|---|
Long2DoubleMap |
truncate(Long2DoubleMap v)
Truncate a vector, removing any entries that do not satisfy some condition.
|
public TopNTruncator(int n, Threshold threshold)
public TopNTruncator(int n)
public Long2DoubleMap truncate(Long2DoubleMap v)
VectorTruncator
Truncate a vector, removing any entries that do not satisfy some condition.
truncate
in interface VectorTruncator
v
- The vector to truncate.