U
- the unitR
- the relative matrix typeMR
- the mutable relative matrix typeS
- the relative scalar typeabstract class AbstractDoubleMatrixRel<U extends Unit<U>,R extends AbstractDoubleMatrixRel<U,R,MR,S>,MR extends AbstractMutableDoubleMatrixRel<U,R,MR,S>,S extends AbstractDoubleScalarRel<U,S>> extends AbstractDoubleMatrix<U,R> implements Relative, Serializable
Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
$LastChangedDate: 2015-09-29 14:14:28 +0200 (Tue, 29 Sep 2015) $, @version $Revision: 73 $, by $Author: pknoppers $, initial
version Sep 5, 2015
data
Constructor and Description |
---|
AbstractDoubleMatrixRel(double[][] values,
U unit,
StorageType storageType)
Construct a new Relative Immutable DoubleMatrix.
|
AbstractDoubleMatrixRel(DoubleMatrixData data,
U unit)
Construct a new Relative Immutable DoubleMatrix.
|
AbstractDoubleMatrixRel(S[][] values,
StorageType storageType)
Construct a new Relative Immutable DoubleMatrix.
|
Modifier and Type | Method and Description |
---|---|
(package private) static <U extends Unit<U>,S extends AbstractDoubleScalarRel<U,S>> |
checkUnit(S[][] dsArray)
Check that a provided array can be used to create some descendant of a DoubleMatrix, and return the Unit.
|
R |
divide(R rel)
Divide this Relative value by a Relative value for a matrix or matrix.
|
protected static <U extends Unit<U>,S extends AbstractDoubleScalarRel<U,S>> |
ensureRectangularAndNonEmpty(S[][] values)
Check that a 2D array of DoubleScalar<?> is rectangular; i.e.
|
S |
get(int row,
int column)
Retrieve a value from the matrix.
|
protected abstract MR |
instantiateMutableType(DoubleMatrixData dmd,
U unit)
Construct a new Relative Mutable DoubleMatrix of the right type.
|
protected abstract S |
instantiateScalar(double value,
U unit)
Construct a new Relative Immutable DoubleScalar of the right type.
|
protected abstract R |
instantiateType(DoubleMatrixData dmd,
U unit)
Construct a new Relative Immutable DoubleMatrix of the right type.
|
R |
minus(R rel)
Subtract a Relative value from this Relative value for a matrix or matrix.
|
MR |
mutable()
Create a mutable version of this DoubleMatrix.
|
R |
plus(R rel)
Add a Relative value to this Relative value for a matrix or matrix.
|
R |
times(R rel)
Multiply a Relative value with this Relative value for a matrix or matrix.
|
cardinality, checkIndex, checkSize, checkSize, columns, determinant, ensureRectangularAndNonEmpty, equals, getData, getInUnit, getInUnit, getSI, getStorageType, getValuesInUnit, getValuesInUnit, getValuesSI, hashCode, rows, toString, toString, toString, toString, zSum
expressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelative, setDisplayUnit
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
toDense, toSparse
AbstractDoubleMatrixRel(double[][] values, U unit, StorageType storageType) throws ValueException
values
- double[][]; the values of the entries in the new Relative Immutable DoubleMatrixunit
- U; the unit of the new Relative Immutable DoubleMatrixstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullAbstractDoubleMatrixRel(S[][] values, StorageType storageType) throws ValueException
values
- S[][]; the values of the entries in the new Relative Immutable DoubleMatrixstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriesAbstractDoubleMatrixRel(DoubleMatrixData data, U unit)
data
- an internal data objectunit
- the unitpublic MR mutable()
protected abstract R instantiateType(DoubleMatrixData dmd, U unit)
dmd
- an internal data objectunit
- the unitprotected abstract MR instantiateMutableType(DoubleMatrixData dmd, U unit)
dmd
- an internal data objectunit
- the unitprotected abstract S instantiateScalar(double value, U unit)
value
- the valueunit
- the unitpublic final S get(int row, int column) throws ValueException
get
in interface DoubleMatrixInterface<U extends Unit<U>>
row
- int; row of the value to retrievecolumn
- int; column of the value to retrieveValueException
- in case row or column is out of boundspublic final R plus(R rel) throws ValueException
rel
- the right operandValueException
- in case this matrix or matrix and the operand have a different sizepublic final R minus(R rel) throws ValueException
rel
- the right operandValueException
- in case this matrix or matrix and the operand have a different sizepublic final R times(R rel) throws ValueException
rel
- the right operandValueException
- in case this matrix or matrix and the operand have a different sizepublic final R divide(R rel) throws ValueException
rel
- the right operandValueException
- in case this matrix or matrix and the operand have a different sizestatic <U extends Unit<U>,S extends AbstractDoubleScalarRel<U,S>> U checkUnit(S[][] dsArray) throws ValueException
U
- the unitS
- the scalar typedsArray
- 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 <U extends Unit<U>,S extends AbstractDoubleScalarRel<U,S>> void ensureRectangularAndNonEmpty(S[][] values) throws ValueException
U
- the unitS
- the scalar typevalues
- DoubleScalar<?>[][]; the 2D array to checkValueException
- when values is not rectangular, or contains no dataCopyright © 2015–2018 Delft University of Technology. All rights reserved.