Package org.djunits.vecmat.def
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 typeQ- the quantity typeMA- the absolute matrix typeMQ- 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 Summary
ConstructorsConstructorDescriptionAbsSquareMatrix(MQ matrix, Reference<?, A, Q> reference) Create a new square matrix of absolute values with a reference point. -
Method Summary
Modifier and TypeMethodDescriptionA[]Retrieve the main diagonal of the matrix as an array of scalars.double[]Retrieve the main diagonal of the matrix as an array of doubles with SI-values.Retrieve the main diagonal of the matrix as a column vector.booleanReturn whether the matrix is skew symmetric.booleanisSkewSymmetric(Q tolerance) Return whether the matrix is skew symmetric, up to a tolerance.booleanReturn whether the matrix is symmetric.booleanisSymmetric(Q tolerance) Return whether the matrix is symmetric, up to a tolerance.intorder()Return the order (the number of rows/columns) of this matrix.Return a transposed absolute vector or matrix, where rows and columns have been swapped.Methods inherited from class org.djunits.vecmat.def.AbsTable
get, getColumnScalars, getColumnSi, getColumnVector, getRowScalars, getRowSi, getRowVector, getScalarArray, getScalarGrid, getSiArray, getSiGrid, mget, mgetColumnScalars, mgetColumnSi, mgetColumnVector, mgetRowScalars, mgetRowSi, mgetRowVector, msi, siMethods inherited from class org.djunits.vecmat.def.AbsVectorMatrix
add, add, asAbsMatrix1x1, asAbsMatrix2x2, asAbsMatrix3x3, asAbsMatrixNxM, asAbsMatrixNxN, asAbsQuantityTable, asAbsVector1, asAbsVector2Col, asAbsVector2Row, asAbsVector3Col, asAbsVector3Row, asAbsVectorNCol, asAbsVectorNRow, checkCol, checkRow, cols, equals, getDisplayUnit, getReference, getRelativeVecMat, hashCode, instantiate, instantiateSi, isRelative, max, mcheckCol, mcheckRow, median, min, rows, setDisplayUnit, subtract, subtract, subtract, subtract, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.djunits.value.Value
isAbsolute, setDisplayUnit
-
Constructor Details
-
AbsSquareMatrix
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 pointreference- 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
Description copied from class:AbsVectorMatrixReturn a transposed absolute vector or matrix, where rows and columns have been swapped.- Specified by:
transposein classAbsVectorMatrix<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
Retrieve the main diagonal of the matrix as a column vector.- Returns:
- the main diagonal as a Vector
-
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
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
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
-