Vectorized methods for clamp function.