Package org.djunits.vecmat.def
Class AbsVector<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>,VA extends AbsVector<A,Q,VA,VQ,VAT>,VQ extends Vector<Q,VQ,?,?,?>,VAT extends AbsVector<A,Q,VAT,?,VA>>
java.lang.Object
org.djunits.vecmat.def.AbsVectorMatrix<A,Q,VA,VQ,VAT>
org.djunits.vecmat.def.AbsVector<A,Q,VA,VQ,VAT>
- Type Parameters:
A- the absolute quantity typeQ- the corresponding relative quantity typeVA- the absolute vector or matrix typeVQ- the relative vector or matrix typeVAT- the type of the transposed version of the absolute vector
- All Implemented Interfaces:
Serializable,Iterable<A>,Value<VA,Q>
- Direct Known Subclasses:
AbsVector1,AbsVector2,AbsVector3,AbsVectorN
public abstract class AbsVector<A extends AbsQuantity<A,Q,?>,Q extends Quantity<Q>,VA extends AbsVector<A,Q,VA,VQ,VAT>,VQ extends Vector<Q,VQ,?,?,?>,VAT extends AbsVector<A,Q,VAT,?,VA>>
extends AbsVectorMatrix<A,Q,VA,VQ,VAT>
implements Iterable<A>
AbsVector contains the contract for Vector classes with absolute 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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classThe iterator class for elements of an absolute vector.static interfaceFormatting methods for absolute column vector.static interfaceFormatting methods for absolute row vector. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget(int index) Retrieve a value from the vector.A[]Return the vector as an array of scalars.double[]Return the vector as an array of SI values.booleanReturn whether this vector is a column vector.booleanReturn whether this vector is a row vector.iterator()Create and return an iterator over the scalars in this vector in proper sequence.mget(int mIndex) Retrieve a value from the vector, based on a 1-valued index.doublemsi(int mIndex) Retrieve an si-value from the vector, based on a 1-valued index.doublesi(int index) Retrieve an si-value from the vector.intsize()Retrieve the size of the vector.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 java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.djunits.value.Value
format, format, isAbsolute, setDisplayUnit
-
Constructor Details
-
AbsVector
Create a new vector of absolute values with a reference point.- Parameters:
vector- the underlying relative vector with SI values relative to the reference pointreference- the reference point for the absolute values
-
-
Method Details
-
size
public int size()Retrieve the size of the vector.- Returns:
- the size of the vector
-
isColumnVector
public boolean isColumnVector()Return whether this vector is a column vector.- Returns:
- whether this vector is a column vector
-
isRowVector
public boolean isRowVector()Return whether this vector is a row vector.- Returns:
- whether this vector is a row vector
-
si
Retrieve an si-value from the vector.- Parameters:
index- the index (0-based) to retrieve the value from- Returns:
- the value as a Scalar
- Throws:
IndexOutOfBoundsException- in case index is out of bounds
-
msi
Retrieve an si-value from the vector, based on a 1-valued index.- Parameters:
mIndex- the index (1-based) to retrieve the value from- Returns:
- the value as a Scalar
- Throws:
IndexOutOfBoundsException- in case index is out of bounds
-
get
Retrieve a value from the vector.- Parameters:
index- the index (0-based) to retrieve the value from- Returns:
- the value as a Scalar
- Throws:
IndexOutOfBoundsException- in case index is out of bounds
-
mget
Retrieve a value from the vector, based on a 1-valued index.- Parameters:
mIndex- the index (1-based) to retrieve the value from- Returns:
- the value as a Scalar
- Throws:
IndexOutOfBoundsException- in case index is out of bounds
-
getScalarArray
Return the vector as an array of scalars.- Returns:
- the vector as an array of scalars
-
getSiArray
public double[] getSiArray()Return the vector as an array of SI values.- Returns:
- the vector as an array of SI valies
-
iterator
Create and return an iterator over the scalars in this vector in proper sequence.
-