49 template<
typename dtype>
50 dtype
clip(dtype inValue, dtype inMinValue, dtype inMaxValue)
54 #ifdef __cpp_lib_clamp
55 const auto comparitor = [](dtype lhs, dtype rhs) noexcept ->
bool {
return lhs < rhs; };
57 return std::clamp(inValue, inMinValue, inMaxValue, comparitor);
59 if (inValue < inMinValue)
63 else if (inValue > inMaxValue)
83 template<
typename dtype>
86 return inArray.
clip(inMinValue, inMaxValue);
#define STATIC_ASSERT_ARITHMETIC_OR_COMPLEX(dtype)
Definition: StaticAsserts.hpp:56
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:138
self_type clip(value_type inMin, value_type inMax) const
Definition: NdArrayCore.hpp:2316
Definition: Coordinate.hpp:45
dtype clip(dtype inValue, dtype inMinValue, dtype inMaxValue)
Definition: clip.hpp:50