LinearType

interface LinearType<T : LinearType<T>>(source)

Represents a linear type that supports basic arithmetic operations for objects of the same type. This interface enforces a linear structure that can be used to define custom mathematical types.

Parameters

T

The type that implements this interface, constrained by itself to maintain type safety.

Inheritors

Functions

Link copied to clipboard
abstract operator fun div(scale: Double): T

Divides the current object by the given scale factor.

Link copied to clipboard
abstract operator fun minus(right: T): T

Subtracts the specified value from the current value.

Link copied to clipboard
abstract operator fun plus(right: T): T

Adds the given value right to this value and returns the result.

Link copied to clipboard
abstract operator fun times(scale: Double): T

Multiplies the current instance by the specified scalar value.