48 template<
typename dtype>
49 dtype
clip(dtype inValue, dtype inMinValue, dtype inMaxValue)
54 const auto comparitor = [](dtype lhs, dtype rhs)
noexcept ->
bool {
return lhs < rhs; };
56 return std::clamp(inValue, inMinValue, inMaxValue, comparitor);
58 if (inValue < inMinValue)
62 else if (inValue > inMaxValue)
82 template<
typename dtype>
85 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:135
self_type clip(value_type inMin, value_type inMax) const
Definition NdArrayCore.hpp:2445
Definition Cartesian.hpp:39
dtype clip(dtype inValue, dtype inMinValue, dtype inMaxValue)
Definition clip.hpp:49