Package org.djunits.vecmat.def
Class Matrix<Q extends Quantity<Q>,M extends Matrix<Q,M,SI,H,MT>,SI extends Matrix<SIQuantity,SI,?,?,?>,H extends Matrix<?,?,?,?,?>,MT extends Matrix<Q,MT,?,?,M>>
java.lang.Object
org.djunits.vecmat.def.VectorMatrix<Q,T,SI,H,TT>
org.djunits.vecmat.def.Table<Q,M,SI,H,MT>
org.djunits.vecmat.def.Matrix<Q,M,SI,H,MT>
- Type Parameters:
Q- the quantity typeM- the 'SELF' matrix typeSI- the matrix type with generics <SIQuantity, SIUnit<H- the generic matrix type with generics <?, ?< for Hadamard operationsMT- the type of the transposed version of the matrix
- All Implemented Interfaces:
Serializable,Additive<M>,Scalable<M>,Value<M,,Q> Hadamard<H,SI>
- Direct Known Subclasses:
MatrixNxM,SquareMatrix
public abstract class Matrix<Q extends Quantity<Q>,M extends Matrix<Q,M,SI,H,MT>,SI extends Matrix<SIQuantity,SI,?,?,?>,H extends Matrix<?,?,?,?,?>,MT extends Matrix<Q,MT,?,?,M>>
extends Table<Q,M,SI,H,MT>
Matrix contains a number of standard operations on matrices of relative quantities.
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionformat()Concise description of this matrix.format(MatrixFormat format) String representation of this matrix after applying the format.String representation of this matrix, expressed in the specified unit.Multiply this matrix with a MatrixNxM, resulting in a MatrixNxM.Methods inherited from class org.djunits.vecmat.def.Table
checkCol, checkRow, get, getColumnScalars, getColumnSi, getColumnVector, getRowScalars, getRowSi, getRowVector, getScalarArray, getScalarGrid, getSiGrid, mcheckCol, mcheckRow, mget, mgetColumnScalars, mgetColumnSi, mgetColumnVector, mgetRowScalars, mgetRowSi, mgetRowVector, msi, siMethods inherited from class org.djunits.vecmat.def.VectorMatrix
abs, add, add, asMatrix1x1, asMatrix2x2, asMatrix3x3, asMatrixNxM, asMatrixNxN, asQuantityTable, asVector1, asVector2Col, asVector2Row, asVector3Col, asVector3Row, asVectorNCol, asVectorNRow, checkMultiply, checkMultiply, cols, divideElements, divideEntries, getDisplayUnit, getSiArray, instantiateSi, instantiateSi, invertEntries, isRelative, max, mean, median, min, multiplyElements, multiplyEntries, multiplyEntries, negate, nnz, nonZeroCount, rows, scaleBy, setDisplayUnit, subtract, subtract, sum, toString, transpose, unsafeSiArrayMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.djunits.vecmat.operations.Hadamard
divideEntriesMethods inherited from interface org.djunits.value.Value
isAbsolute, setDisplayUnit
-
Constructor Details
-
Matrix
Create a new matrix with a unit.- Parameters:
displayUnit- the display unit to use
-
-
Method Details
-
multiply
Multiply this matrix with a MatrixNxM, resulting in a MatrixNxM. The multiplication is a (NxM) x (MxP) matrix multiplication resulting in an (NxP) matrix.- Parameters:
matrix- the matrix to multiply with- Returns:
- a MatrixNxM of an SIQuantity as the result of the matrix multiplication
- Throws:
IllegalArgumentException- when the number of columns of this matrix does not equal the number of rows of the matrix to multiply with
-
format
Concise description of this matrix.- Returns:
- a String with the matrix, with the unit attached.
-
format
String representation of this matrix after applying the format.- Parameters:
format- the format to apply for the matrix- Returns:
- a String representation of this matrix, formatted according to the given format
-
format
String representation of this matrix, expressed in the specified unit.- Parameters:
targetUnit- the unit into which the values of the matrix are converted for display- Returns:
- printable string with the matrix's values expressed in the specified unit
-