Class AbsMatrix1x1<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>>

Type Parameters:
A - the absolute quantity type
Q - the corresponding relative quantity type
All Implemented Interfaces:
Serializable, Value<Q>

public class AbsMatrix1x1<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>> extends AbsSquareMatrix<A,Q,AbsMatrix1x1<A,Q>,Matrix1x1<Q>>
AbsMatrix1x1 implements a matrix with 1x1 absolute quantities with a reference point. The matrix is immutable, except for the display unit, which can be changed.

Copyright (c) 2026-2026 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djunits.org. The DJUNITS project is distributed under a three-clause BSD-style license.

Author:
Alexander Verbraeck
See Also:
  • Constructor Details

    • AbsMatrix1x1

      public AbsMatrix1x1(Matrix1x1<Q> relativeMatrix, Reference<?,A,Q> reference)
      Create a new AbsMatrix1x1 with a display unit and a reference point.
      Parameters:
      relativeMatrix - the matrix values {a11} expressed in the displayUnit
      reference - the reference point for the absolute values
  • Method Details

    • instantiate

      public AbsMatrix1x1<A,Q> instantiate(Matrix1x1<Q> relativeMatrix, Reference<?,A,Q> reference)
      Description copied from class: AbsVectorMatrix
      Return a new vector or matrix with the given SI or BASE values for the relative vector or matrix. The absolute matrix uses the display unit of the relative vector or matrix.
      Specified by:
      instantiate in class AbsVectorMatrix<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>,AbsMatrix1x1<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>>,Matrix1x1<Q extends Quantity<Q>>,AbsMatrix1x1<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>>>
      Parameters:
      relativeMatrix - the underlying relative vector or matrix with SI values relative to the reference point
      reference - the reference point for the relative SI values
      Returns:
      a new matrix with the provided SI or BASE values, and the display unit of the relative vector or matrix
    • getRowVector

      public AbsVector1<A,Q> getRowVector(int row)
      Description copied from class: AbsTable
      Return a quantity row (0-based) from the vector or matrix. Note that the specific vector to return can be tightened by the implementing class.
      Specified by:
      getRowVector in class AbsTable<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>,AbsMatrix1x1<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>>,Matrix1x1<Q extends Quantity<Q>>,AbsMatrix1x1<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>>>
      Parameters:
      row - the row number to retrieve (0-based)
      Returns:
      a row vector with the data at the given row
    • mgetRowVector

      public AbsVector1<A,Q> mgetRowVector(int mRow)
      Description copied from class: AbsTable
      Return a quantity row (1-based) from the vector or matrix. Note that the specific vector to return can be tightened by the implementing class.
      Specified by:
      mgetRowVector in class AbsTable<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>,AbsMatrix1x1<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>>,Matrix1x1<Q extends Quantity<Q>>,AbsMatrix1x1<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>>>
      Parameters:
      mRow - the row number to retrieve (1-based)
      Returns:
      a row vector with the data at the given row
    • getColumnVector

      public AbsVector1<A,Q> getColumnVector(int col)
      Description copied from class: AbsTable
      Return a quantity column (0-based) from the vector or matrix. Note that the specific vector to return can be tightened by the implementing class.
      Specified by:
      getColumnVector in class AbsTable<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>,AbsMatrix1x1<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>>,Matrix1x1<Q extends Quantity<Q>>,AbsMatrix1x1<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>>>
      Parameters:
      col - the column number to retrieve (0-based)
      Returns:
      a column vector with the data at the given column
    • mgetColumnVector

      public AbsVector1<A,Q> mgetColumnVector(int mCol)
      Description copied from class: AbsTable
      Return a quantity column (1-based) from the vector or matrix. Note that the specific vector to return can be tightened by the implementing class.
      Specified by:
      mgetColumnVector in class AbsTable<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>,AbsMatrix1x1<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>>,Matrix1x1<Q extends Quantity<Q>>,AbsMatrix1x1<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>>>
      Parameters:
      mCol - the column number to retrieve (1-based)
      Returns:
      a column vector with the data at the given column
    • getDiagonalVector

      public AbsVector1<A,Q> getDiagonalVector()
      Description copied from class: AbsSquareMatrix
      Retrieve the main diagonal of the matrix as a column vector.
      Specified by:
      getDiagonalVector in class AbsSquareMatrix<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>,AbsMatrix1x1<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>>,Matrix1x1<Q extends Quantity<Q>>>
      Returns:
      the main diagonal as a Vector
    • of

      public static <A extends AbsQuantity<A, Q, R>, Q extends Quantity<Q>, R extends Reference<R, A, Q>> AbsMatrix1x1<A,Q> of(double xInUnit, UnitInterface<Q> displayUnit, R reference)
      Create an AbsMatrix1x1 without needing generics.
      Type Parameters:
      A - the absolute quantity type
      Q - the quantity type
      R - the reference type
      Parameters:
      xInUnit - the a11-value expressed in the display unit
      displayUnit - the display unit to use
      reference - the reference point for the absolute quantities
      Returns:
      a new Matrix1x1 with a unit
    • of

      public static <A extends AbsQuantity<A, Q, R>, Q extends Quantity<Q>, R extends Reference<R, A, Q>> AbsMatrix1x1<A,Q> of(Q x, R reference)
      Create an AbsMatrix1x1 without needing generics.
      Type Parameters:
      A - the absolute quantity type
      Q - the quantity type
      R - the reference type
      Parameters:
      x - the a11-value expressed as a quantity
      reference - the reference point for the absolute quantities
      Returns:
      a new Matrix1x1 with a unit
    • of

      public static <A extends AbsQuantity<A, Q, R>, Q extends Quantity<Q>, R extends Reference<R, A, Q>> AbsMatrix1x1<A,Q> of(A absX)
      Create an AbsMatrix1x1 without needing generics.
      Type Parameters:
      A - the absolute quantity type
      Q - the quantity type
      R - the reference type
      Parameters:
      absX - the a11-value expressed as an absolute quantity
      Returns:
      a new Matrix1x1 with a unit
    • of

      public static <A extends AbsQuantity<A, Q, R>, Q extends Quantity<Q>, R extends Reference<R, A, Q>> AbsMatrix1x1<A,Q> of(double[] dataInUnit, UnitInterface<Q> unit, R reference)
      Create an AbsMatrix1x1 without needing generics.
      Type Parameters:
      A - the absolute quantity type
      Q - the quantity type
      R - the reference type
      Parameters:
      dataInUnit - the a11-value expressed as an array in the display unit
      unit - the unit of the data, which will also be used as the display unit
      reference - the reference point for the absolute quantities
      Returns:
      a new Matrix1x1 with a unit
    • ofSi

      public static <A extends AbsQuantity<A, Q, R>, Q extends Quantity<Q>, R extends Reference<R, A, Q>> AbsMatrix1x1<A,Q> ofSi(double[] dataSi, UnitInterface<Q> displayUnit, R reference)
      Create an AbsMatrix1x1 without needing generics.
      Type Parameters:
      A - the absolute quantity type
      Q - the quantity type
      R - the reference type
      Parameters:
      dataSi - the a11-value expressed as an array in the SI units
      displayUnit - the display unit to use
      reference - the reference point for the absolute quantities
      Returns:
      a new Matrix1x1 with a unit
    • of

      public static <A extends AbsQuantity<A, Q, R>, Q extends Quantity<Q>, R extends Reference<R, A, Q>> AbsMatrix1x1<A,Q> of(Q[] data, R reference)
      Create an AbsMatrix1x1 without needing generics.
      Type Parameters:
      A - the absolute quantity type
      Q - the quantity type
      R - the reference type
      Parameters:
      data - the matrix values {a11} expressed as an array of quantities
      reference - the reference point for the absolute quantities
      Returns:
      a new Matrix1x1 with a unit
    • of

      public static <A extends AbsQuantity<A, Q, R>, Q extends Quantity<Q>, R extends Reference<R, A, Q>> AbsMatrix1x1<A,Q> of(A[] absData)
      Create an AbsMatrix1x1 without needing generics.
      Type Parameters:
      A - the absolute quantity type
      Q - the quantity type
      R - the reference type
      Parameters:
      absData - the {a11} value expressed as an array of absolute quantities
      Returns:
      a new Matrix1x1 with a unit
    • ofSi

      public static <A extends AbsQuantity<A, Q, R>, Q extends Quantity<Q>, R extends Reference<R, A, Q>> AbsMatrix1x1<A,Q> ofSi(double[][] gridSi, UnitInterface<Q> displayUnit, R reference)
      Create an AbsMatrix1x1 with a unit, based on a 2-dimensional grid with SI-values.
      Type Parameters:
      A - the absolute quantity type
      Q - the quantity type
      R - the reference type
      Parameters:
      gridSi - the matrix values {{a11}} expressed in the SI or base unit
      displayUnit - the unit of the data, which will also be used as the display unit
      reference - the reference point for the absolute quantities
      Returns:
      a new Matrix1x1 with a unit
    • of

      public static <A extends AbsQuantity<A, Q, R>, Q extends Quantity<Q>, R extends Reference<R, A, Q>> AbsMatrix1x1<A,Q> of(double[][] gridInUnit, UnitInterface<Q> unit, R reference)
      Create an AbsMatrix1x1 with a unit, based on a 2-dimensional grid.
      Type Parameters:
      A - the absolute quantity type
      Q - the quantity type
      R - the reference type
      Parameters:
      gridInUnit - the matrix values {{a11}} expressed in the unit
      unit - the unit of the data, which will also be used as the display unit
      reference - the reference point for the absolute quantities
      Returns:
      a new Matrix1x1 with a unit
    • of

      public static <A extends AbsQuantity<A, Q, R>, Q extends Quantity<Q>, R extends Reference<R, A, Q>> AbsMatrix1x1<A,Q> of(Q[][] grid, R reference)
      Create an AbsMatrix1x1 without needing generics.
      Type Parameters:
      A - the absolute quantity type
      Q - the quantity type
      R - the reference type
      Parameters:
      grid - the matrix values {{a11}} expressed as a grid of quantities
      reference - the reference point for the absolute quantities
      Returns:
      a new Matrix1x1 with a unit
    • of

      public static <A extends AbsQuantity<A, Q, R>, Q extends Quantity<Q>, R extends Reference<R, A, Q>> AbsMatrix1x1<A,Q> of(A[][] absGrid)
      Create an AbsMatrix1x1 without needing generics.
      Type Parameters:
      A - the absolute quantity type
      Q - the quantity type
      R - the reference type
      Parameters:
      absGrid - the a11-value expressed as a grid {{a11}}
      Returns:
      a new Matrix1x1 with a unit
    • of

      public static <A extends AbsQuantity<A, Q, R>, Q extends Quantity<Q>, R extends Reference<R, A, Q>> AbsMatrix1x1<A,Q> of(Matrix1x1<Q> relativeMatrix, R reference)
      Create an AbsMatrix1x1 without needing generics.
      Type Parameters:
      A - the absolute quantity type
      Q - the quantity type
      R - the reference type
      Parameters:
      relativeMatrix - the relative matrix with values relative to the reference point
      reference - the reference point for the absolute quantities
      Returns:
      a new Matrix1x1 with a unit