@Shareable public class ValueArrayQuantizer extends Object implements Quantizer, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected mikera.vectorz.impl.ImmutableVector |
values
The values to quantize to.
|
| Constructor and Description |
|---|
ValueArrayQuantizer(double[] vs)
Construct a new quantizer using the specified array of values.
|
ValueArrayQuantizer(mikera.vectorz.impl.ImmutableVector vs) |
| Modifier and Type | Method and Description |
|---|---|
int |
getCount()
Get the number of discrete values the output can take.
|
double |
getIndexValue(int i)
Get the value corresponding to a quantized value, based on the index into
the list of possible values.
|
mikera.vectorz.impl.ImmutableVector |
getValues()
Get the possible values into which this quantizer will map input values.
|
int |
index(double val)
Convert a value into a discrete, quantized value.
|
double |
quantize(double val)
Convert a value into a quantized value, returning the quantized value.
|
protected final mikera.vectorz.impl.ImmutableVector values
public ValueArrayQuantizer(double[] vs)
vs - The discrete values to quantize to.public ValueArrayQuantizer(mikera.vectorz.impl.ImmutableVector vs)
public mikera.vectorz.impl.ImmutableVector getValues()
Quantizerpublic int getCount()
Quantizerpublic double getIndexValue(int i)
QuantizergetIndexValue in interface Quantizeri - The quantized value number, in the range [0,n) where n is the number of
possible discrete values (see Quantizer.getCount()).i.public int index(double val)
Quantizer