public class DoubleVectorDataSparse extends DoubleVectorData
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.
PARALLEL_THRESHOLD, vectorSI| Constructor and Description |
|---|
DoubleVectorDataSparse(double[] vectorSI,
int[] indices,
int size)
Create a vector with sparse data.
|
| Modifier and Type | Method and Description |
|---|---|
DoubleVectorDataSparse |
copy() |
void |
decrementBy(DoubleVectorData right)
Subtract a vector from this vector on a cell-by-cell basis.
|
void |
divideBy(DoubleVectorData right)
Divide the values of a vector by the values of another vector on a cell-by-cell basis.
|
boolean |
equals(Object obj) |
double[] |
getDenseVectorSI() |
double |
getSI(int index) |
int |
hashCode() |
void |
incrementBy(DoubleVectorData right)
Add a vector to this vector on a cell-by-cell basis.
|
static DoubleVectorDataSparse |
instantiate(double[] valuesSI)
Instantiate a DoubleVectorDataSparse from an array.
|
void |
multiplyBy(DoubleVectorData right)
Multiply a vector with the values of another vector on a cell-by-cell basis.
|
void |
setSI(int index,
double valueSI)
Sets a value at the index in the vector.
|
int |
size() |
DoubleVectorDataDense |
toDense() |
cardinality, decrementBy, divide, divideBy, getStorageType, incrementBy, instantiate, instantiate, instantiate, instantiate, instantiateLD, instantiateMD, isDense, isSparse, minus, multiplyBy, plus, times, toSparse, toString, zSumpublic DoubleVectorDataSparse(double[] vectorSI,
int[] indices,
int size)
vectorSI - double[]; 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 DoubleVectorDataDense toDense()
toDense in class DoubleVectorDatapublic final int size()
size in class DoubleVectorDatapublic final double getSI(int index)
getSI in class DoubleVectorDataindex - int; the index to get the value forpublic final void setSI(int index,
double valueSI)
setSI in class DoubleVectorDataindex - int; the index to set the value forvalueSI - double; the value at the indexpublic final double[] getDenseVectorSI()
getDenseVectorSI in class DoubleVectorDatapublic final DoubleVectorDataSparse copy()
copy in class DoubleVectorDatapublic static DoubleVectorDataSparse instantiate(double[] valuesSI)
valuesSI - double[]; the (SI) values to storepublic final void incrementBy(DoubleVectorData right) throws ValueException
incrementBy in class DoubleVectorDataright - DoubleVectorData; the other data object to addValueException - if vectors have different lengthspublic final void decrementBy(DoubleVectorData right) throws ValueException
decrementBy in class DoubleVectorDataright - DoubleVectorData; the other data object to subtractValueException - if vectors have different lengthspublic final void multiplyBy(DoubleVectorData right) throws ValueException
multiplyBy in class DoubleVectorDataright - DoubleVectorData; the other data object to multiply withValueException - if vectors have different lengthspublic final void divideBy(DoubleVectorData right) throws ValueException
divideBy in class DoubleVectorDataright - DoubleVectorData; the other data object to divide byValueException - if vectors have different lengthspublic int hashCode()
hashCode in class DoubleVectorDatapublic boolean equals(Object obj)
equals in class DoubleVectorDataCopyright © 2015–2019 Delft University of Technology. All rights reserved.