All Implemented Interfaces:
`Serializable`, `Cloneable`

```public class FloatVectorDataDense
extends FloatVectorData```
Stores dense data for a FloatVector and carries out basic operations.

Author:
Alexander Verbraeck, Peter Knoppers
Serialized Form
• ## Field Summary

### Fields inherited from class org.djunits.value.vfloat.vector.data.FloatVectorData

`vectorSI`
• ## Constructor Summary

Constructors
Constructor Description
`FloatVectorDataDense​(float[] vectorSI)`
Create a vector with dense data.
• ## Method Summary

Modifier and Type Method Description
`FloatVectorDataDense` `assign​(FloatFunction floatFunction)`
Apply an operation to each cell.
`FloatVectorDataDense` ```assign​(FloatFunction2 floatFunction2, FloatVectorData right)```
Apply a binary operation on a cell by cell basis.
`int` `cardinality()`
Compute and return the number of non-zero cells in this indexed value.
`FloatVectorDataDense` `copy()`
Create and return a deep copy of the data.
`FloatVectorData` `divide​(FloatVectorData right)`
Divide two vectors on a cell-by-cell basis.
`float[]` `getDenseVectorSI()`
Create and return a dense copy of the data.
`float` `getSI​(int index)`
Retrieve the SI value of one element of this data.
`FloatVectorDataDense` `minus​(FloatVectorData right)`
Subtract two vectors on a cell-by-cell basis.
`FloatVectorDataDense` `plus​(FloatVectorData right)`
Add two vectors on a cell-by-cell basis.
`void` ```setSI​(int index, float valueSI)```
Sets a value at the index in the vector.
`int` `size()`
Retrieve the size of the vector.
`FloatVectorData` `times​(FloatVectorData right)`
Multiply two vector on a cell-by-cell basis.
`FloatVectorDataDense` `toDense()`
Return the densely stored equivalent of this data.
`FloatVectorDataSparse` `toSparse()`
Return the sparsely stored equivalent of this data.

### Methods inherited from class org.djunits.value.vfloat.vector.data.FloatVectorData

`checkSizes, compareDenseVectorWithSparseVector, decrementBy, divideBy, equals, hashCode, incrementBy, instantiate, instantiate, instantiate, instantiate, instantiateList, instantiateMap, multiplyBy, toString, zSum`

### Methods inherited from class org.djunits.value.storage.AbstractStorage

`getStorageType, isDense, isSparse`

### Methods inherited from class java.lang.Object

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

Create a vector with dense data.
Parameters:
`vectorSI` - float[]; the data to store
• ## Method Details

• ### cardinality

public final int cardinality()
Compute and return the number of non-zero cells in this indexed value.
Specified by:
`cardinality` in class `AbstractStorage<FloatVectorData>`
Returns:
int; the number of non-zero cells
• ### assign

Apply an operation to each cell.
Specified by:
`assign` in class `FloatVectorData`
Parameters:
`floatFunction` - FloatFunction; the operation to apply
Returns:
FloatVectorData; this (modified) float vector data object
• ### assign

public final FloatVectorDataDense assign​(FloatFunction2 floatFunction2, FloatVectorData right)
Apply a binary operation on a cell by cell basis.
Specified by:
`assign` in class `FloatVectorData`
Parameters:
`floatFunction2` - FloatFunction2; the binary operation to apply
`right` - FloatVectorData; the right operand for the binary operation
Returns:
DoubleMatrixData; this (modified) float vector data object
• ### toDense

Return the densely stored equivalent of this data.
Specified by:
`toDense` in class `FloatVectorData`
Returns:
FloatVectorDataDense; the dense transformation of this data
• ### toSparse

public final FloatVectorDataSparse toSparse()
Return the sparsely stored equivalent of this data.
Specified by:
`toSparse` in class `FloatVectorData`
Returns:
FloatVectorDataSparse; the sparse transformation of this data
• ### size

public final int size()
Retrieve the size of the vector.
Specified by:
`size` in class `FloatVectorData`
Returns:
int; the size of the vector
• ### getSI

public final float getSI​(int index)
Retrieve the SI value of one element of this data.
Specified by:
`getSI` in class `FloatVectorData`
Parameters:
`index` - int; the index to get the value for
Returns:
the value at the index
• ### setSI

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

public final float[] getDenseVectorSI()
Create and return a dense copy of the data.
Specified by:
`getDenseVectorSI` in class `FloatVectorData`
Returns:
float[]; a safe copy of VectorSI
• ### copy

Create and return a deep copy of the data.
Specified by:
`copy` in class `AbstractStorage<FloatVectorData>`
Returns:
T; a deep copy of the data
• ### plus

Add two vectors on a cell-by-cell basis. If both vectors are sparse, a sparse vector is returned, otherwise a dense vector is returned.
Specified by:
`plus` in class `FloatVectorData`
Parameters:
`right` - FloatVectorData; the other data object to add
Returns:
FloatVectorData; the sum of this data object and the other data object
• ### minus

Subtract two vectors on a cell-by-cell basis. If both vectors are sparse, a sparse vector is returned, otherwise a dense vector is returned.
Specified by:
`minus` in class `FloatVectorData`
Parameters:
`right` - FloatVectorData; the other data object to subtract
Returns:
FloatVectorData; the difference of this data object and the other data object
• ### times

public final FloatVectorData times​(FloatVectorData right)
Multiply two vector on a cell-by-cell basis. If both vectors are dense, a dense vector is returned, otherwise a sparse vector is returned.
Specified by:
`times` in class `FloatVectorData`
Parameters:
`right` - FloatVectorData; the other data object to multiply with
Returns:
FloatVectorData; a new double vector data store holding the result of the multiplications
• ### divide

public final FloatVectorData divide​(FloatVectorData right)
Divide two vectors on a cell-by-cell basis. If this vector is sparse and `right` is dense, a sparse vector is returned, otherwise a dense vector is returned.
Specified by:
`divide` in class `FloatVectorData`
Parameters:
`right` - FloatVectorData; the other data object to divide by
Returns:
FloatVectorData; the ratios of the values of this data object and the other data object