A SIMD vector of a fixed number of elements.
SDK
- Xcode 10.2+
Framework
- Swift Standard Library
Declaration
protocol SIMD
A SIMD vector of a fixed number of elements.
SDK
Framework
protocol SIMD
associatedtype Mask StorageThe mask type resulting from pointwise comparisons of this vector type.
Required.
init<S>(S)Creates a vector from the given sequence.
init(Self .Scalar)Deprecatedinit(repeating: Self .Scalar)A vector with the specified value in all lanes.
var indices: Range<Int>The valid indices for subscripting the vector.
static var one: SelfA vector with one in all lanes.
static var one: SelfA vector with one in all lanes.
static var zero: SelfA vector with zero in all lanes.
static var zero: SelfA vector with zero in all lanes.
func max() -> Self .ScalarReturns the greatest scalar in the vector.
func max() -> Self .ScalarThe greatest element in the vector.
func min() -> Self .ScalarReturns the least scalar in the vector.
func min() -> Self .ScalarThe least element in the vector.
func replace(with: Self .Scalar, where: SIMDMask<Self .Mask Storage>)Replaces elements of this vector with other in the lanes where mask is true.
func replace(with: Self, where: SIMDMask<Self .Mask Storage>)Replaces elements of this vector with elements of other in the lanes where mask is true.
func replacing(with: Self .Scalar, where: SIMDMask<Self .Mask Storage>) -> SelfReturns a copy of this vector, with elements other in the lanes where mask is true.
func replacing(with: Self, where: SIMDMask<Self .Mask Storage>) -> SelfReturns a copy of this vector, with elements replaced by elements of other in the lanes where mask is true.
func sum() -> Self .ScalarReturns the sum of the scalars in the vector.
func wrapped Sum() -> Self .ScalarReturns the sum of the scalars in the vector, computed with wrapping addition.
static func random(in: Closed Range<Self .Scalar>) -> SelfReturns a vector with random values from within the specified range in all lanes.
static func random(in: Range<Self .Scalar>) -> SelfReturns a vector with random values from within the specified range in all lanes.
static func random(in: Closed Range<Self .Scalar>) -> SelfReturns a vector with random values from within the specified range in all lanes.
static func random(in: Range<Self .Scalar>) -> SelfReturns a vector with random values from within the specified range in all lanes.
static func random<T>(in: Closed Range<Self .Scalar>, using: inout T) -> SelfReturns a vector with random values from within the specified range in all lanes, using the given generator as a source for randomness.
static func random<T>(in: Range<Self .Scalar>, using: inout T) -> SelfReturns a vector with random values from within the specified range in all lanes, using the given generator as a source for randomness.
static func random<T>(in: Closed Range<Self .Scalar>, using: inout T) -> SelfReturns a vector with random values from within the specified range in all lanes, using the given generator as a source for randomness.
static func random<T>(in: Range<Self .Scalar>, using: inout T) -> SelfReturns a vector with random values from within the specified range in all lanes, using the given generator as a source for randomness.
static func - (Self) -> SelfDeprecatedstatic func .!= (Self .Scalar, Self) -> SIMDMask<Self .Mask Storage>Returns a vector mask with the result of a pointwise inequality comparison.
static func .!= (Self, Self .Scalar) -> SIMDMask<Self .Mask Storage>Returns a vector mask with the result of a pointwise inequality comparison.
static func .!= (Self, Self) -> SIMDMask<Self .Mask Storage>Returns a vector mask with the result of a pointwise inequality comparison.
static func .< (Self .Scalar, Self) -> SIMDMask<Self .Mask Storage>Returns a vector mask with the result of a pointwise less than comparison.
static func .< (Self, Self .Scalar) -> SIMDMask<Self .Mask Storage>Returns a vector mask with the result of a pointwise less than comparison.
static func .< (Self, Self) -> SIMDMask<Self .Mask Storage>Returns a vector mask with the result of a pointwise less than comparison.
static func .<= (Self .Scalar, Self) -> SIMDMask<Self .Mask Storage>Returns a vector mask with the result of a pointwise less than or equal comparison.
static func .<= (Self, Self .Scalar) -> SIMDMask<Self .Mask Storage>Returns a vector mask with the result of a pointwise less than or equal comparison.
static func .<= (Self, Self) -> SIMDMask<Self .Mask Storage>Returns a vector mask with the result of a pointwise less than or equal comparison.
static func .== (Self .Scalar, Self) -> SIMDMask<Self .Mask Storage>Returns a vector mask with the result of a pointwise equality comparison.
static func .== (Self, Self .Scalar) -> SIMDMask<Self .Mask Storage>Returns a vector mask with the result of a pointwise equality comparison.
static func .== (Self, Self) -> SIMDMask<Self .Mask Storage>Returns a vector mask with the result of a pointwise equality comparison.
static func .> (Self .Scalar, Self) -> SIMDMask<Self .Mask Storage>Returns a vector mask with the result of a pointwise greater than comparison.
static func .> (Self, Self .Scalar) -> SIMDMask<Self .Mask Storage>Returns a vector mask with the result of a pointwise greater than comparison.
static func .> (Self, Self) -> SIMDMask<Self .Mask Storage>Returns a vector mask with the result of a pointwise greater than comparison.
static func .>= (Self .Scalar, Self) -> SIMDMask<Self .Mask Storage>Returns a vector mask with the result of a pointwise greater than or equal comparison.
static func .>= (Self, Self .Scalar) -> SIMDMask<Self .Mask Storage>Returns a vector mask with the result of a pointwise greater than or equal comparison.
static func .>= (Self, Self) -> SIMDMask<Self .Mask Storage>Returns a vector mask with the result of a pointwise greater than or equal comparison.
static func == (Self, Self) -> BoolReturns a Boolean value indicating whether two vectors are equal.
protocol SIMDScalarA type that can be used as an element in a SIMD vector.
protocol SIMDStorageA type that can function as storage for a SIMD vector type.