Package org.djunits.vecmat.def
Class Vector<Q extends Quantity<Q>,V extends Vector<Q,V,SI,H,VT>,SI extends Vector<SIQuantity,SI,?,?,?>,H extends Vector<?,?,?,?,?>,VT extends Vector<Q,VT,?,?,V>>
java.lang.Object
org.djunits.vecmat.def.VectorMatrix<Q,V,SI,H,VT>
org.djunits.vecmat.def.Vector<Q,V,SI,H,VT>
- Type Parameters:
Q- the quantity typeV- the vector typeSI- the vector type with generics <SIQuantity, SIUnit<H- the generic vector type with generics <?, ?< for Hadamard operationsVT- the type of the transposed version of the vector
- All Implemented Interfaces:
Serializable,Iterable<Q>,Additive<V>,Scalable<V>,Value<V,,Q> Hadamard<H,,SI> Normed<Q>
public abstract class Vector<Q extends Quantity<Q>,V extends Vector<Q,V,SI,H,VT>,SI extends Vector<SIQuantity,SI,?,?,?>,H extends Vector<?,?,?,?,?>,VT extends Vector<Q,VT,?,?,V>>
extends VectorMatrix<Q,V,SI,H,VT>
implements Iterable<Q>, Normed<Q>
Vector contains the contract for Vector classes that contain relative quantity 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 Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget(int index) Retrieve a value from the vector.abstract Q[]Return the vector as an array of scalars.abstract 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.abstract doublesi(int index) Retrieve an si-value from the vector.abstract intsize()Retrieve the size of the vector.Methods 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 java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.djunits.vecmat.operations.Normed
norm, normL1, normL2, normLinf, normLpMethods inherited from interface org.djunits.value.Value
format, format, isAbsolute, setDisplayUnit
-
Constructor Details
-
Vector
Create a new Vector with a unit, as an extension of Matrix.- Parameters:
displayUnit- the display unit to use
-
-
Method Details
-
size
public abstract int size()Retrieve the size of the vector.- Returns:
- the size of the vector
-
isColumnVector
public abstract 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
-
iterator
Create and return an iterator over the scalars in this vector in proper sequence.
-