public class FloatVectorDataSparse extends FloatVectorData
Copyright (c) 2013-2018 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, zSumpublic FloatVectorDataSparse(float[] vectorSI,
int[] indices,
int size)
vectorSI - the data to storeindices - the index values of the Vectorsize - the length of the vector (padded with 0 after highest index in indices)public final FloatVectorDataDense toDense()
toDense in class FloatVectorDatapublic final int size()
size in class FloatVectorDatapublic final float getSI(int index)
getSI in class FloatVectorDataindex - the index to get the value forpublic final void setSI(int index,
float valueSI)
setSI in class FloatVectorDataindex - the index to set the value forvalueSI - the value at the indexpublic final float[] getDenseVectorSI()
getDenseVectorSI in class FloatVectorDatapublic final FloatVectorDataSparse copy()
copy in class FloatVectorDatapublic static FloatVectorDataSparse instantiate(float[] valuesSI)
valuesSI - the (SI) values to storepublic final void incrementBy(FloatVectorData right) throws ValueException
incrementBy in class FloatVectorDataright - the other data object to addValueException - if vectors have different lengthspublic final void decrementBy(FloatVectorData right) throws ValueException
decrementBy in class FloatVectorDataright - the other data object to subtractValueException - if vectors have different lengthspublic final void multiplyBy(FloatVectorData right) throws ValueException
multiplyBy in class FloatVectorDataright - the other data object to multiply withValueException - if vectors have different lengthspublic final void divideBy(FloatVectorData right) throws ValueException
divideBy in class FloatVectorDataright - the other data object to divide byValueException - if vectors have different lengthspublic int hashCode()
hashCode in class FloatVectorDatapublic boolean equals(Object obj)
equals in class FloatVectorDataCopyright © 2015–2018 Delft University of Technology. All rights reserved.