Interface Matrix.Abs<AU extends AbsoluteLinearUnit<AU,​RU>,​A extends Scalar<AU,​A>,​AV extends Vector.Abs<AU,​A,​AV,​RU,​R,​RV>,​AM extends Matrix.Abs<AU,​A,​AV,​AM,​RU,​R,​RV,​RM>,​RU extends Unit<RU>,​R extends Scalar<RU,​R>,​RV extends Vector.RelWithAbs<AU,​A,​AV,​RU,​R,​RV>,​RM extends Matrix.RelWithAbs<AU,​A,​AV,​AM,​RU,​R,​RV,​RM>>

Type Parameters:
AU - the absolute unit belonging to the relative unit
A - the absolute scalar type belonging to the absolute matrix type
AV - the corresponding absolute vector type
AM - the absolute matrix type
RU - the relative unit belonging to the absolute unit
R - the relative scalar type belonging to the relative matrix type
RV - the corresponding relative vector type
RM - the relative matrix type with this unit
All Superinterfaces:
Absolute, Cloneable, IndexedValue<AU,​A,​AM>, Matrix<AU,​A,​AV,​AM>, Serializable, Value<AU,​AM>, ValueFunctions<AU,​AM>
All Known Implementing Classes:
AbsoluteTemperatureMatrix, AbstractDoubleMatrixAbs, AbstractFloatMatrixAbs, DirectionMatrix, FloatAbsoluteTemperatureMatrix, FloatDirectionMatrix, FloatPositionMatrix, FloatTimeMatrix, PositionMatrix, TimeMatrix
Enclosing interface:
Matrix<U extends Unit<U>,​S extends Scalar<U,​S>,​V extends Vector<U,​S,​V>,​M extends Matrix<U,​S,​V,​M>>

public static interface Matrix.Abs<AU extends AbsoluteLinearUnit<AU,​RU>,​A extends Scalar<AU,​A>,​AV extends Vector.Abs<AU,​A,​AV,​RU,​R,​RV>,​AM extends Matrix.Abs<AU,​A,​AV,​AM,​RU,​R,​RV,​RM>,​RU extends Unit<RU>,​R extends Scalar<RU,​R>,​RV extends Vector.RelWithAbs<AU,​A,​AV,​RU,​R,​RV>,​RM extends Matrix.RelWithAbs<AU,​A,​AV,​AM,​RU,​R,​RV,​RM>>
extends Matrix<AU,​A,​AV,​AM>, Absolute
Methods for Absolute Matrix. An example is the absolute matrix Position that has a corresponding relative matrix Length. A possible way to implement this interface is:
 class PositionMatrix implements Matrix.Abs<
     PositionUnit, Position, PositionMatrix, LengthUnit, Length, LengthMatrix>
 
Copyright (c) 2019-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
Author:
Alexander Verbraeck
  • Method Details

    • plus

      AM plus​(RM increment) throws ValueRuntimeException
      Add a relative matrix to this absolute matrix. A new absolute matrix is returned. The display unit of the new matrix is the display unit of this absolute matrix. The addition is done value by value and the result is stored in a new matrix. If both operands are sparse, the result is a sparse matrix, otherwise the result is a dense matrix.
      Parameters:
      increment - RM; the relative matrix (mutable or immutable, sparse or dense) to add to this absolute matrix
      Returns:
      AIV; the sum of this value and the operand as a new absolute, immutable matrix
      Throws:
      ValueRuntimeException - in case this matrix and the operand have a different size
    • minus

      AM minus​(RM decrement) throws ValueRuntimeException
      Subtract a relative matrix from this absolute matrix. A new absolute matrix is returned. The display unit of the new matrix is the display unit of this absolute matrix. The subtraction is done value by value and the result is stored in a new matrix. If both operands are sparse, the result is a sparse matrix, otherwise the result is a dense matrix.
      Parameters:
      decrement - RM; the relative matrix (mutable or immutable, sparse or dense) to subtract from this absolute matrix
      Returns:
      AIV; the difference of this value and the operand as a new absolute, immutable matrix
      Throws:
      ValueRuntimeException - in case this matrix and the operand have a different size
    • minus

      RM minus​(AM decrement) throws ValueRuntimeException
      Subtract an absolute matrix from this absolute matrix. A new relative matrix is returned. The display unit of the new matrix is the relative counterpart of the display unit of this absolute matrix. The subtraction is done value by value and the result is stored in a new matrix. If both operands are sparse, the result is a sparse matrix, otherwise the result is a dense matrix.
      Parameters:
      decrement - AM; the absolute matrix (mutable or immutable, sparse or dense) to subtract from this absolute matrix
      Returns:
      RIV; the difference of this value and the operand as a new relative, immutable matrix
      Throws:
      ValueRuntimeException - in case this matrix and the operand have a different size