U - the unitpublic interface DoubleVectorInterface<U extends Unit<U>>
Copyright (c) 2013-2015 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).
|
DoubleScalar<U> |
get(int index)
Retrieve the value stored at a specified index as a DoubleScalar.
|
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()
Create a mutable version of this DoubleVector.
|
int |
size()
Retrieve the size of the vector.
|
DoubleVectorInterface<U> |
toDense()
Create a dense version of this DoubleVector.
|
DoubleVectorInterface<U> |
toSparse()
Create a sparse version of this DoubleVector.
|
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()
double 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())DoubleScalar<U> get(int index) throws ValueException
index - int; index of the value to retrieveValueException - when index out of range (index < 0 or index >= size())double zSum()
MutableDoubleVectorInterface<U> mutable()
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 unitDoubleVectorInterface<U> toDense()
DoubleVectorInterface<U> toSparse()
Copyright © 2015 Delft University of Technology. All rights reserved.