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 type
Q - the corresponding relative quantity type
VA - the absolute vector or matrix type
VQ - the relative vector or matrix type
VAT - 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:
  • Constructor Details

    • AbsVector

      public AbsVector(VQ vector, Reference<?,A,Q> reference)
      Create a new vector of absolute values with a reference point.
      Parameters:
      vector - the underlying relative vector with SI values relative to the reference point
      reference - 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

      public double si(int index) throws IndexOutOfBoundsException
      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

      public double msi(int mIndex) throws IndexOutOfBoundsException
      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

      public A get(int index) throws IndexOutOfBoundsException
      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

      public A mget(int mIndex) throws IndexOutOfBoundsException
      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

      public A[] 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

      public Iterator<A> iterator()
      Create and return an iterator over the scalars in this vector in proper sequence.
      Specified by:
      iterator in interface Iterable<A extends AbsQuantity<A,Q,?>>
      Returns:
      an iterator over the scalars in this vector in proper sequence