public protocol VectorProtocol : AdditiveArithmetic
A type that represents an unranked vector space. Values of this type are elements in this vector space and have either no shape or a static shape.
-
The type of scalars in the vector space.
Declaration
associatedtype VectorSpaceScalar : AdditiveArithmetic
-
Declaration
func adding(_ x: VectorSpaceScalar) -> Self
-
add(_:)
Default Implementation
Declaration
mutating mutating func add(_ x: VectorSpaceScalar)
-
Declaration
func subtracting(_ x: VectorSpaceScalar) -> Self
-
subtract(_:)
Default Implementation
Declaration
mutating mutating func subtract(_ x: VectorSpaceScalar)
-
Returns
self
multiplied by the given scalar.Declaration
func scaled(by scalar: VectorSpaceScalar) -> Self
-
scale(by:)
Multiplies
self
by the given scalar.Default Implementation
Declaration
mutating mutating func scale(by scalar: VectorSpaceScalar)