51template <
typename Tp,
typename Up = Tp>
58 static TIMEMORY_INLINE
decltype(
auto)
abs(
const type& _v)
63 static TIMEMORY_INLINE
decltype(
auto)
sqr(
const type& _v)
68 static TIMEMORY_INLINE
decltype(
auto)
sqrt(
const type& _v)
74 static TIMEMORY_INLINE
decltype(
auto)
min(
const type& _l,
const V& _r)
80 static TIMEMORY_INLINE
decltype(
auto)
max(
const type& _l,
const V& _r)
93 static TIMEMORY_INLINE
decltype(
auto)
plus(
type& _l,
const V& _r)
99 static TIMEMORY_INLINE
decltype(
auto)
minus(
type& _l,
const V& _r)
104 template <
typename V>
110 template <
typename V>
111 static TIMEMORY_INLINE
decltype(
auto)
divide(
type& _l,
const V& _r)
117 template <
typename V>
118 static TIMEMORY_INLINE
auto plus(
const type& _l,
const V& _r)
124 template <
typename V>
125 static TIMEMORY_INLINE
auto minus(
const type& _l,
const V& _r)
131 template <
typename V>
138 template <
typename V>
139 static TIMEMORY_INLINE
auto divide(
const type& _l,
const V& _r)
149 template <
typename V>
155 template <
typename V>
161 template <
typename V>
167 template <
typename V>
168 static TIMEMORY_INLINE
auto min(
const type& _l,
const V& _r,
int)
175 template <
typename V>
176 static TIMEMORY_INLINE
auto max(
const type& _l,
const V& _r,
int)
183 template <
typename V>
191 template <
typename V>
192 static TIMEMORY_INLINE
auto plus(
type& _l,
const V& _r,
int)
194 std::declval<type&>())
199 template <
typename V>
200 static TIMEMORY_INLINE
auto minus(
type& _l,
const V& _r,
int)
202 std::declval<type&>())
207 template <
typename V>
208 static TIMEMORY_INLINE
auto multiply(
type& _l,
const V& _r,
int)
210 std::declval<type&>())
215 template <
typename V,
typename U =
void>
216 static TIMEMORY_INLINE
auto divide(
type& _l,
const V& _r,
int)
218 std::declval<type&>())
226 template <
typename V>
227 static TIMEMORY_INLINE
auto abs(
const V& _v,
long)
232 template <
typename V>
233 static TIMEMORY_INLINE
auto sqr(
const V& _v,
long)
238 template <
typename V>
239 static TIMEMORY_INLINE
auto sqrt(
const V& _v,
long)
244 template <
typename V>
245 static TIMEMORY_INLINE
auto min(
const type& _l,
const V&,
long)
250 template <
typename V>
251 static TIMEMORY_INLINE
auto max(
const type& _l,
const V&,
long)
256 template <
typename V>
262 template <
typename V>
263 static TIMEMORY_INLINE
auto&
plus(
type& _l,
const V&,
long)
268 template <
typename V>
269 static TIMEMORY_INLINE
auto&
minus(
type& _l,
const V&,
long)
274 template <
typename V>
275 static TIMEMORY_INLINE
auto&
multiply(
type& _l,
const V&,
long)
280 template <
typename V,
typename U =
void>
281 static TIMEMORY_INLINE
auto&
divide(
type& _l,
const V&,
long)
292#define TIMEMORY_MATH_NULL_TYPE_COMPUTE(TYPE) \
298 struct compute<TYPE, TYPE> \
301 static type abs(const type&) { return type{}; } \
302 static type sqr(const type&) { return type{}; } \
303 static type sqrt(const type&) { return type{}; } \
304 static type max(const type&, const type&) { return type{}; } \
305 static type min(const type&, const type&) { return type{}; } \
306 static type percent_diff(const type&, const type&) { return type{}; } \
308 template <typename Vp> \
309 static decltype(auto) plus(type& lhs, const Vp&) \
313 template <typename Vp> \
314 static decltype(auto) minus(type& lhs, const Vp&) \
318 template <typename Vp> \
319 static decltype(auto) multiply(type& lhs, const Vp&) \
323 template <typename Vp> \
324 static decltype(auto) divide(type& lhs, const Vp&) \
#define TIMEMORY_MATH_NULL_TYPE_COMPUTE(TYPE)
::tim::statistics< Tp > max(::tim::statistics< Tp > lhs, const Tp &rhs)
::tim::statistics< Tp > min(::tim::statistics< Tp > lhs, const Tp &rhs)
type_list abs(type_list<>)
Tp & plus(Tp &, const Up &)
type_list sqr(type_list<>)
auto divide(Tp &_lhs, Up _rhs, type_list<>,...) -> decltype(_lhs/=_rhs, void())
Tp & minus(Tp &, const Up &)
Tp & multiply(Tp &, const Up &)
Tp percent_diff(const Tp &, const Tp &)
type_list sqrt(type_list<>)
lightweight tuple-alternative for meta-programming logic
static constexpr auto value
Struct for performing math operations on complex data structures without using globally overload oper...
static auto multiply(const type &_l, const V &_r)
static auto divide(const type &_l, const V &_r)
static decltype(auto) sqr(const type &_v)
static decltype(auto) abs(const type &_v)
static decltype(auto) sqrt(const type &_v)
static decltype(auto) max(const type &_l, const V &_r)
static decltype(auto) min(const type &_l, const V &_r)
static decltype(auto) minus(type &_l, const V &_r)
static auto minus(const type &_l, const V &_r)
static decltype(auto) percent_diff(const type &_l, const V &_r)
static decltype(auto) plus(type &_l, const V &_r)
static decltype(auto) multiply(type &_l, const V &_r)
static decltype(auto) divide(type &_l, const V &_r)
static auto plus(const type &_l, const V &_r)
this is a placeholder type for optional type-traits. It is used as the default type for the type-trai...