## Interface Vector.Rel<U extends Unit<U>,​S extends Scalar<U,​S>,​RV extends Vector.Rel<U,​S,​RV>>

• ### Method Detail

• #### plus

RV plus​(RV increment)
throws ValueRuntimeException
Add a relative vector to this relative mutable vector. A new vector is returned. When the vector itself needs to be changed, use the increaseBy(V) method instead. The addition is done value by value and the result is stored in a new vector. If both operands are sparse, the result is a sparse vector, otherwise the result is a dense vector.
Parameters:
increment - RV; the relative vector (mutable or immutable, sparse or dense) to add
Returns:
RMV; the sum of this vector and the operand as a new relative, mutable vector
Throws:
ValueRuntimeException - in case this vector and the operand have a different size
• #### minus

RV minus​(RV decrement)
throws ValueRuntimeException
Subtract a relative vector from this relative mutable vector. The display unit of the result is the display unit of this absolute vector. The subtraction is done value by value and the result is stored in a new vector. If both operands are sparse, the result is a sparse vector, otherwise the result is a dense vector.
Parameters:
decrement - RV; the value to subtract
Returns:
RMV; the difference of this vector and the operand as a new relative, mutable vector
Throws:
ValueRuntimeException - in case this vector and the operand have a different size
• #### multiplyBy

RV multiplyBy​(double multiplier)
Multiply all values of this vector by the multiplier. This only works if the vector is mutable.
Parameters:
multiplier - double; the factor by which to multiply all values
Returns:
V; this modified vector
Throws:
ValueRuntimeException - in case the vector is immutable
• #### divideBy

RV divideBy​(double divisor)
Divide all values of this vector by the divisor. This only works if the vector is mutable.
Parameters:
divisor - double; the value by which to divide all values
Returns:
V; this modified vector
Throws:
ValueRuntimeException - in case the vector is immutable