org.djunits.value.vdouble.vector

• ```public class DoubleVectorDataDense
extends DoubleVectorData```
Stores dense data for a DoubleVector and carries out basic operations.

\$LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) \$, @version \$Revision: 1147 \$, by \$Author: averbraeck \$, initial version Oct 3, 2015
Author:
Alexander Verbraeck, Peter Knoppers

• ### Fields inherited from class org.djunits.value.vdouble.vector.DoubleVectorData

`PARALLEL_THRESHOLD, vectorSI`
• ### Constructor Summary

Constructors
Constructor and Description
`DoubleVectorDataDense(double[] vectorSI)`
Create a vector with dense data.
• ### Method Summary

All Methods
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()`
• ### Methods inherited from class org.djunits.value.vdouble.vector.DoubleVectorData

`cardinality, decrementBy, divide, divideBy, equals, getStorageType, hashCode, incrementBy, instantiate, instantiate, instantiate, instantiate, instantiateLD, instantiateMD, isDense, isSparse, minus, multiplyBy, plus, times, toDense, toString, zSum`
• ### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`
• ### Constructor Detail

`public DoubleVectorDataDense(double[] vectorSI)`
Create a vector with dense data.
Parameters:
`vectorSI` - the data to store
• ### Method Detail

• #### assign

`public final void assign(DoubleFunction doubleFunction)`
Parameters:
`doubleFunction` - the function to apply on the (mutable) data elements
• #### toSparse

`public final DoubleVectorDataSparse toSparse()`
Overrides:
`toSparse` in class `DoubleVectorData`
Returns:
the sparse transformation of this data
• #### size

`public final int size()`
Specified by:
`size` in class `DoubleVectorData`
Returns:
the size of the vector
• #### getSI

`public final double getSI(int index)`
Specified by:
`getSI` in class `DoubleVectorData`
Parameters:
`index` - the index to get the value for
Returns:
the value at the index
• #### setSI

```public final void setSI(int index,
double valueSI)```
Sets a value at the index in the vector.
Specified by:
`setSI` in class `DoubleVectorData`
Parameters:
`index` - the index to set the value for
`valueSI` - the value at the index
• #### getDenseVectorSI

`public final double[] getDenseVectorSI()`
Specified by:
`getDenseVectorSI` in class `DoubleVectorData`
Returns:
a safe copy of VectorSI
• #### copy

`public final DoubleVectorDataDense copy()`
Specified by:
`copy` in class `DoubleVectorData`
Returns:
a deep copy of the data.
• #### incrementBy

```public final void incrementBy(DoubleVectorData right)
throws ValueException```
Add a vector to this vector on a cell-by-cell basis. The type of vector (sparse, dense) stays the same.
Specified by:
`incrementBy` in class `DoubleVectorData`
Parameters:
`right` - the other data object to add
Throws:
`ValueException` - if vectors have different lengths
• #### decrementBy

```public final void decrementBy(DoubleVectorData right)
throws ValueException```
Subtract a vector from this vector on a cell-by-cell basis. The type of vector (sparse, dense) stays the same.
Specified by:
`decrementBy` in class `DoubleVectorData`
Parameters:
`right` - the other data object to subtract
Throws:
`ValueException` - if vectors have different lengths
• #### multiplyBy

```public final void multiplyBy(DoubleVectorData right)
throws ValueException```
Multiply a vector with the values of another vector on a cell-by-cell basis. The type of vector (sparse, dense) stays the same.
Specified by:
`multiplyBy` in class `DoubleVectorData`
Parameters:
`right` - the other data object to multiply with
Throws:
`ValueException` - if vectors have different lengths
• #### divideBy

```public final void divideBy(DoubleVectorData right)
throws ValueException```
Divide the values of a vector by the values of another vector on a cell-by-cell basis. The type of vector (sparse, dense) stays the same.
Specified by:
`divideBy` in class `DoubleVectorData`
Parameters:
`right` - the other data object to divide by
Throws:
`ValueException` - if vectors have different lengths