U
- the unitpublic interface DoubleMatrixInterface<U extends Unit<U>>
Copyright (c) 2013-2018 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).
|
int |
columns()
Retrieve the number of columns of the matrix.
|
double |
determinant()
Compute the determinant of the matrix.
|
AbstractDoubleScalar<U,?> |
get(int row,
int column)
Retrieve a value from the matrix.
|
double |
getInUnit(int row,
int column)
Retrieve the value stored at a specified row and column in the original unit.
|
double |
getInUnit(int row,
int column,
U targetUnit)
Retrieve the value stored at a specified row and column converted into a specified unit.
|
double |
getSI(int row,
int column)
Retrieve the value stored at a specified row and column in the standard SI unit.
|
double[][] |
getValuesInUnit()
Create a dense double[][] array filled with the values in the original unit.
|
double[][] |
getValuesInUnit(U targetUnit)
Create a dense double[][] array filled with the values converted into a specified unit.
|
double[][] |
getValuesSI()
Create a dense double[][] array filled with the values in the standard SI unit.
|
int |
rows()
Retrieve the number of rows of the matrix.
|
DoubleMatrixInterface<U> |
toDense()
Create a dense version of this DoubleMatrix.
|
DoubleMatrixInterface<U> |
toSparse()
Create a sparse version of this DoubleMatrix.
|
String |
toString() |
String |
toString(boolean verbose,
boolean withUnit)
Print this DoubleMatrix with optional type and unit information.
|
String |
toString(U displayUnit)
Print this DoubleMatrix with the values expressed in the specified unit.
|
String |
toString(U displayUnit,
boolean verbose,
boolean withUnit)
Print this DoubleMatrix with the values expressed in the specified unit.
|
double |
zSum()
Compute the sum of all values of this matrix.
|
int rows()
int columns()
int cardinality()
AbstractDoubleScalar<U,?> get(int row, int column) throws ValueException
row
- int; row of the value to retrievecolumn
- int; column of the value to retrieveValueException
- in case row or column is out of boundsdouble getSI(int row, int column) throws ValueException
row
- int; row of the value to retrievecolumn
- int; column of the value to retrieveValueException
- when row or column out of range (row < 0 or row >= rows() or column < 0 or column >=
columns())double getInUnit(int row, int column) throws ValueException
row
- int; row of the value to retrievecolumn
- int; column of the value to retrieveValueException
- when row or column out of range (row < 0 or row >= rows() or column < 0 or column >=
columns())double getInUnit(int row, int column, U targetUnit) throws ValueException
row
- int; row of the value to retrievecolumn
- int; column of the value to retrievetargetUnit
- U; the unit for the resultValueException
- when row or column out of range (row < 0 or row >= rows() or column < 0 or column >=
columns())double zSum()
double determinant() throws ValueException
ValueException
- when matrix is neither sparse, nor dense, or not squaredouble[][] 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 unitDoubleMatrixInterface<U> toDense()
DoubleMatrixInterface<U> toSparse()
Copyright © 2015–2018 Delft University of Technology. All rights reserved.