public class MutableLinearDensityVector extends AbstractMutableDoubleVectorRel<LinearDensityUnit,LinearDensityVector,MutableLinearDensityVector,LinearDensity>
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
AbstractDoubleVectorRel.Itr
data
Constructor and Description |
---|
MutableLinearDensityVector(double[] values,
LinearDensityUnit unit,
StorageType storageType)
Construct a new Relative Immutable Double LinearDensityVector.
|
MutableLinearDensityVector(DoubleVectorData data,
LinearDensityUnit unit) |
MutableLinearDensityVector(LinearDensity[] values,
StorageType storageType)
Construct a new Relative Immutable Double LinearDensityVector.
|
MutableLinearDensityVector(List<Double> values,
LinearDensityUnit unit,
StorageType storageType)
Construct a new Relative Immutable Double LinearDensityVector.
|
MutableLinearDensityVector(List<LinearDensity> values,
StorageType storageType)
Construct a new Relative Immutable Double LinearDensityVector.
|
MutableLinearDensityVector(SortedMap<Integer,Double> values,
LinearDensityUnit unit,
int length,
StorageType storageType)
Construct a new Relative Immutable Double LinearDensityVector.
|
MutableLinearDensityVector(SortedMap<Integer,LinearDensity> values,
int length,
StorageType storageType)
Construct a new Relative Immutable Double LinearDensityVector.
|
Modifier and Type | Method and Description |
---|---|
protected MutableLinearDensityVector |
instantiateMutableType(DoubleVectorData dvd,
LinearDensityUnit unit)
Construct a new Relative Mutable DoubleVector of the right type.
|
protected LinearDensity |
instantiateScalar(double value,
LinearDensityUnit unit)
Construct a new Relative Immutable DoubleScalar of the right type.
|
protected LinearDensityVector |
instantiateType(DoubleVectorData dvd,
LinearDensityUnit unit)
Construct a new Relative Immutable DoubleVector of the right type.
|
LinearDensity[] |
toArray()
Return an array of LinearDensity Scalars from this vector.
|
MutableLinearDensityVector |
toDense()
return a dense version of this vector.
|
MutableLinearDensityVector |
toSparse()
return a sparse version of this vector.
|
abs, assign, ceil, checkCopyOnWrite, copy, decrementBy, decrementBy, decrementBy, divideBy, divideBy, divideBy, floor, immutable, incrementBy, incrementBy, incrementBy, multiplyBy, multiplyBy, multiplyBy, mutable, neg, normalize, rint, round, set, setCopyOnWrite, setInUnit, setSI
checkUnit, checkUnit, checkUnit, divide, get, iterator, minus, 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, setDisplayUnit
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
DIV, MULT, POW
cardinality, get, getInUnit, getInUnit, getSI, getValuesInUnit, getValuesInUnit, getValuesSI, size, toString, toString, toString, toString, zSum
forEach, spliterator
public MutableLinearDensityVector(double[] values, LinearDensityUnit unit, StorageType storageType) throws ValueException
values
- double[]; the values of the entries in the new Relative Immutable Double LinearDensityVectorunit
- LinearDensityUnit; the unit of the new Relative Immutable Double LinearDensityVectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullpublic MutableLinearDensityVector(List<Double> values, LinearDensityUnit unit, StorageType storageType) throws ValueException
values
- List<Double>; the values of the entries in the new Relative Immutable Double LinearDensityVectorunit
- LinearDensityUnit; the unit of the new Relative Immutable Double LinearDensityVectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullpublic MutableLinearDensityVector(LinearDensity[] values, StorageType storageType) throws ValueException
values
- LinearDensity[]; the values of the entries in the new Relative Immutable Double LinearDensityVectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic MutableLinearDensityVector(List<LinearDensity> values, StorageType storageType) throws ValueException
values
- List<LinearDensity>; the values of the entries in the new Relative Immutable Double
LinearDensityVectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic MutableLinearDensityVector(SortedMap<Integer,LinearDensity> values, int length, StorageType storageType) throws ValueException
values
- SortedMap<Integer, LinearDensity>; the values of the entries in the new Relative Sparse Mutable
Double LinearDensityVectorlength
- int; the size of the vectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic MutableLinearDensityVector(SortedMap<Integer,Double> values, LinearDensityUnit unit, int length, StorageType storageType) throws ValueException
values
- SortedMap<Integer, Double>; the map of indexes to values of the Relative Sparse Mutable Double
LinearDensityVectorunit
- LinearDensityUnit; the unit of the new Relative Sparse Mutable Double LinearDensityVectorlength
- int; the size of the vectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullMutableLinearDensityVector(DoubleVectorData data, LinearDensityUnit unit)
data
- DoubleVectorData; an internal data objectunit
- LinearDensityUnit; the unitprotected final LinearDensityVector instantiateType(DoubleVectorData dvd, LinearDensityUnit unit)
instantiateType
in class AbstractDoubleVectorRel<LinearDensityUnit,LinearDensityVector,MutableLinearDensityVector,LinearDensity>
dvd
- DoubleVectorData; an internal data objectunit
- U; the unitprotected final MutableLinearDensityVector instantiateMutableType(DoubleVectorData dvd, LinearDensityUnit unit)
instantiateMutableType
in class AbstractDoubleVectorRel<LinearDensityUnit,LinearDensityVector,MutableLinearDensityVector,LinearDensity>
dvd
- DoubleVectorData; an internal data objectunit
- U; the unitprotected final LinearDensity instantiateScalar(double value, LinearDensityUnit unit)
instantiateScalar
in class AbstractDoubleVectorRel<LinearDensityUnit,LinearDensityVector,MutableLinearDensityVector,LinearDensity>
value
- double; the valueunit
- U; the unitpublic final MutableLinearDensityVector toDense()
public final MutableLinearDensityVector toSparse()
public LinearDensity[] toArray()
RuntimeException
- wrapping a ValueException on error getting one of the valuesCopyright © 2015–2019 Delft University of Technology. All rights reserved.