Instance Methodswift 6.0.1Swift
replacing(with:where:)
Returns a copy of this vector, with elements replaced by elements of other
in the lanes where mask
is true
.
func replacing(with other: SIMDMask<Storage>, where mask: SIMDMask<Storage>) -> SIMDMask<Storage>
Equivalent to:
var result = Self()
for i in indices {
result[i] = mask[i] ? other[i] : self[i]
}
Other members in extension
Type members
static func .! (a: SIMDMask<Storage>
) -> SIMDMask<Storage> A vector mask that is the pointwise logical negation of the input.
static func .!= (a: SIMDMask<Storage>, b: SIMDMask<Storage>
) -> SIMDMask<Storage> A vector mask with the result of a pointwise inequality comparison.
static func .& (a: SIMDMask<Storage>, b: SIMDMask<Storage>
) -> SIMDMask<Storage> A vector mask that is the pointwise logical conjunction of the inputs.
static func .&= (a: inout SIMDMask<Storage>, b: SIMDMask<Storage>
) Replaces
a
with the pointwise logical conjunction ofa
andb
.static func .== (a: SIMDMask<Storage>, b: SIMDMask<Storage>
) -> SIMDMask<Storage> A vector mask with the result of a pointwise equality comparison.
static func .^ (a: SIMDMask<Storage>, b: SIMDMask<Storage>
) -> SIMDMask<Storage> A vector mask that is the pointwise exclusive or of the inputs.
static func .^= (a: inout SIMDMask<Storage>, b: SIMDMask<Storage>
) Replaces
a
with the pointwise exclusive or ofa
andb
.static func .| (a: SIMDMask<Storage>, b: SIMDMask<Storage>
) -> SIMDMask<Storage> A vector mask that is the pointwise logical disjunction of the inputs.
static func .|= (a: inout SIMDMask<Storage>, b: SIMDMask<Storage>
) Replaces
a
with the pointwise logical disjunction ofa
andb
.
Instance members
func replace(with: SIMDMask<Storage>, where: SIMDMask<Storage>
) Replaces elements of this vector with elements of
other
in the lanes wheremask
istrue
.