public class FloatVectorDataSparse extends FloatVectorData
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
vectorSI
Constructor and Description |
---|
FloatVectorDataSparse(float[] vectorSI,
int[] indices,
int size)
Create a vector with sparse data.
|
Modifier and Type | Method and Description |
---|---|
FloatVectorDataSparse |
copy() |
void |
decrementBy(FloatVectorData right)
Subtract a vector from this vector on a cell-by-cell basis.
|
void |
divideBy(FloatVectorData right)
Divide the values of a vector by the values of another vector on a cell-by-cell basis.
|
boolean |
equals(Object obj) |
float[] |
getDenseVectorSI() |
float |
getSI(int index) |
int |
hashCode() |
void |
incrementBy(FloatVectorData right)
Add a vector to this vector on a cell-by-cell basis.
|
static FloatVectorDataSparse |
instantiate(float[] valuesSI)
Instantiate a FloatVectorDataSparse from an array.
|
void |
multiplyBy(FloatVectorData right)
Multiply a vector with the values of another vector on a cell-by-cell basis.
|
void |
setSI(int index,
float valueSI)
Sets a value at the index in the vector.
|
int |
size() |
FloatVectorDataDense |
toDense() |
cardinality, decrementBy, divide, divideBy, getStorageType, incrementBy, instantiate, instantiate, instantiate, instantiate, instantiateLD, instantiateMD, isDense, isSparse, minus, multiplyBy, plus, times, toSparse, toString, zSum
public FloatVectorDataSparse(float[] vectorSI, int[] indices, int size)
vectorSI
- float[]; the data to storeindices
- int[]; the index values of the Vectorsize
- int; the length of the vector (padded with 0 after highest index in indices)public final FloatVectorDataDense toDense()
toDense
in class FloatVectorData
public final int size()
size
in class FloatVectorData
public final float getSI(int index)
getSI
in class FloatVectorData
index
- int; the index to get the value forpublic final void setSI(int index, float valueSI)
setSI
in class FloatVectorData
index
- int; the index to set the value forvalueSI
- float; the value at the indexpublic final float[] getDenseVectorSI()
getDenseVectorSI
in class FloatVectorData
public final FloatVectorDataSparse copy()
copy
in class FloatVectorData
public static FloatVectorDataSparse instantiate(float[] valuesSI)
valuesSI
- float[]; the (SI) values to storepublic final void incrementBy(FloatVectorData right) throws ValueException
incrementBy
in class FloatVectorData
right
- FloatVectorData; the other data object to addValueException
- if vectors have different lengthspublic final void decrementBy(FloatVectorData right) throws ValueException
decrementBy
in class FloatVectorData
right
- FloatVectorData; the other data object to subtractValueException
- if vectors have different lengthspublic final void multiplyBy(FloatVectorData right) throws ValueException
multiplyBy
in class FloatVectorData
right
- FloatVectorData; the other data object to multiply withValueException
- if vectors have different lengthspublic final void divideBy(FloatVectorData right) throws ValueException
divideBy
in class FloatVectorData
right
- FloatVectorData; the other data object to divide byValueException
- if vectors have different lengthspublic int hashCode()
hashCode
in class FloatVectorData
public boolean equals(Object obj)
equals
in class FloatVectorData
Copyright © 2015–2019 Delft University of Technology. All rights reserved.