public interface SparseNumberVector extends NumberVector, SparseFeatureVector<java.lang.Number>
Modifier and Type | Interface and Description |
---|---|
static interface |
SparseNumberVector.Factory<V extends SparseNumberVector>
Factory for sparse number vectors: make from a dim-value map.
|
Modifier and Type | Field and Description |
---|---|
static VectorFieldTypeInformation<SparseNumberVector> |
FIELD
Input data type: Sparse vector field.
|
static VectorTypeInformation<SparseNumberVector> |
VARIABLE_LENGTH
Input data type: Sparse vectors with variable length.
|
ATTRIBUTE_SEPARATOR, FIELD_1D, FIELD_2D
TYPE
Modifier and Type | Method and Description |
---|---|
default byte |
byteValue(int dimension)
Deprecated.
As the vectors are sparse, try to iterate over the sparse
dimensions only, see
iterByteValue(int) . |
double |
doubleValue(int dimension)
Deprecated.
As the vectors are sparse, try to iterate over the sparse
dimensions only, see
iterDoubleValue(int) . |
default float |
floatValue(int dimension)
Deprecated.
As the vectors are sparse, try to iterate over the sparse
dimensions only, see
iterFloatValue(int) . |
default int |
intValue(int dimension)
Deprecated.
As the vectors are sparse, try to iterate over the sparse
dimensions only, see
iterIntValue(int) . |
default int |
iter()
Iterator over non-zero features only, ascendingly.
|
default byte |
iterByteValue(int iter)
Get the value of the iterators' current dimension.
|
double |
iterDoubleValue(int iter)
Get the value of the iterators' current dimension.
|
default float |
iterFloatValue(int iter)
Get the value of the iterators' current dimension.
|
default int |
iterIntValue(int iter)
Get the value of the iterators' current dimension.
|
long |
iterLongValue(int iter)
Get the value of the iterators' current dimension.
|
default short |
iterShortValue(int iter)
Get the value of the iterators' current dimension.
|
long |
longValue(int dimension)
Deprecated.
As the vectors are sparse, try to iterate over the sparse
dimensions only, see
iterLongValue(int) . |
void |
setDimensionality(int maxdim)
Update the vector space dimensionality.
|
default short |
shortValue(int dimension)
Deprecated.
As the vectors are sparse, try to iterate over the sparse
dimensions only, see
iterShortValue(int) . |
getMax, getMin, getValue, toArray
getDimensionality
iterAdvance, iterDim, iterRetract, iterValid
getDimensionality, toString
static final VectorTypeInformation<SparseNumberVector> VARIABLE_LENGTH
static final VectorFieldTypeInformation<SparseNumberVector> FIELD
default int iter()
SparseFeatureVector.iterDim(int)
to get the actual dimension. In fact,
usually this will be the ith non-zero value, assuming an array
representation.
Think of this number as an iterator. For efficiency, it has a primitive
type!
Intended usage:
for (int iter = v.iter(); v.iterValid(iter); iter = v.iterAdvance(iter)) {
final int dim = v.iterDim(iter);
final double val = v.iterDoubleValue(iter);
// Do something.
}
iter
in interface SparseFeatureVector<java.lang.Number>
void setDimensionality(int maxdim)
maxdim
- New dimensionalitydouble iterDoubleValue(int iter)
iter
- Iteratordefault float iterFloatValue(int iter)
iter
- Iteratordefault int iterIntValue(int iter)
iter
- Iteratordefault short iterShortValue(int iter)
iter
- Iteratorlong iterLongValue(int iter)
iter
- Iteratordefault byte iterByteValue(int iter)
iter
- Iterator@Deprecated double doubleValue(int dimension)
iterDoubleValue(int)
.NumberVector
getValue(dim).doubleValue()
, but usually this is much more
efficient due to boxing/unboxing cost.doubleValue
in interface NumberVector
dimension
- the desired dimension, where 0 ≤ dimension <
this.getDimensionality()
@Deprecated default float floatValue(int dimension)
iterFloatValue(int)
.NumberVector
getValue(dim).floatValue()
, but usually this is much more efficient
due to boxing/unboxing cost.floatValue
in interface NumberVector
dimension
- the desired dimension, where 0 ≤ dimension <
this.getDimensionality()
@Deprecated default int intValue(int dimension)
iterIntValue(int)
.NumberVector
getValue(dim).intValue()
, but usually this is much more efficient
due to boxing/unboxing cost.intValue
in interface NumberVector
dimension
- the desired dimension, where 0 ≤ dimension <
this.getDimensionality()
@Deprecated long longValue(int dimension)
iterLongValue(int)
.NumberVector
getValue(dim).longValue()
, but usually this is much more efficient
due to boxing/unboxing cost.longValue
in interface NumberVector
dimension
- the desired dimension, where 0 ≤ dimension <
this.getDimensionality()
@Deprecated default short shortValue(int dimension)
iterShortValue(int)
.NumberVector
getValue(dim).shortValue()
, but usually this is much more efficient
due to boxing/unboxing cost.shortValue
in interface NumberVector
dimension
- the desired dimension, where 0 ≤ dimension <
this.getDimensionality()
@Deprecated default byte byteValue(int dimension)
iterByteValue(int)
.NumberVector
getValue(dim).byteValue()
, but usually this is much more efficient
due to boxing/unboxing cost.byteValue
in interface NumberVector
dimension
- the desired dimension, where 0 ≤ dimension <
this.getDimensionality()
Copyright © 2019 ELKI Development Team. License information.