Package org.djunits.vecmat.def
Class AbsTable<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>,MA extends AbsTable<A,Q,MA,MQ,MAT>,MQ extends Table<Q,MQ,?,?,?>,MAT extends AbsTable<A,Q,MAT,?,MA>>
java.lang.Object
org.djunits.vecmat.def.AbsVectorMatrix<A,Q,MA,MQ,MAT>
org.djunits.vecmat.def.AbsTable<A,Q,MA,MQ,MAT>
- Type Parameters:
A- the absolute quantity typeQ- the quantity typeMA- the absolute table typeMQ- the relative table typeMAT- the type of the transposed version of the absolute table
- All Implemented Interfaces:
Serializable,Value<MA,Q>
- Direct Known Subclasses:
AbsMatrix,AbsQuantityTable
public abstract class AbsTable<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>,MA extends AbsTable<A,Q,MA,MQ,MAT>,MQ extends Table<Q,MQ,?,?,?>,MAT extends AbsTable<A,Q,MAT,?,MA>>
extends AbsVectorMatrix<A,Q,MA,MQ,MAT>
AbsTable contains a number of standard operations on 2-dimensional tables that contain absolute 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 TypeMethodDescriptionget(int row, int col) Return the quantity at position (row, col), where both row and col are 0-based values.A[]getColumnScalars(int col) Retrieve a column (0-based) from the matrix as an array of scalars.double[]getColumnSi(int col) Return an array with SI-values for the given column (0-based) from the vector or matrix.getColumnVector(int col) Return a quantity column (0-based) from the vector or matrix.A[]getRowScalars(int row) Retrieve a row (0-based) from the matrix as an array of scalars.double[]getRowSi(int row) Return an array with SI-values for the given row (0-based) from the vector or matrix.getRowVector(int row) Return a quantity row (0-based) from the vector or matrix.A[]Return the vector or matrix as a row-major array of scalars.A[][]Return the vector or matrix as a 2D array of scalars.double[]Return the vector or matrix as a row-major array of double SI values.double[][]Return the vector or matrix as a 2D array of double SI values.mget(int mRow, int mCol) Return the quantity at position (row, col), where both row and col are 1-based values.A[]mgetColumnScalars(int mCol) Retrieve a column (1-based) from the matrix as an array of scalars.double[]mgetColumnSi(int mCol) Return an array with SI-values for the given column (1-based) from the vector or matrix.mgetColumnVector(int mCol) Return a quantity column (1-based) from the vector or matrix.A[]mgetRowScalars(int mRow) Retrieve a row (1-based) from the matrix as an array of scalars.double[]mgetRowSi(int mRow) Return an array with SI-values for the given row (1-based) from the vector or matrix.mgetRowVector(int mRow) Return a quantity row (1-based) from the vector or matrix.doublemsi(int mRow, int mCol) Return the si-value at position (row, col), where both row and col are 1-based values.doublesi(int row, int col) Return the si-value at position (row, col), where both row and col are 0-based values.Methods 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, toString, transposeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.djunits.value.Value
format, format, isAbsolute, setDisplayUnit
-
Constructor Details
-
AbsTable
Create a new matrix of absolute values with a reference point.- Parameters:
matrix- the underlying relative matrix with SI values relative to the reference pointreference- the reference point for the absolute values
-
-
Method Details
-
si
Return the si-value at position (row, col), where both row and col are 0-based values.- Parameters:
row- the row (0-based)col- the column (0-based)- Returns:
- the si-value at position (row, col)
- Throws:
IndexOutOfBoundsException- when row or col < 0 or larger than number of rows/columns - 1.
-
msi
Return the si-value at position (row, col), where both row and col are 1-based values.- Parameters:
mRow- the row (1-based)mCol- the column (1-based)- Returns:
- the si-value at position (row, col)
- Throws:
IndexOutOfBoundsException- when row or col < 1 or larger than number of rows/columns.
-
get
Return the quantity at position (row, col), where both row and col are 0-based values.- Parameters:
row- the row (0-based)col- the column (0-based)- Returns:
- the quantity at position (row, col)
- Throws:
IndexOutOfBoundsException- when row or col < 0 or larger than number of rows/columns - 1.
-
mget
Return the quantity at position (row, col), where both row and col are 1-based values.- Parameters:
mRow- the row (1-based)mCol- the column (1-based)- Returns:
- the quantity at position (row, col)
- Throws:
IndexOutOfBoundsException- when row or col < 1 or larger than number of rows/columns.
-
getScalarGrid
Return the vector or matrix as a 2D array of scalars.- Returns:
- a new A[rows()][cols()] array; entry [i][j] contains get(i, j).
-
getSiGrid
public double[][] getSiGrid()Return the vector or matrix as a 2D array of double SI values.- Returns:
- a new double[rows()][cols()] array; entry [i][j] contains si(i, j).
-
getScalarArray
Return the vector or matrix as a row-major array of scalars.- Returns:
- a new A[rows() * cols()] array.
-
getSiArray
public double[] getSiArray()Return the vector or matrix as a row-major array of double SI values.- Returns:
- a new double[rows() * cols()] array.
-
getRowVector
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.- Parameters:
row- the row number to retrieve (0-based)- Returns:
- a row vector with the data at the given row
-
mgetRowVector
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.- Parameters:
mRow- the row number to retrieve (1-based)- Returns:
- a row vector with the data at the given row
-
getColumnVector
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.- Parameters:
col- the column number to retrieve (0-based)- Returns:
- a column vector with the data at the given column
-
mgetColumnVector
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.- Parameters:
mCol- the column number to retrieve (1-based)- Returns:
- a column vector with the data at the given column
-
getRowSi
public double[] getRowSi(int row) Return an array with SI-values for the given row (0-based) from the vector or matrix.- Parameters:
row- the row number to retrieve (0-based)- Returns:
- an array with SI-values with the data at the given row
-
mgetRowSi
public double[] mgetRowSi(int mRow) Return an array with SI-values for the given row (1-based) from the vector or matrix.- Parameters:
mRow- the row number to retrieve (1-based)- Returns:
- an array with SI-values with the data at the given row
-
getColumnSi
public double[] getColumnSi(int col) Return an array with SI-values for the given column (0-based) from the vector or matrix.- Parameters:
col- the column number to retrieve (0-based)- Returns:
- an array with SI-values with the data at the given column
-
mgetColumnSi
public double[] mgetColumnSi(int mCol) Return an array with SI-values for the given column (1-based) from the vector or matrix.- Parameters:
mCol- the column number to retrieve (1-based)- Returns:
- an array with SI-values with the data at the given column
-
getRowScalars
Retrieve a row (0-based) from the matrix as an array of scalars.- Parameters:
row- row of the values to retrieve (0-based)- Returns:
- the row as a Scalar array
- Throws:
IndexOutOfBoundsException- in case row is out of bounds
-
mgetRowScalars
Retrieve a row (1-based) from the matrix as an array of scalars.- Parameters:
mRow- row of the values to retrieve (1-based)- Returns:
- the row as a Scalar array
- Throws:
IndexOutOfBoundsException- in case row is out of bounds
-
getColumnScalars
Retrieve a column (0-based) from the matrix as an array of scalars.- Parameters:
col- column of the values to retrieve (0-based)- Returns:
- the column as a Scalar array
- Throws:
IndexOutOfBoundsException- in case column is out of bounds
-
mgetColumnScalars
Retrieve a column (1-based) from the matrix as an array of scalars.- Parameters:
mCol- column of the values to retrieve (1-based)- Returns:
- the column as a Scalar array
- Throws:
IndexOutOfBoundsException- in case column is out of bounds
-