Class FloatMatrixRel<U extends Unit<U>,S extends FloatScalarRel<U,S>,RV extends FloatVectorRel<U,S,RV>,RM extends FloatMatrixRel<U,S,RV,RM>>
java.lang.Object
org.djunits.value.IndexedValue<U,S,M,DM>
org.djunits.value.base.Matrix<U,S,V,FloatVectorData,M,FloatMatrixData>
org.djunits.value.vfloat.matrix.base.FloatMatrix<U,S,RV,RM>
org.djunits.value.vfloat.matrix.base.FloatMatrixRel<U,S,RV,RM>
- Type Parameters:
U
- the unitS
- the scalar type belonging to the matrix typeRV
- the relative vector type belonging to the relative matrix typeRM
- the relative matrix type with this unit
- All Implemented Interfaces:
Serializable
,Cloneable
,Relative<U,
,RM> Value<U,
RM>
- Direct Known Subclasses:
FloatAbsorbedDoseMatrix
,FloatAccelerationMatrix
,FloatAmountOfSubstanceMatrix
,FloatAngularAccelerationMatrix
,FloatAngularVelocityMatrix
,FloatAreaMatrix
,FloatCatalyticActivityMatrix
,FloatDensityMatrix
,FloatDimensionlessMatrix
,FloatElectricalCapacitanceMatrix
,FloatElectricalChargeMatrix
,FloatElectricalConductanceMatrix
,FloatElectricalCurrentMatrix
,FloatElectricalInductanceMatrix
,FloatElectricalPotentialMatrix
,FloatElectricalResistanceMatrix
,FloatEnergyMatrix
,FloatEquivalentDoseMatrix
,FloatFlowMassMatrix
,FloatFlowVolumeMatrix
,FloatForceMatrix
,FloatFrequencyMatrix
,FloatIlluminanceMatrix
,FloatLinearDensityMatrix
,FloatLuminousFluxMatrix
,FloatLuminousIntensityMatrix
,FloatMagneticFluxDensityMatrix
,FloatMagneticFluxMatrix
,FloatMassMatrix
,FloatMatrixRelWithAbs
,FloatMomentumMatrix
,FloatPowerMatrix
,FloatPressureMatrix
,FloatRadioActivityMatrix
,FloatSIMatrix
,FloatSolidAngleMatrix
,FloatSpeedMatrix
,FloatTorqueMatrix
,FloatVolumeMatrix
public abstract class FloatMatrixRel<U extends Unit<U>,S extends FloatScalarRel<U,S>,RV extends FloatVectorRel<U,S,RV>,RM extends FloatMatrixRel<U,S,RV,RM>>
extends FloatMatrix<U,S,RV,RM>
implements Relative<U,RM>
FloatMatrixRel.java.
Copyright (c) 2019-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
- Author:
- Alexander Verbraeck
- See Also:
-
Field Summary
Fields inherited from class org.djunits.value.vfloat.matrix.base.FloatMatrix
data
-
Constructor Summary
ModifierConstructorDescriptionprotected
FloatMatrixRel
(FloatMatrixData data, U unit) Construct a new Relative Mutable FloatMatrix. -
Method Summary
Modifier and TypeMethodDescriptionfinal RM
decrementBy
(RM decrement) Decrement this Relative matrix by another Relative matrix.decrementBy
(S decrement) Decrement all values of this matrix by the decrement.final RM
divide
(double divisor) Returns a new scalar/vector/matrix with value(s) divided by a factor.final RM
divide
(float divisor) Returns a new scalar/vector/matrix with value(s) divided by a factor.final <UT extends Unit<UT>,
ST extends FloatScalar<UT, ST>, VT extends FloatVector<UT, ST, VT>, MT extends FloatMatrix<UT, ST, VT, MT> & Relative<UT, MT>>
FloatSIMatrixdivide
(MT rel) Divide this Relative matrix by another Relative matrix.divideBy
(double divisor) Divide all values of this matrix by the divisor.divideBy
(float divisor) Divide all values of this matrix by the divisor.incrementBy
(RM increment) Increment all values of this matrix by the increment on a value by value basis.incrementBy
(S increment) Increment all values of this matrix by the increment.final RM
Subtract a Relative value from this Relative value.multiplyBy
(double multiplier) Multiply all values of this matrix by the multiplier.multiplyBy
(float multiplier) Multiply all values of this matrix by the multiplier.final RM
Add a Relative value to this Relative value.final RM
times
(double multiplier) Returns a new scalar/vector/matrix with value(s) multiplied by a factor.final RM
times
(float multiplier) Returns a new scalar/vector/matrix with value(s) multiplied by a factor.final <UT extends Unit<UT>,
ST extends FloatScalar<UT, ST>, VT extends FloatVector<UT, ST, VT>, MT extends FloatMatrix<UT, ST, VT, MT> & Relative<UT, MT>>
FloatSIMatrixtimes
(MT rel) Multiply a Relative value with this Relative value for a matrix or matrix.final S
zSum()
Compute the sum of all SI values of this matrix.Methods inherited from class org.djunits.value.vfloat.matrix.base.FloatMatrix
abs, assign, ceil, checkColumnIndex, checkIndex, checkRowIndex, checkSquare, cols, determinantSI, equals, floor, get, getColumn, getColumnScalars, getColumnSI, getData, getDiagonal, getDiagonalScalars, getDiagonalSI, getInUnit, getInUnit, getRow, getRowScalars, getRowSI, getScalars, getSI, getValuesInUnit, getValuesInUnit, getValuesSI, hashCode, instantiateMatrix, instantiateScalarSI, instantiateVector, neg, rint, rows, set, setData, setInUnit, setInUnit, setSI, toDense, toSparse, toString, toString, toString, toString
Methods inherited from class org.djunits.value.base.Matrix
getVectorClass
Methods inherited from class org.djunits.value.IndexedValue
cardinality, checkCopyOnWrite, clone, getDisplayUnit, getScalarClass, getStorageType, immutable, isCopyOnWrite, isDense, isMutable, isSparse, mutable, setCopyOnWrite, setDisplayUnit, setMutable
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.djunits.value.Value
isAbsolute, isRelative
-
Constructor Details
-
FloatMatrixRel
Construct a new Relative Mutable FloatMatrix.- Parameters:
data
- FloatMatrixData; an internal data objectunit
- U; the unit
-
-
Method Details
-
zSum
Compute the sum of all SI values of this matrix.- Returns:
- S; the sum of all values of this matrix with the same display unit as this matrix
-
plus
Description copied from interface:Relative
Add a Relative value to this Relative value. A new value is returned due to immutability.- Specified by:
plus
in interfaceRelative<U extends Unit<U>,
S extends FloatScalarRel<U, S>> - Parameters:
rel
- R; the value to add- Returns:
- R; the sum of this value and the operand as a new object
- Throws:
ValueRuntimeException
-
minus
Description copied from interface:Relative
Subtract a Relative value from this Relative value. A new value is returned due to immutability.- Specified by:
minus
in interfaceRelative<U extends Unit<U>,
S extends FloatScalarRel<U, S>> - Parameters:
rel
- R; the value to subtract- Returns:
- R; the difference of this value and the operand
- Throws:
ValueRuntimeException
-
incrementBy
Increment all values of this matrix by the increment. This only works if the matrix is mutable.- Parameters:
increment
- S; the scalar by which to increment all values- Returns:
- RM; this modified matrix
- Throws:
ValueRuntimeException
- in case this matrix is immutable
-
incrementBy
Increment all values of this matrix by the increment on a value by value basis. This only works if this matrix is mutable.- Parameters:
increment
- RM; the matrix that contains the values by which to increment the corresponding values- Returns:
- RM; this modified matrix
- Throws:
ValueRuntimeException
- in case this matrix is immutable or when the sizes of the matrices differ
-
decrementBy
Decrement all values of this matrix by the decrement. This only works if this matrix is mutable.- Parameters:
decrement
- S; the scalar by which to decrement all values- Returns:
- RM; this modified matrix
- Throws:
ValueRuntimeException
- in case this matrix is immutable
-
decrementBy
Decrement this Relative matrix by another Relative matrix. The operation is done value by value. This is only allowed if this matrix is mutable.- Parameters:
decrement
- RM; the matrix that contains the values by which to decrement the corresponding values- Returns:
- RM; this modified matrix
- Throws:
ValueRuntimeException
- in case this matrix is immutable or when the sizes of the matrices differ
-
multiplyBy
Multiply all values of this matrix by the multiplier. This only works if the matrix is mutable.- Parameters:
multiplier
- float; the factor by which to multiply all values- Returns:
- RM; this modified matrix
- Throws:
ValueRuntimeException
- in case the matrix is immutable
-
divideBy
Divide all values of this matrix by the divisor. This only works if the matrix is mutable.- Parameters:
divisor
- float; the value by which to divide all values- Returns:
- RM; this modified matrix
- Throws:
ValueRuntimeException
- in case the matrix is immutable
-
multiplyBy
Multiply all values of this matrix by the multiplier. This only works if the matrix is mutable.- Parameters:
multiplier
- float; the factor by which to multiply all values- Returns:
- RM; this modified matrix
- Throws:
ValueRuntimeException
- in case the matrix is immutable
-
divideBy
Divide all values of this matrix by the divisor. This only works if the matrix is mutable.- Parameters:
divisor
- float; the value by which to divide all values- Returns:
- RM; this modified matrix
- Throws:
ValueRuntimeException
- in case the matrix is immutable
-
times
public final <UT extends Unit<UT>,ST extends FloatScalar<UT, FloatSIMatrix timesST>, VT extends FloatVector<UT, ST, VT>, MT extends FloatMatrix<UT, ST, VT, MT> & Relative<UT, MT>> (MT rel) throws ValueRuntimeException, UnitException Multiply a Relative value with this Relative value for a matrix or matrix. The multiplication is done value by value and store the result in a new Relative value. If both operands are dense, the result is a dense matrix or matrix, otherwise the result is a sparse matrix or matrix.- Type Parameters:
UT
- the unit type of the multiplierST
- the scalar type of the multiplierVT
- the vector type of the multiplierMT
- the matrix type of the multiplier- Parameters:
rel
- MT; the right operand, which can be any matrix type- Returns:
- FloatSIMatrix; the multiplication of this matrix and the operand
- Throws:
ValueRuntimeException
- in case this matrix or matrix and the operand have a different sizeUnitException
- on unit error
-
times
Description copied from interface:Relative
Returns a new scalar/vector/matrix with value(s) multiplied by a factor. -
times
Description copied from interface:Relative
Returns a new scalar/vector/matrix with value(s) multiplied by a factor. -
divide
public final <UT extends Unit<UT>,ST extends FloatScalar<UT, FloatSIMatrix divideST>, VT extends FloatVector<UT, ST, VT>, MT extends FloatMatrix<UT, ST, VT, MT> & Relative<UT, MT>> (MT rel) throws ValueRuntimeException, UnitException Divide this Relative matrix by another Relative matrix. The operation is done value by value and store the result is stored in a new Relative matrix. If both operands are dense, the result is a dense matrix, otherwise the result is a sparse matrix. TODO discuss dense or sparseness of result.- Type Parameters:
UT
- the unit type of the multiplierST
- the scalar type of the multiplierVT
- the vector type of the multiplierMT
- the matrix type of the multiplier- Parameters:
rel
- MT; the right operand, which can be any matrix type- Returns:
- FloatSIMatrix; the division of this matrix and the operand
- Throws:
ValueRuntimeException
- in case this matrix or matrix and the operand have a different sizeUnitException
- on unit error
-
divide
Description copied from interface:Relative
Returns a new scalar/vector/matrix with value(s) divided by a factor. -
divide
Description copied from interface:Relative
Returns a new scalar/vector/matrix with value(s) divided by a factor.
-