public class FloatDensityVector extends AbstractFloatVectorRel<DensityUnit,FloatDensityVector,MutableFloatDensityVector,FloatDensity>
Copyright (c) 2013-2017 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
data
Constructor and Description |
---|
FloatDensityVector(float[] values,
DensityUnit unit,
StorageType storageType)
Construct a new Relative Immutable Float FloatDensityVector.
|
FloatDensityVector(FloatDensity[] values,
StorageType storageType)
Construct a new Relative Immutable Float FloatDensityVector.
|
FloatDensityVector(FloatVectorData data,
DensityUnit unit) |
FloatDensityVector(List<Float> values,
DensityUnit unit,
StorageType storageType)
Construct a new Relative Immutable Float FloatDensityVector.
|
FloatDensityVector(List<FloatDensity> values,
StorageType storageType)
Construct a new Relative Immutable Float FloatDensityVector.
|
FloatDensityVector(SortedMap<Integer,Float> values,
DensityUnit unit,
int length,
StorageType storageType)
Construct a new Relative Immutable Float FloatDensityVector.
|
FloatDensityVector(SortedMap<Integer,FloatDensity> values,
int length,
StorageType storageType)
Construct a new Relative Immutable Float FloatDensityVector.
|
Modifier and Type | Method and Description |
---|---|
protected MutableFloatDensityVector |
instantiateMutableType(FloatVectorData dvd,
DensityUnit unit)
Construct a new Relative Mutable FloatVector of the right type.
|
protected FloatDensity |
instantiateScalar(float value,
DensityUnit unit)
Construct a new Relative Immutable FloatScalar of the right type.
|
protected FloatDensityVector |
instantiateType(FloatVectorData dvd,
DensityUnit unit)
Construct a new Relative Immutable FloatVector of the right type.
|
FloatDensityVector |
toDense()
return a dense version of this vector.
|
FloatDensityVector |
toSparse()
return a sparse version of this vector.
|
checkUnit, checkUnit, checkUnit, divide, get, minus, mutable, plus, times
cardinality, checkIndex, checkSize, checkSize, equals, getData, getInUnit, getInUnit, getSI, getStorageType, getValuesInUnit, getValuesInUnit, getValuesSI, hashCode, size, toString, toString, toString, toString, zSum
expressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelative
public FloatDensityVector(float[] values, DensityUnit unit, StorageType storageType) throws ValueException
values
- float[]; the values of the entries in the new Relative Immutable Float FloatDensityVectorunit
- U; the unit of the new Relative Immutable Float FloatDensityVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullpublic FloatDensityVector(List<Float> values, DensityUnit unit, StorageType storageType) throws ValueException
values
- List; the values of the entries in the new Relative Immutable Float FloatDensityVectorunit
- U; the unit of the new Relative Immutable Float FloatDensityVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullpublic FloatDensityVector(FloatDensity[] values, StorageType storageType) throws ValueException
values
- FloatScalar.Rel<U>[]; the values of the entries in the new Relative Immutable Float
FloatDensityVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic FloatDensityVector(List<FloatDensity> values, StorageType storageType) throws ValueException
values
- List; the values of the entries in the new Relative Immutable Float FloatDensityVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic FloatDensityVector(SortedMap<Integer,FloatDensity> values, int length, StorageType storageType) throws ValueException
values
- FloatScalar.Rel<U>[]; the values of the entries in the new Relative Sparse Mutable Float
FloatDensityVectorlength
- the size of the vectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic FloatDensityVector(SortedMap<Integer,Float> values, DensityUnit unit, int length, StorageType storageType) throws ValueException
values
- Map; the map of indexes to values of the Relative Sparse Mutable Float FloatDensityVectorunit
- U; the unit of the new Relative Sparse Mutable Float FloatDensityVectorlength
- the size of the vectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullFloatDensityVector(FloatVectorData data, DensityUnit unit)
data
- an internal data objectunit
- the unitprotected final FloatDensityVector instantiateType(FloatVectorData dvd, DensityUnit unit)
instantiateType
in class AbstractFloatVectorRel<DensityUnit,FloatDensityVector,MutableFloatDensityVector,FloatDensity>
dvd
- an internal data objectunit
- the unitprotected final MutableFloatDensityVector instantiateMutableType(FloatVectorData dvd, DensityUnit unit)
instantiateMutableType
in class AbstractFloatVectorRel<DensityUnit,FloatDensityVector,MutableFloatDensityVector,FloatDensity>
dvd
- an internal data objectunit
- the unitprotected final FloatDensity instantiateScalar(float value, DensityUnit unit)
instantiateScalar
in class AbstractFloatVectorRel<DensityUnit,FloatDensityVector,MutableFloatDensityVector,FloatDensity>
value
- the valueunit
- the unitpublic final FloatDensityVector toDense()
public final FloatDensityVector toSparse()
Copyright © 2015–2017 Delft University of Technology. All rights reserved.