@Deprecated @Immutable public final class ImmutableSparseVector extends SparseVector implements Serializable
Immutable sparse vectors. These vectors cannot be changed, even by other code, and are therefore safe to store and are thread-safe.
Use create(java.util.Map), SparseVector.empty(), immutable(), or MutableSparseVector.freeze() to create immutable sparse vectors.
| Modifier and Type | Method and Description |
|---|---|
ImmutableSparseVector |
combineWith(SparseVector o)
Deprecated.
Combine this vector with another vector by taking the union of the key domains of two vectors.
|
static ImmutableSparseVector |
create(Map<Long,Double> data)
Deprecated.
Construct a new immutable sparse vector from a map.
|
<K> Long2ObjectMap<K> |
getChannel(TypedSymbol<K> channelSymbol)
Deprecated.
Fetch the channel stored under a particular typed symbol.
|
Set<TypedSymbol<?>> |
getChannelSymbols()
Deprecated.
Retrieve all symbols that map to typed side channels for this vector.
|
ImmutableSparseVector |
getChannelVector(Symbol channelSymbol)
Deprecated.
Get the vector associated with a particular unboxed channel.
|
Set<Symbol> |
getChannelVectorSymbols()
Deprecated.
Retrieve all symbols that map to side channels for this vector.
|
boolean |
hasChannel(TypedSymbol<?> channelSymbol)
Deprecated.
Return whether this sparse vector has a channel stored under a particular typed symbol.
|
boolean |
hasChannelVector(Symbol channelSymbol)
Deprecated.
Return whether this sparse vector has a channel vector stored under a particular symbol.
|
ImmutableSparseVector |
immutable()
Deprecated.
Return an immutable snapshot of this sparse vector.
|
double |
mean()
Deprecated.
Compute and return the mean of the vector’s values.
|
MutableSparseVector |
mutableCopy()
Deprecated.
Return a mutable copy of this sparse vector.
|
double |
norm()
Deprecated.
Compute and return the L2 norm (Euclidian length) of the vector.
|
double |
sum()
Deprecated.
Compute and return the L1 norm (sum) of the vector.
|
asMap, containsKey, countCommonKeys, dot, empty, equals, fast, fast, fastIntersect, fastIterator, fastIterator, get, get, get, hashCode, isEmpty, isSet, iterator, iterator, keyDomain, keysByValue, keysByValue, keySet, size, sumAbs, toString, unsetKeySet, values, viewclone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic static ImmutableSparseVector create(Map<Long,Double> data)
Construct a new immutable sparse vector from a map.
data - The data. It may not contain any null values.public ImmutableSparseVector immutable()
SparseVectorReturn an immutable snapshot of this sparse vector. The new vector’s key domain may be shrunk to remove storage of unused keys; no keys in the key set will be removed.
immutable in class SparseVectorpublic MutableSparseVector mutableCopy()
SparseVectorReturn a mutable copy of this sparse vector. The key domain of the mutable vector will be the same as this vector’s key domain.
mutableCopy in class SparseVectorpublic boolean hasChannelVector(Symbol channelSymbol)
SparseVectorReturn whether this sparse vector has a channel vector stored under a particular symbol.
hasChannelVector in class SparseVectorchannelSymbol - the symbol under which the channel was stored in the vector.public boolean hasChannel(TypedSymbol<?> channelSymbol)
SparseVectorReturn whether this sparse vector has a channel stored under a particular typed symbol.
hasChannel in class SparseVectorchannelSymbol - the typed symbol under which the channel was stored in the vector.public ImmutableSparseVector getChannelVector(Symbol channelSymbol)
SparseVectorGet the vector associated with a particular unboxed channel.
getChannelVector in class SparseVectorchannelSymbol - the symbol under which the channel was/is stored in the vector.null if there is no such channel.public <K> Long2ObjectMap<K> getChannel(TypedSymbol<K> channelSymbol)
SparseVectorFetch the channel stored under a particular typed symbol.
getChannel in class SparseVectorchannelSymbol - the typed symbol under which the channel was/is stored in the vector.null if there is no such channel.public Set<Symbol> getChannelVectorSymbols()
SparseVectorRetrieve all symbols that map to side channels for this vector.
getChannelVectorSymbols in class SparseVectorpublic Set<TypedSymbol<?>> getChannelSymbols()
SparseVectorRetrieve all symbols that map to typed side channels for this vector.
getChannelSymbols in class SparseVectorpublic ImmutableSparseVector combineWith(SparseVector o)
SparseVectorCombine this vector with another vector by taking the union of the key domains of two vectors. If both vectors have values the same key, the values in o override those from the current vector.
combineWith in class SparseVectoro - The other vectorpublic double norm()
SparseVectorCompute and return the L2 norm (Euclidian length) of the vector.
norm in class SparseVectorpublic double sum()
SparseVectorCompute and return the L1 norm (sum) of the vector.
sum in class SparseVectorpublic double mean()
SparseVectorCompute and return the mean of the vector’s values.
mean in class SparseVector