Class AbsSquareMatrix<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>,MA extends AbsSquareMatrix<A,Q,MA,MQ>,MQ extends SquareMatrix<Q,MQ,?,?>>

java.lang.Object
org.djunits.vecmat.def.AbsVectorMatrix<A,Q,MA,MQ,MAT>
org.djunits.vecmat.def.AbsTable<A,Q,MA,MQ,MAT>
org.djunits.vecmat.def.AbsMatrix<A,Q,MA,MQ,MA>
org.djunits.vecmat.def.AbsSquareMatrix<A,Q,MA,MQ>
Type Parameters:
A - the absolute quantity type
Q - the quantity type
MA - the absolute matrix type
MQ - the relative matrix type
All Implemented Interfaces:
Serializable, Value<MA,Q>
Direct Known Subclasses:
AbsMatrix1x1, AbsMatrix2x2, AbsMatrix3x3, AbsMatrixNxN

public abstract class AbsSquareMatrix<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>,MA extends AbsSquareMatrix<A,Q,MA,MQ>,MQ extends SquareMatrix<Q,MQ,?,?>> extends AbsMatrix<A,Q,MA,MQ,MA>
AbsSquareMatrix defines a number of operations that can be applied to square matrixes with absolute quantity values.

Copyright (c) 2025-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

    • AbsSquareMatrix

      public AbsSquareMatrix(MQ matrix, Reference<?,A,Q> reference)
      Create a new square matrix of absolute values with a reference point.
      Parameters:
      matrix - the underlying relative square matrix with SI values relative to the reference point
      reference - the reference point for the absolute values
  • Method Details

    • order

      public int order()
      Return the order (the number of rows/columns) of this matrix.
      Returns:
      the order (the number of rows/columns) of this matrix
    • transpose

      public MA transpose()
      Description copied from class: AbsVectorMatrix
      Return a transposed absolute vector or matrix, where rows and columns have been swapped.
      Specified by:
      transpose in class AbsVectorMatrix<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>,MA extends AbsSquareMatrix<A,Q,MA,MQ>,MQ extends SquareMatrix<Q,MQ,?,?>,MA extends AbsSquareMatrix<A,Q,MA,MQ>>
      Returns:
      a transposed absolute vector or matrix, where rows and columns have been swapped
    • getDiagonalVector

      public abstract AbsVector<A,Q,?,?,?> getDiagonalVector()
      Retrieve the main diagonal of the matrix as a column vector.
      Returns:
      the main diagonal as a Vector
    • getDiagonalScalars

      public A[] getDiagonalScalars()
      Retrieve the main diagonal of the matrix as an array of scalars.
      Returns:
      the main diagonal as a Scalar array
    • getDiagonalSi

      public double[] getDiagonalSi()
      Retrieve the main diagonal of the matrix as an array of doubles with SI-values.
      Returns:
      the main diagonal as a doube array with SI-values
    • isSymmetric

      public boolean isSymmetric()
      Return whether the matrix is symmetric. Use a public tolerance of 1.0E-12 times the largest absolute si quantity.
      Returns:
      whether the matrix is symmetric
    • isSymmetric

      public boolean isSymmetric(Q tolerance)
      Return whether the matrix is symmetric, up to a tolerance.
      Parameters:
      tolerance - the tolerance, expressed as a quantity
      Returns:
      whether the matrix is symmetric
    • isSkewSymmetric

      public boolean isSkewSymmetric()
      Return whether the matrix is skew symmetric. Use a public tolerance of 1.0E-12 times the largest absolute si quantity.
      Returns:
      whether the matrix is skew symmetric
    • isSkewSymmetric

      public boolean isSkewSymmetric(Q tolerance)
      Return whether the matrix is skew symmetric, up to a tolerance.
      Parameters:
      tolerance - the tolerance, expressed as a quantity
      Returns:
      whether the matrix is skew symmetric