1 #ifndef NPSTAT_MAXABSVALUE_HH_
2 #define NPSTAT_MAXABSVALUE_HH_
21 inline auto maxAbsValue(
22 const T* x,
const unsigned long len) -> decltype(std::abs(*x))
24 typedef decltype(std::abs(*x)) return_type;
26 if (!len)
throw std::invalid_argument(
27 "In npstat::maxAbsValue: empty input array");
29 return_type maxValue = return_type();
30 for (
unsigned long i=0; i<len; ++i)
32 const return_type v = std::abs(*x++);
Definition: AbsArrayProjector.hh:14