org.djunits.value.vdouble.matrix

## Interface DoubleMatrixInterface<U extends Unit<U>>

• ### Method Summary

All Methods
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.
• ### Method Detail

• #### rows

`int rows()`
Retrieve the number of rows of the matrix.
Returns:
int; the number of rows of the matrix
• #### columns

`int columns()`
Retrieve the number of columns of the matrix.
Returns:
int; the number of columns of the matrix
• #### cardinality

`int cardinality()`
Count the number of cells that have a non-zero value (ignores tolerance).
Returns:
int; the number of cells having non-zero value
• #### get

```AbstractDoubleScalar<U,?> get(int row,
int column)
throws ValueException```
Retrieve a value from the matrix.
Parameters:
`row` - int; row of the value to retrieve
`column` - int; column of the value to retrieve
Returns:
the value as a DoubleScalar
Throws:
`ValueException` - in case row or column is out of bounds
• #### getSI

```double getSI(int row,
int column)
throws ValueException```
Retrieve the value stored at a specified row and column in the standard SI unit.
Parameters:
`row` - int; row of the value to retrieve
`column` - int; column of the value to retrieve
Returns:
double; value at position row, column in the standard SI unit
Throws:
`ValueException` - when row or column out of range (row < 0 or row >= rows() or column < 0 or column >= columns())
• #### getInUnit

```double getInUnit(int row,
int column)
throws ValueException```
Retrieve the value stored at a specified row and column in the original unit.
Parameters:
`row` - int; row of the value to retrieve
`column` - int; column of the value to retrieve
Returns:
double; value at position row, column in the original unit
Throws:
`ValueException` - when row or column out of range (row < 0 or row >= rows() or column < 0 or column >= columns())
• #### getInUnit

```double getInUnit(int row,
int column,
U targetUnit)
throws ValueException```
Retrieve the value stored at a specified row and column converted into a specified unit.
Parameters:
`row` - int; row of the value to retrieve
`column` - int; column of the value to retrieve
`targetUnit` - U; the unit for the result
Returns:
double; value at position row, column converted into the specified unit
Throws:
`ValueException` - when row or column out of range (row < 0 or row >= rows() or column < 0 or column >= columns())
• #### zSum

`double zSum()`
Compute the sum of all values of this matrix.
Returns:
double; the sum of all values of this matrix
• #### determinant

```double determinant()
throws ValueException```
Compute the determinant of the matrix.
Returns:
double; the determinant of the matrix
Throws:
`ValueException` - when matrix is neither sparse, nor dense, or not square
• #### getValuesSI

`double[][] getValuesSI()`
Create a dense double[][] array filled with the values in the standard SI unit.
Returns:
double[][]; array of values in the standard SI unit
• #### getValuesInUnit

`double[][] getValuesInUnit()`
Create a dense double[][] array filled with the values in the original unit.
Returns:
double[][]; the values in the original unit
• #### getValuesInUnit

`double[][] getValuesInUnit(U targetUnit)`
Create a dense double[][] array filled with the values converted into a specified unit.
Parameters:
`targetUnit` - U; the unit into which the values are converted for use
Returns:
double[][]; the values converted into the specified unit
• #### toString

`String toString()`
Overrides:
`toString` in class `Object`
Returns:
a String with the Matrix, non-verbose, with the unit attached.
• #### toString

`String toString(U displayUnit)`
Print this DoubleMatrix with the values expressed in the specified unit.
Parameters:
`displayUnit` - U; the unit into which the values are converted for display
Returns:
String; printable string with the matrix contents expressed in the specified unit
• #### toString

```String toString(boolean verbose,
boolean withUnit)```
Print this DoubleMatrix with optional type and unit information.
Parameters:
`verbose` - boolean; if true; include type info; if false; exclude type info
`withUnit` - boolean; if true; include the unit; of false; exclude the unit
Returns:
String; printable string with the matrix contents
• #### toString

```String toString(U displayUnit,
boolean verbose,
boolean withUnit)```
Print this DoubleMatrix with the values expressed in the specified unit.
Parameters:
`displayUnit` - U; the unit into which the values are converted for display
`verbose` - boolean; if true; include type info; if false; exclude type info
`withUnit` - boolean; if true; include the unit; of false; exclude the unit
Returns:
String; printable string with the matrix contents
• #### toDense

`DoubleMatrixInterface<U> toDense()`
Create a dense version of this DoubleMatrix.
Returns:
MutableDoubleMatrix<U>; dense version of this DoubleMatrix
• #### toSparse

`DoubleMatrixInterface<U> toSparse()`
Create a sparse version of this DoubleMatrix.
Returns:
MutableDoubleMatrix<U>; sparse version of this DoubleMatrix