public class DimensionlessVector extends AbstractDoubleVectorRel<DimensionlessUnit,DimensionlessVector,MutableDimensionlessVector,Dimensionless>
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 |
---|
DimensionlessVector(Dimensionless[] values,
StorageType storageType)
Construct a new Relative Immutable Double DimensionlessVector.
|
DimensionlessVector(double[] values,
DimensionlessUnit unit,
StorageType storageType)
Construct a new Relative Immutable Double DimensionlessVector.
|
DimensionlessVector(DoubleVectorData data,
DimensionlessUnit unit) |
DimensionlessVector(List<Dimensionless> values,
StorageType storageType)
Construct a new Relative Immutable Double DimensionlessVector.
|
DimensionlessVector(List<Double> values,
DimensionlessUnit unit,
StorageType storageType)
Construct a new Relative Immutable Double DimensionlessVector.
|
DimensionlessVector(SortedMap<Integer,Dimensionless> values,
int length,
StorageType storageType)
Construct a new Relative Immutable Double DimensionlessVector.
|
DimensionlessVector(SortedMap<Integer,Double> values,
DimensionlessUnit unit,
int length,
StorageType storageType)
Construct a new Relative Immutable Double DimensionlessVector.
|
Modifier and Type | Method and Description |
---|---|
protected MutableDimensionlessVector |
instantiateMutableType(DoubleVectorData dvd,
DimensionlessUnit unit)
Construct a new Relative Mutable DoubleVector of the right type.
|
protected Dimensionless |
instantiateScalar(double value,
DimensionlessUnit unit)
Construct a new Relative Immutable DoubleScalar of the right type.
|
protected DimensionlessVector |
instantiateType(DoubleVectorData dvd,
DimensionlessUnit unit)
Construct a new Relative Immutable DoubleVector of the right type.
|
DimensionlessVector |
toDense()
return a dense version of this vector.
|
DimensionlessVector |
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 DimensionlessVector(double[] values, DimensionlessUnit unit, StorageType storageType) throws ValueException
values
- double[]; the values of the entries in the new Relative Immutable Double DimensionlessVectorunit
- U; the unit of the new Relative Immutable Double DimensionlessVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullpublic DimensionlessVector(List<Double> values, DimensionlessUnit unit, StorageType storageType) throws ValueException
values
- List; the values of the entries in the new Relative Immutable Double DimensionlessVectorunit
- U; the unit of the new Relative Immutable Double DimensionlessVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullpublic DimensionlessVector(Dimensionless[] values, StorageType storageType) throws ValueException
values
- DoubleScalar.Rel<U>[]; the values of the entries in the new Relative Immutable Double
DimensionlessVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic DimensionlessVector(List<Dimensionless> values, StorageType storageType) throws ValueException
values
- List; the values of the entries in the new Relative Immutable Double DimensionlessVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic DimensionlessVector(SortedMap<Integer,Dimensionless> values, int length, StorageType storageType) throws ValueException
values
- DoubleScalar.Rel<U>[]; the values of the entries in the new Relative Sparse Mutable Double
DimensionlessVectorlength
- the size of the vectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic DimensionlessVector(SortedMap<Integer,Double> values, DimensionlessUnit unit, int length, StorageType storageType) throws ValueException
values
- Map; the map of indexes to values of the Relative Sparse Mutable Double DimensionlessVectorunit
- U; the unit of the new Relative Sparse Mutable Double DimensionlessVectorlength
- the size of the vectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullDimensionlessVector(DoubleVectorData data, DimensionlessUnit unit)
data
- an internal data objectunit
- the unitprotected final DimensionlessVector instantiateType(DoubleVectorData dvd, DimensionlessUnit unit)
instantiateType
in class AbstractDoubleVectorRel<DimensionlessUnit,DimensionlessVector,MutableDimensionlessVector,Dimensionless>
dvd
- an internal data objectunit
- the unitprotected final MutableDimensionlessVector instantiateMutableType(DoubleVectorData dvd, DimensionlessUnit unit)
instantiateMutableType
in class AbstractDoubleVectorRel<DimensionlessUnit,DimensionlessVector,MutableDimensionlessVector,Dimensionless>
dvd
- an internal data objectunit
- the unitprotected final Dimensionless instantiateScalar(double value, DimensionlessUnit unit)
instantiateScalar
in class AbstractDoubleVectorRel<DimensionlessUnit,DimensionlessVector,MutableDimensionlessVector,Dimensionless>
value
- the valueunit
- the unitpublic final DimensionlessVector toDense()
public final DimensionlessVector toSparse()
Copyright © 2015–2017 Delft University of Technology. All rights reserved.