public class DoubleVectorDataSparse extends DoubleVectorData
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.
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, zSum
public DoubleVectorDataSparse(double[] 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 DoubleVectorDataDense toDense()
toDense
in class DoubleVectorData
public final int size()
size
in class DoubleVectorData
public final double getSI(int index)
getSI
in class DoubleVectorData
index
- the index to get the value forpublic final void setSI(int index, double valueSI)
setSI
in class DoubleVectorData
index
- the index to set the value forvalueSI
- the value at the indexpublic final double[] getDenseVectorSI()
getDenseVectorSI
in class DoubleVectorData
public final DoubleVectorDataSparse copy()
copy
in class DoubleVectorData
public static DoubleVectorDataSparse instantiate(double[] valuesSI)
valuesSI
- the (SI) values to storepublic final void incrementBy(DoubleVectorData right) throws ValueException
incrementBy
in class DoubleVectorData
right
- the other data object to addValueException
- if vectors have different lengthspublic final void decrementBy(DoubleVectorData right) throws ValueException
decrementBy
in class DoubleVectorData
right
- the other data object to subtractValueException
- if vectors have different lengthspublic final void multiplyBy(DoubleVectorData right) throws ValueException
multiplyBy
in class DoubleVectorData
right
- the other data object to multiply withValueException
- if vectors have different lengthspublic final void divideBy(DoubleVectorData right) throws ValueException
divideBy
in class DoubleVectorData
right
- the other data object to divide byValueException
- if vectors have different lengthspublic int hashCode()
hashCode
in class DoubleVectorData
public boolean equals(Object obj)
equals
in class DoubleVectorData
Copyright © 2015–2018 Delft University of Technology. All rights reserved.