public class SparseVectorStorage extends Object implements VectorStorage, StorageConstants
COLUMN_STORAGE_MODE, RANDOM_ACCESS_MODE, ROW_STORAGE_MODE, SEQUENTIAL_ACCESS_MODE, UNKNOWN_STORAGE_MODE
Constructor and Description |
---|
SparseVectorStorage() |
SparseVectorStorage(int size) |
SparseVectorStorage(Map<Integer,? extends Serializable> map,
boolean cp) |
Modifier and Type | Method and Description |
---|---|
double[] |
data()
Gets underlying array if
StorageOpsMetrics.isArrayBased() returns true and all values
in vector are Numbers. |
boolean |
equals(Object o) |
double |
get(int i)
Gets element from vector by index and cast it to double.
|
<T extends Serializable> |
getRaw(int i) |
int |
hashCode() |
it.unimi.dsi.fastutil.ints.IntSet |
indexes() |
boolean |
isArrayBased()
Checks if implementation is based on Java arrays.
|
boolean |
isDense()
Checks if this implementation should be considered dense so that it explicitly
represents every value.
|
boolean |
isDistributed()
Checks whether implementation is JVM-local or distributed (multi-JVM).
|
boolean |
isNumeric() |
Serializable[] |
rawData() |
void |
readExternal(ObjectInput in) |
void |
set(int i,
double v) |
void |
setRaw(int i,
Serializable v) |
int |
size() |
void |
writeExternal(ObjectOutput out) |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
destroy
assertAccessMode, assertStorageMode
public SparseVectorStorage()
public SparseVectorStorage(Map<Integer,? extends Serializable> map, boolean cp)
public SparseVectorStorage(int size)
size
- Vector size.public int size()
size
in interface VectorStorage
public double get(int i)
get
in interface VectorStorage
i
- Vector element index.public <T extends Serializable> T getRaw(int i)
getRaw
in interface VectorStorage
T
- Type of stored element in vector.i
- Vector element index.public void set(int i, double v)
set
in interface VectorStorage
i
- Vector element index.v
- Value to set at given index.public void setRaw(int i, Serializable v)
setRaw
in interface VectorStorage
i
- Vector element index.v
- Value to set at given index.public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public boolean isDense()
isDense
in interface StorageOpsMetrics
public boolean isDistributed()
isDistributed
in interface StorageOpsMetrics
public boolean isArrayBased()
isArrayBased
in interface StorageOpsMetrics
public boolean isNumeric()
isNumeric
in interface StorageOpsMetrics
public double[] data()
StorageOpsMetrics.isArrayBased()
returns true
and all values
in vector are Numbers.
Returns null
if in other cases.data
in interface VectorStorage
StorageOpsMetrics.isArrayBased()
public Serializable[] rawData()
rawData
in interface VectorStorage
StorageOpsMetrics.isArrayBased()
returns true
.
Returns null
if in other cases.public it.unimi.dsi.fastutil.ints.IntSet indexes()
GridGain In-Memory Computing Platform : ver. 8.9.19 Release Date : April 10 2025