U
- the unitpublic interface FloatVectorInterface<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).
|
float |
getInUnit(int index)
Retrieve the value stored at a specified position in the original unit.
|
float |
getInUnit(int index,
U targetUnit)
Retrieve the value stored at a specified position converted into a specified unit.
|
float |
getSI(int index)
Retrieve the value stored at a specified position in the standard SI unit.
|
float[] |
getValuesInUnit()
Create a float[] array filled with the values in the original unit.
|
float[] |
getValuesInUnit(U targetUnit)
Create a float[] array filled with the values converted into a specified unit.
|
float[] |
getValuesSI()
Create a float[] array filled with the values in the standard SI unit.
|
MutableFloatVectorInterface<U> |
mutable()
return a mutable version of this vector.
|
int |
size()
Retrieve the size of the vector.
|
FloatVectorInterface<U> |
toDense()
return a dense version of this vector.
|
FloatVectorInterface<U> |
toSparse()
return a sparse version of this vector.
|
String |
toString() |
String |
toString(boolean verbose,
boolean withUnit)
Print this FloatVector with optional type and unit information.
|
String |
toString(U displayUnit)
Print this FloatVector with the values expressed in the specified unit.
|
String |
toString(U displayUnit,
boolean verbose,
boolean withUnit)
Print this FloatVector with the values expressed in the specified unit.
|
float |
zSum()
Compute the sum of all values of this vector.
|
int size()
int cardinality()
float getSI(int index) throws ValueException
index
- int; index of the value to retrieveValueException
- when index out of range (index < 0 or index >= size())float getInUnit(int index) throws ValueException
index
- int; index of the value to retrieveValueException
- when index out of range (index < 0 or index >= size())float 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())MutableFloatVectorInterface<U> mutable()
FloatVectorInterface<U> toSparse()
FloatVectorInterface<U> toDense()
float zSum()
float[] getValuesSI()
float[] getValuesInUnit()
float[] 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.