Package org.djunits.vecmat.d3
Class Vector3.Row<Q extends Quantity<Q>>
java.lang.Object
org.djunits.vecmat.def.VectorMatrix<Q,V,SI,H,VT>
org.djunits.vecmat.def.Vector<Q,V,SI,H,VT>
org.djunits.vecmat.d3.Vector3<Q,Vector3.Row<Q>,Vector3.Row<SIQuantity>,Vector3.Row<?>,Vector3.Col<Q>>
org.djunits.vecmat.d3.Vector3.Row<Q>
- Type Parameters:
Q- the quantity type
- All Implemented Interfaces:
Serializable,Iterable<Q>,Additive<Vector3.Row<Q>>,Scalable<Vector3.Row<Q>>,Value<Vector3.Row<Q>,,Q> Vector.Row<Vector3.Row<Q>,,Q> Hadamard<Vector3.Row<?>,,Vector3.Row<SIQuantity>> Normed<Q>
- Enclosing class:
- Vector3<Q extends Quantity<Q>,
V extends Vector3<Q, V, SI, H, VT>, SI extends Vector3<SIQuantity, SI, ?, ?, ?>, H extends Vector3<?, ?, ?, ?, ?>, VT extends Vector3<Q, VT, ?, ?, V>>
public static class Vector3.Row<Q extends Quantity<Q>>
extends Vector3<Q,Vector3.Row<Q>,Vector3.Row<SIQuantity>,Vector3.Row<?>,Vector3.Col<Q>>
implements Vector.Row<Vector3.Row<Q>,Q>
Vector3.Row implements a row vector with three real-valued entries. The vector is immutable, except for the display unit,
which can be changed.
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.djunits.vecmat.d3.Vector3
Vector3.Col<Q extends Quantity<Q>>, Vector3.Row<Q extends Quantity<Q>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<TQ extends Quantity<TQ>>
Vector3.Row<TQ>Return the vector 'as' a vector with a known quantity, using a unit to express the result in.intcols()Return the number of columns.divideEntries(Vector3.Row<?> other) Divide the entries of this vector, matrix or table on an entry-by-entry basis with those of another collection of the same type (but possibly representing another quantity).instantiateSi(double[] siNew, SIUnit siUnit) Return a new vector or matrix in SI-units with the given SI or BASE values.protected Vector3.Row<Q>instantiateSi(double xSi, double ySi, double zSi) Return a new column or row vector with adapted x, y and z values.Invert the vector, matrix or table on an entry-by-entry basis.booleanReturn whether this vector is a column vector.Multiply this row vector with a matrix, resulting in a column vector.multiply(Vector3.Col<?> otherVec) Multiply this row vector with a column vector, resulting in a scalar quantity.multiplyEntries(Quantity<?> quantity) Multiply the entries of this vector, matrix or table by the given quantity.multiplyEntries(Vector3.Row<?> other) Multiply the entries of this vector, matrix or table on an entry-by-entry basis with those of another collection of the same type (but possibly representing another quantity).static <Q extends Quantity<Q>>
Vector3.Row<Q>Create a Vector3.Row without needing generics.static <Q extends Quantity<Q>>
Vector3.Row<Q>Create a Vector3.Row without needing generics.static <Q extends Quantity<Q>>
Vector3.Row<Q>of(Q[] data) Create a Vector3.Row without needing generics.static <Q extends Quantity<Q>>
Vector3.Row<Q>of(Q x, Q y, Q z) Create a Vector3.Row without needing generics.static <Q extends Quantity<Q>>
Vector3.Row<Q>Create a Vector3.Row without needing generics.static <Q extends Quantity<Q>>
Vector3.Row<Q>Create a Vector3.Row without needing generics.introws()Return the number of rows.Return a transposed vector or matrix, where rows and columns have been swapped.Methods inherited from class org.djunits.vecmat.d3.Vector3
abs, add, add, equals, getScalarArray, getSiArray, hashCode, instantiateSi, isRelative, iterator, max, mean, median, min, negate, nonZeroCount, normL1, normL2, normLinf, normLp, scaleBy, si, size, subtract, subtract, sum, unsafeSiArray, x, xSi, y, ySi, z, zSiMethods inherited from class org.djunits.vecmat.def.Vector
get, isRowVector, mget, msiMethods inherited from class org.djunits.vecmat.def.VectorMatrix
asMatrix1x1, asMatrix2x2, asMatrix3x3, asMatrixNxM, asMatrixNxN, asQuantityTable, asVector1, asVector2Col, asVector2Row, asVector3Col, asVector3Row, asVectorNCol, asVectorNRow, checkMultiply, checkMultiply, divideElements, getDisplayUnit, multiplyElements, nnz, setDisplayUnit, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.djunits.vecmat.operations.Hadamard
divideEntriesMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.djunits.value.Value
getDisplayUnit, isAbsolute, isRelative, setDisplayUnit, setDisplayUnitMethods inherited from interface org.djunits.vecmat.def.Vector.Row
format, format, format
-
Constructor Details
-
Row
Create a new 3 row vector with a display unit.- Parameters:
xSi- the x-value expressed in the SI unitySi- the y-value expressed in the SI unitzSi- the z-value expressed in the SI unitdisplayUnit- the display unit to use
-
-
Method Details
-
isColumnVector
public boolean isColumnVector()Description copied from class:Vector3Return whether this vector is a column vector.- Specified by:
isColumnVectorin classVector3<Q extends Quantity<Q>,Vector3.Row<Q extends Quantity<Q>>, Vector3.Row<SIQuantity>, Vector3.Row<?>, Vector3.Col<Q extends Quantity<Q>>> - Returns:
- whether this vector is a column vector
-
rows
public int rows()Description copied from class:VectorMatrixReturn the number of rows.- Specified by:
rowsin classVectorMatrix<Q extends Quantity<Q>,Vector3.Row<Q extends Quantity<Q>>, Vector3.Row<SIQuantity>, Vector3.Row<?>, Vector3.Col<Q extends Quantity<Q>>> - Returns:
- the number of rows
-
cols
public int cols()Description copied from class:VectorMatrixReturn the number of columns.- Specified by:
colsin classVectorMatrix<Q extends Quantity<Q>,Vector3.Row<Q extends Quantity<Q>>, Vector3.Row<SIQuantity>, Vector3.Row<?>, Vector3.Col<Q extends Quantity<Q>>> - Returns:
- the number of columns
-
instantiateSi
Description copied from class:Vector3Return a new column or row vector with adapted x, y and z values.- Specified by:
instantiateSiin classVector3<Q extends Quantity<Q>,Vector3.Row<Q extends Quantity<Q>>, Vector3.Row<SIQuantity>, Vector3.Row<?>, Vector3.Col<Q extends Quantity<Q>>> - Parameters:
xSi- the x value to useySi- the y value to usezSi- the z value to use- Returns:
- a new column or row vector with adapted x, y and z values
-
instantiateSi
Description copied from class:VectorMatrixReturn a new vector or matrix in SI-units with the given SI or BASE values.- Specified by:
instantiateSiin classVectorMatrix<Q extends Quantity<Q>,Vector3.Row<Q extends Quantity<Q>>, Vector3.Row<SIQuantity>, Vector3.Row<?>, Vector3.Col<Q extends Quantity<Q>>> - Parameters:
siNew- the values for the new vector or matrix in row-major formatsiUnit- the new unit for the new vector or matrix- Returns:
- a new matrix with the provided SI or BASE values
-
transpose
Description copied from class:VectorMatrixReturn a transposed vector or matrix, where rows and columns have been swapped.- Specified by:
transposein classVectorMatrix<Q extends Quantity<Q>,Vector3.Row<Q extends Quantity<Q>>, Vector3.Row<SIQuantity>, Vector3.Row<?>, Vector3.Col<Q extends Quantity<Q>>> - Returns:
- a transposed vector or matrix, where rows and columns have been swapped
-
invertEntries
Description copied from interface:HadamardInvert the vector, matrix or table on an entry-by-entry basis.- Specified by:
invertEntriesin interfaceHadamard<Vector3.Row<?>,Vector3.Row<SIQuantity>> - Overrides:
invertEntriesin classVectorMatrix<Q extends Quantity<Q>,Vector3.Row<Q extends Quantity<Q>>, Vector3.Row<SIQuantity>, Vector3.Row<?>, Vector3.Col<Q extends Quantity<Q>>> - Returns:
- a new vector, matrix or table with an entry-by-entry inversion (1/value) of the entries
-
multiplyEntries
Description copied from interface:HadamardMultiply the entries of this vector, matrix or table on an entry-by-entry basis with those of another collection of the same type (but possibly representing another quantity).- Specified by:
multiplyEntriesin interfaceHadamard<Vector3.Row<?>,Vector3.Row<SIQuantity>> - Overrides:
multiplyEntriesin classVectorMatrix<Q extends Quantity<Q>,Vector3.Row<Q extends Quantity<Q>>, Vector3.Row<SIQuantity>, Vector3.Row<?>, Vector3.Col<Q extends Quantity<Q>>> - Parameters:
other- the other collection of the same type- Returns:
- a new vector, matrix or table with an entry-by-entry multiplication of its entries
-
divideEntries
Description copied from interface:HadamardDivide the entries of this vector, matrix or table on an entry-by-entry basis with those of another collection of the same type (but possibly representing another quantity).- Specified by:
divideEntriesin interfaceHadamard<Vector3.Row<?>,Vector3.Row<SIQuantity>> - Overrides:
divideEntriesin classVectorMatrix<Q extends Quantity<Q>,Vector3.Row<Q extends Quantity<Q>>, Vector3.Row<SIQuantity>, Vector3.Row<?>, Vector3.Col<Q extends Quantity<Q>>> - Parameters:
other- the other collection of the same type- Returns:
- a new vector, matrix or table with an entry-by-entry division of this collection's entries and other's entries
-
multiply
Multiply this row vector with a column vector, resulting in a scalar quantity.- Parameters:
otherVec- the column vector to multiply with- Returns:
- the resulting matrix from the multiplication
-
multiply
Multiply this row vector with a matrix, resulting in a column vector.- Parameters:
otherMat- the matrix to multiply with- Returns:
- the resulting column vector from the multiplication
-
multiplyEntries
Description copied from interface:HadamardMultiply the entries of this vector, matrix or table by the given quantity.- Specified by:
multiplyEntriesin interfaceHadamard<Vector3.Row<?>,Vector3.Row<SIQuantity>> - Overrides:
multiplyEntriesin classVectorMatrix<Q extends Quantity<Q>,Vector3.Row<Q extends Quantity<Q>>, Vector3.Row<SIQuantity>, Vector3.Row<?>, Vector3.Col<Q extends Quantity<Q>>> - Parameters:
quantity- the scalar quantity to multiply by- Returns:
- a new vector, matrix or table where the entries have been multiplied by the given quantity
-
of
public static <Q extends Quantity<Q>> Vector3.Row<Q> of(double xInUnit, double yInUnit, double zInUnit, Unit<?, Q> unit) Create a Vector3.Row without needing generics.- Type Parameters:
Q- the quantity type- Parameters:
xInUnit- the x-value expressed in the unityInUnit- the y-value expressed in the unitzInUnit- the z-value expressed in the unitunit- the unit of the data, which will also be used as the display unit- Returns:
- a new Vector3.Row with a unit
-
of
Create a Vector3.Row without needing generics. The display unit will be taken from the x-quantity.- Type Parameters:
Q- the quantity type- Parameters:
x- the x-value expressed as a quantityy- the y-value expressed as a quantityz- the z-value expressed as a quantity- Returns:
- a new Vector3.Row with a unit
-
of
Create a Vector3.Row without needing generics.- Type Parameters:
Q- the quantity type- Parameters:
dataInUnit- the vector entries expressed as an array in the display unitunit- the unit of the data, which will also be used as the display unit- Returns:
- a new Vector3.Row with a unit
-
ofSi
Create a Vector3.Row without needing generics.- Type Parameters:
Q- the quantity type- Parameters:
dataSi- the vector entries expressed as an array in the SI unitsdisplayUnit- the display unit to use- Returns:
- a new Vector3.Row with a unit
-
ofSi
public static <Q extends Quantity<Q>> Vector3.Row<Q> ofSi(double xSi, double ySi, double zSi, Unit<?, Q> displayUnit) Create a Vector3.Row without needing generics.- Type Parameters:
Q- the quantity type- Parameters:
xSi- the x vector entry expressed in the SI unitySi- the y vector entry expressed in the SI unitzSi- the z vector entry expressed in the SI unitdisplayUnit- the display unit to use- Returns:
- a new Vector3.Row with a unit
-
of
Create a Vector3.Row without needing generics. The display unit will be taken from the first quantity in the array.- Type Parameters:
Q- the quantity type- Parameters:
data- the vector entries expressed as an array of quantities- Returns:
- a new Vector3.Row with a unit
-
as
public <TQ extends Quantity<TQ>> Vector3.Row<TQ> as(Unit<?, TQ> targetUnit) throws IllegalArgumentExceptionReturn the vector 'as' a vector with a known quantity, using a unit to express the result in. Throw a Runtime exception when the SI units of this vector and the target vector do not match.- Type Parameters:
TQ- target quantity type- Parameters:
targetUnit- the unit to convert the vector to- Returns:
- a quantity typed in the target vector class
- Throws:
IllegalArgumentException- when the units do not match
-