U - Unit; the unit of this DoubleMatrixpublic abstract class DoubleMatrix<U extends Unit<U>> extends AbstractValue<U> implements Serializable, DoubleMatrixInterface<U>
This file was generated by the djunits value classes generator, 26 jun, 2015
Copyright (c) 2015-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
$LastChangedDate: 2016-05-28 14:25:52 +0200 (Sat, 28 May 2016) $, @version $Revision: 202 $, by $Author: averbraeck $,
initial version 26 jun, 2015
| Modifier and Type | Class and Description |
|---|---|
static class |
DoubleMatrix.Abs<U extends Unit<U>>
ABSOLUTE implementation of DoubleMatrix.
|
static class |
DoubleMatrix.Rel<U extends Unit<U>>
RELATIVE implementation of DoubleMatrix.
|
| Modifier and Type | Field and Description |
|---|---|
protected DoubleMatrixData |
data
The stored data as an object, can be sparse or dense.
|
| Modifier | Constructor and Description |
|---|---|
protected |
DoubleMatrix(U unit)
Construct a new Immutable DoubleMatrix.
|
| Modifier and Type | Method and Description |
|---|---|
int |
cardinality()
Count the number of cells that have a non-zero value (ignores tolerance).
|
protected void |
checkIndex(int row,
int column)
Check that provided row and column indices are valid.
|
protected void |
checkSize(double[][] other)
Centralized size equality check.
|
protected void |
checkSize(DoubleMatrix<?> other)
Centralized size equality check.
|
(package private) static <U extends Unit<U>> |
checkUnit(DoubleScalar<U>[][] dsArray)
Check that a provided array can be used to create some descendant of a DoubleMatrix, and return the Unit.
|
int |
columns()
Retrieve the number of columns of the matrix.
|
double |
determinant()
Compute the determinant of the matrix.
|
(package private) static <U extends Unit<U>> |
divide(DoubleMatrix.Rel<U> left,
DoubleMatrix.Rel<U> right)
Divide the content of two matrices with a static method on a cell-by-cell basis; Rel / Rel = Rel.
|
protected static void |
ensureRectangularAndNonEmpty(double[][] values)
Check that a 2D array of double is not null and rectangular; i.e.
|
protected static void |
ensureRectangularAndNonEmpty(DoubleScalar<?>[][] values)
Check that a 2D array of DoubleScalar<?> is rectangular; i.e.
|
boolean |
equals(Object obj) |
protected DoubleMatrixData |
getData() |
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.
|
StorageType |
getStorageType()
Return the StorageType (DENSE, SPARSE, etc.) for the stored Vector.
|
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.
|
int |
hashCode() |
(package private) static <U extends Unit<U>> |
instantiateAbs(DoubleMatrixData dmData,
U unit)
Instantiate a vector based on the type of data.
|
(package private) static <U extends Unit<U>> |
instantiateRel(DoubleMatrixData dmData,
U unit)
Instantiate a vector based on the type of data.
|
(package private) static <U extends Unit<U>> |
minus(DoubleMatrix.Abs<U> left,
DoubleMatrix.Abs<U> right)
Subtract the content of two matrices with a static method on a cell-by-cell basis; Abs - Abs = Rel.
|
(package private) static <U extends Unit<U>> |
minus(DoubleMatrix.Abs<U> left,
DoubleMatrix.Rel<U> right)
Subtract the content of two matrices with a static method on a cell-by-cell basis; Abs - Rel = Abs.
|
(package private) static <U extends Unit<U>> |
minus(DoubleMatrix.Rel<U> left,
DoubleMatrix.Rel<U> right)
Subtract the content of two matrices with a static method on a cell-by-cell basis; Rel - Rel = Rel.
|
(package private) static <U extends Unit<U>> |
plus(DoubleMatrix.Abs<U> left,
DoubleMatrix.Rel<U> right)
Add the content of two matrices with a static method on a cell-by-cell basis; Abs + Rel = Abs.
|
(package private) static <U extends Unit<U>> |
plus(DoubleMatrix.Rel<U> left,
DoubleMatrix.Rel<U> right)
Add the content of two matrices with a static method on a cell-by-cell basis; Rel + Rel = Rel.
|
int |
rows()
Retrieve the number of rows of the matrix.
|
(package private) static <U extends Unit<U>> |
times(DoubleMatrix.Rel<U> left,
DoubleMatrix.Rel<U> right)
Multiply the content of two matrices with a static method on a cell-by-cell basis; Rel * Rel = Rel.
|
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.
|
expressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelativeclone, finalize, getClass, notify, notifyAll, wait, wait, waitget, mutable, toDense, toSparseprotected DoubleMatrixData data
protected DoubleMatrix(U unit)
unit - U; the unit of the new DoubleMatrixprotected final DoubleMatrixData getData()
public final StorageType getStorageType()
static <U extends Unit<U>> U checkUnit(DoubleScalar<U>[][] dsArray) throws ValueException
U - the unitdsArray - the array to check and get the unit forValueException - when the array is null, has length equal to 0, or has first entry with length equal to 0protected static void ensureRectangularAndNonEmpty(double[][] values)
throws ValueException
values - double[][]; the 2D array to checkValueException - when not all rows have the same lengthprotected static void ensureRectangularAndNonEmpty(DoubleScalar<?>[][] values) throws ValueException
values - DoubleScalar<?>[][]; the 2D array to checkValueException - when values is not rectangular, or contains no datastatic <U extends Unit<U>> DoubleMatrix.Rel<U> instantiateRel(DoubleMatrixData dmData, U unit)
U - the unitdmData - the DoubleMatrixDataunit - the unit to usestatic <U extends Unit<U>> DoubleMatrix.Abs<U> instantiateAbs(DoubleMatrixData dmData, U unit)
U - the unitdmData - the DoubleMatrixDataunit - the unit to usestatic <U extends Unit<U>> DoubleMatrix.Abs<U> plus(DoubleMatrix.Abs<U> left, DoubleMatrix.Rel<U> right) throws ValueException
U - the unitleft - the first matrixright - the second matrixValueException - when the two matrices have unequal size, or when one of the matrices is null or not well-formedstatic <U extends Unit<U>> DoubleMatrix.Rel<U> plus(DoubleMatrix.Rel<U> left, DoubleMatrix.Rel<U> right) throws ValueException
U - the unitleft - the first matrixright - the second matrixValueException - when the two matrices have unequal size, or when one of the matrices is null or not well-formedstatic <U extends Unit<U>> DoubleMatrix.Abs<U> minus(DoubleMatrix.Abs<U> left, DoubleMatrix.Rel<U> right) throws ValueException
U - the unitleft - the first matrixright - the second matrixValueException - when the two matrices have unequal size, or when one of the matrices is null or not well-formedstatic <U extends Unit<U>> DoubleMatrix.Rel<U> minus(DoubleMatrix.Abs<U> left, DoubleMatrix.Abs<U> right) throws ValueException
U - the unitleft - the first matrixright - the second matrixValueException - when the two matrices have unequal size, or when one of the matrices is null or not well-formedstatic <U extends Unit<U>> DoubleMatrix.Rel<U> minus(DoubleMatrix.Rel<U> left, DoubleMatrix.Rel<U> right) throws ValueException
U - the unitleft - the first matrixright - the second matrixValueException - when the two matrices have unequal size, or when one of the matrices is null or not well-formedstatic <U extends Unit<U>> DoubleMatrix.Rel<U> times(DoubleMatrix.Rel<U> left, DoubleMatrix.Rel<U> right) throws ValueException
U - the unitleft - the first matrixright - the second matrixValueException - when the two matrices have unequal size, or when one of the matrices is null or not well-formedstatic <U extends Unit<U>> DoubleMatrix.Rel<U> divide(DoubleMatrix.Rel<U> left, DoubleMatrix.Rel<U> right) throws ValueException
U - the unitleft - the first matrixright - the second matrixValueException - when the two matrices have unequal size, or when one of the matrices is null or not well-formedpublic final double[][] getValuesSI()
getValuesSI in interface DoubleMatrixInterface<U extends Unit<U>>public final double[][] getValuesInUnit()
getValuesInUnit in interface DoubleMatrixInterface<U extends Unit<U>>public final double[][] getValuesInUnit(U targetUnit)
getValuesInUnit in interface DoubleMatrixInterface<U extends Unit<U>>targetUnit - U; the unit into which the values are converted for usepublic final int rows()
rows in interface DoubleMatrixInterface<U extends Unit<U>>public final int columns()
columns in interface DoubleMatrixInterface<U extends Unit<U>>public final double getSI(int row,
int column)
throws ValueException
getSI in interface DoubleMatrixInterface<U extends Unit<U>>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())public final double getInUnit(int row,
int column)
throws ValueException
getInUnit in interface DoubleMatrixInterface<U extends Unit<U>>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())public final double getInUnit(int row,
int column,
U targetUnit)
throws ValueException
getInUnit in interface DoubleMatrixInterface<U extends Unit<U>>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())public final double zSum()
zSum in interface DoubleMatrixInterface<U extends Unit<U>>public final int cardinality()
cardinality in interface DoubleMatrixInterface<U extends Unit<U>>public final String toString()
public final String toString(U displayUnit)
toString in interface DoubleMatrixInterface<U extends Unit<U>>displayUnit - U; the unit into which the values are converted for displaypublic final String toString(boolean verbose, boolean withUnit)
toString in interface DoubleMatrixInterface<U extends Unit<U>>verbose - boolean; if true; include type info; if false; exclude type infowithUnit - boolean; if true; include the unit; of false; exclude the unitpublic final String toString(U displayUnit, boolean verbose, boolean withUnit)
toString in interface DoubleMatrixInterface<U extends Unit<U>>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 unitprotected final void checkSize(DoubleMatrix<?> other) throws ValueException
other - DoubleMatrix<?>; other DoubleMatrixValueException - when other is null, or matrices have unequal sizeprotected final void checkSize(double[][] other)
throws ValueException
other - double[][]; array of doubleValueException - when matrices have unequal sizeprotected final void checkIndex(int row,
int column)
throws ValueException
row - int; the row value to checkcolumn - int; the column value to checkValueException - when row or column is invalidpublic final double determinant()
throws ValueException
determinant in interface DoubleMatrixInterface<U extends Unit<U>>ValueException - when matrix is neither sparse, nor dense, or not squareCopyright © 2015–2016 Delft University of Technology. All rights reserved.