org.djunits.value

## Interface FunctionsRel<AU extends AbsoluteLinearUnit<AU,RU>,RU extends Unit<RU>,A extends Absolute & Value<AU>,R extends Relative & Value<RU>>

• Type Parameters:
AU - the Absolute Unit type
RU - the Relative Unit type
A - the absolute type
R - the corresponding relative type

public interface FunctionsRel<AU extends AbsoluteLinearUnit<AU,RU>,RU extends Unit<RU>,A extends Absolute & Value<AU>,R extends Relative & Value<RU>>
The functions to be implemented for relative vectors and matrices.

Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

\$LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) \$, @version \$Revision: 1147 \$, by \$Author: averbraeck \$, initial version Oct 6, 2015
Author:
Alexander Verbraeck, Peter Knoppers
• ### Method Summary

All Methods
Modifier and Type Method and Description
R divide(R rel)
Divide this Relative value by a Relative value for a vector or matrix.
R minus(R rel)
Subtract a Relative value from this Relative value for a vector or matrix.
A plus(A abs)
Add an Absolute value to this Relative value for a vector or matrix.
R plus(R rel)
Add a Relative value to this Relative value for a vector or matrix.
R times(R rel)
Multiply a Relative value by this Relative value for a vector or matrix.
• ### Method Detail

• #### plus

R plus(R rel)
throws ValueException
Add a Relative value to this Relative value for a vector or matrix. The addition is done value by value and the result is stored in a new Relative value. If both operands are sparse, the result is a sparse vector or matrix, otherwise the result is a dense vector or matrix.
Parameters:
rel - R the right operand
Returns:
A the sum of this vector and the operand
Throws:
ValueException - in case this vector or matrix and the operand have a different size
• #### plus

A plus(A abs)
throws ValueException
Add an Absolute value to this Relative value for a vector or matrix. The addition is done value by value and the result is stored in a new Absolute value. If both operands are sparse, the result is a sparse vector or matrix, otherwise the result is a dense vector or matrix.
Parameters:
abs - A the right operand
Returns:
A the sum of this vector and the operand
Throws:
ValueException - in case this vector or matrix and the operand have a different size
• #### minus

R minus(R rel)
throws ValueException
Subtract a Relative value from this Relative value for a vector or matrix. The subtraction is done value by value and the result is stored in a new Relative value. If both operands are sparse, the result is a sparse vector or matrix, otherwise the result is a dense vector or matrix.
Parameters:
rel - R the right operand
Returns:
A the sum of this vector and the operand
Throws:
ValueException - in case this vector or matrix and the operand have a different size
• #### times

R times(R rel)
throws ValueException
Multiply a Relative value by this Relative value for a vector or matrix. The multiplication is done value by value and the result is stored in a new Relative value. If both operands are dense, the result is a dense vector or matrix, otherwise the result is a sparse vector or matrix.
Parameters:
rel - R the right operand
Returns:
A the sum of this vector and the operand
Throws:
ValueException - in case this vector or matrix and the operand have a different size
• #### divide

R divide(R rel)
throws ValueException
Divide this Relative value by a Relative value for a vector or matrix. The division is done value by value and the result is stored in a new Relative value. If both operands are dense, the result is a dense vector or matrix, otherwise the result is a sparse vector or matrix.
Parameters:
rel - R the right operand
Returns:
A the sum of this vector and the operand
Throws:
ValueException - in case this vector or matrix and the operand have a different size

Copyright © 2015–2018 Delft University of Technology. All rights reserved.