public class DoubleVectorDataDense 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 |
---|
DoubleVectorDataDense(double[] vectorSI)
Create a vector with dense data.
|
Modifier and Type | Method and Description |
---|---|
void |
assign(DoubleFunction doubleFunction) |
DoubleVectorDataDense |
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.
|
double[] |
getDenseVectorSI() |
double |
getSI(int index) |
void |
incrementBy(DoubleVectorData right)
Add a vector to this vector on a cell-by-cell basis.
|
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() |
DoubleVectorDataSparse |
toSparse() |
cardinality, decrementBy, divide, divideBy, equals, getStorageType, hashCode, incrementBy, instantiate, instantiate, instantiate, instantiate, instantiateLD, instantiateMD, isDense, isSparse, minus, multiplyBy, plus, times, toDense, toString, zSum
public DoubleVectorDataDense(double[] vectorSI)
vectorSI
- the data to storepublic final void assign(DoubleFunction doubleFunction)
doubleFunction
- the function to apply on the (mutable) data elementspublic final DoubleVectorDataSparse toSparse()
toSparse
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 DoubleVectorDataDense copy()
copy
in class DoubleVectorData
public 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 lengthsCopyright © 2015–2018 Delft University of Technology. All rights reserved.