public class DimensionlessVector extends AbstractDoubleVectorRel<DimensionlessUnit,DimensionlessVector,MutableDimensionlessVector,Dimensionless>
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 |
---|
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.
|
Dimensionless[] |
toArray()
Return an array of Dimensionless Scalars from this vector.
|
DimensionlessVector |
toDense()
return a dense version of this vector.
|
DimensionlessVector |
toSparse()
return a sparse version of this vector.
|
checkUnit, checkUnit, checkUnit, divide, get, iterator, 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, setDisplayUnit
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public DimensionlessVector(double[] values, DimensionlessUnit unit, StorageType storageType) throws ValueException
values
- double[]; the values of the entries in the new Relative Immutable Double DimensionlessVectorunit
- DimensionlessUnit; the unit of the new Relative Immutable Double DimensionlessVectorstorageType
- StorageType; 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<Double>; the values of the entries in the new Relative Immutable Double DimensionlessVectorunit
- DimensionlessUnit; the unit of the new Relative Immutable Double DimensionlessVectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullpublic DimensionlessVector(Dimensionless[] values, StorageType storageType) throws ValueException
values
- Dimensionless[]; the values of the entries in the new Relative Immutable Double DimensionlessVectorstorageType
- StorageType; 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<Dimensionless>; the values of the entries in the new Relative Immutable Double
DimensionlessVectorstorageType
- StorageType; 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
- SortedMap<Integer, Dimensionless>; the values of the entries in the new Relative Sparse Mutable
Double DimensionlessVectorlength
- int; the size of the vectorstorageType
- StorageType; 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
- SortedMap<Integer, Double>; the map of indexes to values of the Relative Sparse Mutable Double
DimensionlessVectorunit
- DimensionlessUnit; the unit of the new Relative Sparse Mutable Double DimensionlessVectorlength
- int; the size of the vectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullDimensionlessVector(DoubleVectorData data, DimensionlessUnit unit)
data
- DoubleVectorData; an internal data objectunit
- DimensionlessUnit; the unitprotected final DimensionlessVector instantiateType(DoubleVectorData dvd, DimensionlessUnit unit)
instantiateType
in class AbstractDoubleVectorRel<DimensionlessUnit,DimensionlessVector,MutableDimensionlessVector,Dimensionless>
dvd
- DoubleVectorData; an internal data objectunit
- U; the unitprotected final MutableDimensionlessVector instantiateMutableType(DoubleVectorData dvd, DimensionlessUnit unit)
instantiateMutableType
in class AbstractDoubleVectorRel<DimensionlessUnit,DimensionlessVector,MutableDimensionlessVector,Dimensionless>
dvd
- DoubleVectorData; an internal data objectunit
- U; the unitprotected final Dimensionless instantiateScalar(double value, DimensionlessUnit unit)
instantiateScalar
in class AbstractDoubleVectorRel<DimensionlessUnit,DimensionlessVector,MutableDimensionlessVector,Dimensionless>
value
- double; the valueunit
- U; the unitpublic final DimensionlessVector toDense()
public final DimensionlessVector toSparse()
public Dimensionless[] toArray()
RuntimeException
- wrapping a ValueException on error getting one of the valuesCopyright © 2015–2019 Delft University of Technology. All rights reserved.