U
- the unitR
- the matrix typeMR
- the mutable matrix typeS
- the scalar typeabstract class AbstractMutableDoubleMatrixRel<U extends Unit<U>,R extends AbstractDoubleMatrixRel<U,R,MR,S>,MR extends AbstractMutableDoubleMatrixRel<U,R,MR,S>,S extends AbstractDoubleScalarRel<U,S>> extends AbstractDoubleMatrixRel<U,R,MR,S> implements Mutable, MathFunctionsRel<MR>, DoubleMathFunctions<MR>
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 |
---|
AbstractMutableDoubleMatrixRel(double[][] values,
U unit,
StorageType storageType)
Construct a new Relative Mutable DoubleMatrix.
|
AbstractMutableDoubleMatrixRel(DoubleMatrixData data,
U unit)
Construct a new Relative Mutable DoubleMatrix.
|
AbstractMutableDoubleMatrixRel(S[][] values,
StorageType storageType)
Construct a new Relative Mutable DoubleMatrix.
|
Modifier and Type | Method and Description |
---|---|
MR |
abs()
Set the value(s) to their absolute value.
|
void |
assign(DoubleFunction doubleFunction)
Execute a function on a cell by cell basis.
|
MR |
ceil()
Set the value(s) to the smallest (closest to negative infinity) value(s) that are greater than or equal to the argument
and equal to a mathematical integer.
|
protected void |
checkCopyOnWrite()
Check the copyOnWrite flag and, if it is set, make a deep copy of the data and clear the flag.
|
MR |
copy()
Create a deep copy of this MutableDoubleMatrix.
|
MR |
decrementBy(double decrement)
Decrement the value by the supplied constant and return the changed matrix.
|
MR |
decrementBy(R decrement)
Decrement the value by the supplied value and return the changed matrix.
|
MR |
decrementBy(S decrement)
Decrement the value by the supplied value and return the changed matrix.
|
MR |
divideBy(double factor)
Scale the value(s) by the inverse of a factor; i.e.
|
MR |
divideBy(R factors)
Divide the values in the matrix by the supplied values and return the changed matrix.
|
MR |
divideBy(S factor)
Divide the values in the matrix by the supplied value and return the changed matrix.
|
MR |
floor()
Set the value(s) to the largest (closest to positive infinity) value(s) that are less than or equal to the argument and
equal to a mathematical integer.
|
R |
immutable()
Create a immutable version of this MutableDoubleMatrix.
|
MR |
incrementBy(double increment)
Increment the value by the supplied constant and return the changed matrix.
|
MR |
incrementBy(R increment)
Increment the value by the supplied value and return the changed matrix.
|
MR |
incrementBy(S increment)
Increment the value by the supplied value and return the changed matrix.
|
MR |
multiplyBy(double factor)
Scale the value(s) by a factor.
|
MR |
multiplyBy(R factors)
Multiply the values in the matrix by the supplied values and return the changed matrix.
|
MR |
multiplyBy(S factor)
Multiply the values in the matrix by the supplied value and return the changed matrix.
|
MR |
mutable()
Create a mutable version of this DoubleMatrix.
|
MR |
neg()
Set the value(s) to the minus value.
|
void |
normalize()
Normalize the matrix, i.e.
|
MR |
rint()
Set the value(s) to the value(s) that are closest in value to the argument and equal to a mathematical integer.
|
MR |
round()
Set the value(s) to the closest long to the argument with ties rounding up.
|
void |
set(int row,
int column,
S value)
Set the value for a cell in the matrix.
|
(package private) void |
setCopyOnWrite(boolean copyOnWrite)
Change the copyOnWrite flag.
|
void |
setInUnit(int row,
int column,
double value,
U valueUnit)
Set the value for a cell in the matrix.
|
void |
setSI(int row,
int column,
double valueSI)
Set the value for a cell in the matrix.
|
checkUnit, divide, ensureRectangularAndNonEmpty, get, instantiateMutableType, instantiateScalar, instantiateType, minus, plus, times
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
DIV, MULT, POW
toDense, toSparse
AbstractMutableDoubleMatrixRel(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 Absolute Immutable DoubleMatrixstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullAbstractMutableDoubleMatrixRel(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 entriesAbstractMutableDoubleMatrixRel(DoubleMatrixData data, U unit)
data
- an internal data objectunit
- the unitfinal void setCopyOnWrite(boolean copyOnWrite)
copyOnWrite
- boolean; the new value for the copyOnWrite flagpublic final MR mutable()
public final R immutable()
public final MR copy()
public final MR incrementBy(R increment) throws ValueException
increment
- DoubleMatrix.Rel<U>; amount by which the value is incrementedValueException
- when the size of increment is not identical to the size of thispublic final MR incrementBy(S increment)
increment
- DoubleScalar.Rel<U>; amount by which the value is incrementedpublic final MR incrementBy(double increment)
increment
- amount by which the value is incrementedpublic final MR decrementBy(R decrement) throws ValueException
decrement
- DoubleMatrix.Rel<U>; amount by which the value is decrementedValueException
- when the size of increment is not identical to the size of thispublic final MR decrementBy(S decrement)
decrement
- DoubleScalar.Rel<U>; amount by which the value is decrementedpublic final MR decrementBy(double decrement)
decrement
- amount by which the value is decrementedpublic final MR multiplyBy(R factors) throws ValueException
factors
- DoubleMatrix.Rel<U>; amounts by which the value is multipliedValueException
- when the size of the factors is not identical to the size of thispublic final MR multiplyBy(S factor)
factor
- DoubleScalar.Rel<U>; amount by which the values in the matrix are multipliedpublic final MR multiplyBy(double factor)
multiplyBy
in interface DoubleMathFunctions<MR extends AbstractMutableDoubleMatrixRel<U,R,MR,S>>
factor
- double; the multiplierpublic final MR divideBy(R factors) throws ValueException
factors
- DoubleMatrix.Rel<U>; amounts by which the value is dividedValueException
- when the size of the factors is not identical to the size of thispublic MR divideBy(double factor)
divideBy
in interface DoubleMathFunctions<MR extends AbstractMutableDoubleMatrixRel<U,R,MR,S>>
factor
- double; the divisorpublic final MR divideBy(S factor)
factor
- DoubleScalar.Rel<U>; amount by which the values in the matrix are dividedpublic final void assign(DoubleFunction doubleFunction)
doubleFunction
- the function to applypublic final MR abs()
abs
in interface MathFunctionsRel<MR extends AbstractMutableDoubleMatrixRel<U,R,MR,S>>
public final MR ceil()
ceil
in interface MathFunctionsAbs<MR extends AbstractMutableDoubleMatrixRel<U,R,MR,S>>
public final MR floor()
floor
in interface MathFunctionsAbs<MR extends AbstractMutableDoubleMatrixRel<U,R,MR,S>>
public final MR neg()
neg
in interface MathFunctionsRel<MR extends AbstractMutableDoubleMatrixRel<U,R,MR,S>>
public final MR rint()
rint
in interface MathFunctionsAbs<MR extends AbstractMutableDoubleMatrixRel<U,R,MR,S>>
public final MR round()
round
in interface MathFunctionsAbs<MR extends AbstractMutableDoubleMatrixRel<U,R,MR,S>>
protected final void checkCopyOnWrite()
public final void setSI(int row, int column, double valueSI) throws ValueException
row
- the rowcolumn
- the columnvalueSI
- the value, expressed in the SI unitValueException
- when the row/column is out of rangepublic final void set(int row, int column, S value) throws ValueException
row
- the rowcolumn
- the columnvalue
- the valueValueException
- when the row/column is out of rangepublic final void setInUnit(int row, int column, double value, U valueUnit) throws ValueException
row
- the rowcolumn
- the columnvalue
- the value, expressed in the given unitvalueUnit
- the unit of the valueValueException
- when the row/column is out of rangepublic final void normalize() throws ValueException
ValueException
- when the sum of the values is zero and normalization is not possibleCopyright © 2015–2018 Delft University of Technology. All rights reserved.