vDSP.ThresholdRule.clampToThreshold
Returns the threshold if the input value is less than threshold; otherwise returns the input value.
Declaration
case clampToThresholdDiscussion
Use vDSP.ThresholdRule.clampToThreshold to calculate a new vector where the threshold operation sets all source values below the threshold to the threshold.
let source: [Float] = [12, 13, 14, 15, 16, 17, 18]
let destination = vDSP.threshold(source,
to: 15,
with: .clampToThreshold)
// Prints "[15.0, 15.0, 15.0, 15.0, 16.0, 17.0, 18.0]".
print(destination)