U
- the unitpublic interface DoubleVectorInterface<U extends Unit<U>>
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.
Modifier and Type | Method and Description |
---|---|
int |
cardinality()
Count the number of cells that have a non-zero value (ignores tolerance).
|
AbstractDoubleScalar<U,?> |
get(int index)
Retrieve a value from the vector.
|
double |
getInUnit(int index)
Retrieve the value stored at a specified position in the original unit.
|
double |
getInUnit(int index,
U targetUnit)
Retrieve the value stored at a specified position converted into a specified unit.
|
double |
getSI(int index)
Retrieve the value stored at a specified position in the standard SI unit.
|
double[] |
getValuesInUnit()
Create a double[] array filled with the values in the original unit.
|
double[] |
getValuesInUnit(U targetUnit)
Create a double[] array filled with the values converted into a specified unit.
|
double[] |
getValuesSI()
Create a double[] array filled with the values in the standard SI unit.
|
MutableDoubleVectorInterface<U> |
mutable()
return a mutable version of this vector.
|
int |
size()
Retrieve the size of the vector.
|
DoubleVectorInterface<U> |
toDense()
return a dense version of this vector.
|
DoubleVectorInterface<U> |
toSparse()
return a sparse version of this vector.
|
String |
toString() |
String |
toString(boolean verbose,
boolean withUnit)
Print this DoubleVector with optional type and unit information.
|
String |
toString(U displayUnit)
Print this DoubleVector with the values expressed in the specified unit.
|
String |
toString(U displayUnit,
boolean verbose,
boolean withUnit)
Print this DoubleVector with the values expressed in the specified unit.
|
double |
zSum()
Compute the sum of all values of this vector.
|
int size()
int cardinality()
AbstractDoubleScalar<U,?> get(int index) throws ValueException
index
- int; the index to retrieve the value atValueException
- in case index is out of boundsdouble getSI(int index) throws ValueException
index
- int; index of the value to retrieveValueException
- when index out of range (index < 0 or index >= size())double getInUnit(int index) throws ValueException
index
- int; index of the value to retrieveValueException
- when index out of range (index < 0 or index >= size())double getInUnit(int index, U targetUnit) throws ValueException
index
- int; index of the value to retrievetargetUnit
- U; the unit for the resultValueException
- when index out of range (index < 0 or index >= size())MutableDoubleVectorInterface<U> mutable()
DoubleVectorInterface<U> toSparse()
DoubleVectorInterface<U> toDense()
double zSum()
double[] getValuesSI()
double[] getValuesInUnit()
double[] getValuesInUnit(U targetUnit)
targetUnit
- U; the unit into which the values are converted for useString toString()
String toString(U displayUnit)
displayUnit
- U; the unit into which the values are converted for displayString toString(boolean verbose, boolean withUnit)
verbose
- boolean; if true; include type info; if false; exclude type infowithUnit
- boolean; if true; include the unit; of false; exclude the unitString toString(U displayUnit, boolean verbose, boolean withUnit)
displayUnit
- U; the unit into which the values are converted for displayverbose
- boolean; if true; include type info; if false; exclude type infowithUnit
- boolean; if true; include the unit; of false; exclude the unitCopyright © 2015–2019 Delft University of Technology. All rights reserved.