A type T has horizontal functions if:
More...
#include <horizontal.h>
template<typename T>
{
{ bbm::hsum(a) } -> std::convertible_to<value_t<T>>;
{ bbm::hprod(a) } -> std::convertible_to<value_t<T>>;
{ bbm::hmax(a) } -> std::convertible_to<value_t<T>>;
{ bbm::hmin(a) } -> std::convertible_to<value_t<T>>;
{ bbm::dot(a,a) } -> std::convertible_to<value_t<T>>;
{ bbm::norm(a) } -> std::convertible_to<value_t<T>>;
{ bbm::squared_norm(a) } -> std::convertible_to<value_t<T>>;
{ bbm::normalize(a) } -> std::convertible_to<T>;
}
A type T has horizontal functions if:
Definition: horizontal.h:39
A type T has horizontal functions if:
Regular horizontal operations:
- hsum(T a): returns value_t(a[0] + a[1] + ...)
- hprod(T a): returns value_t(a[0] * a[1] * ...)
- hmax(T a): returns the maximum element value_t
- hmin(T a): returns the minimum element value_t
- dot(T a, T b): returns value_t( a[0]*b[0], a[1]*b[1], ....)
- norm(T a): return sqrt(dot(a,a))
- squared_norm(T a): returns dot(a,a)
- normalize(T a): returns (a / norm(a))
Mask horizontal operations:
- all(M a): (a[0] && a[1] && ...)
- any(M a): (a[0] || a[1] || ...)
- none(M a): !all(a)
- count(M a): (a[0] + a[1] + ....)