KFR

Array functions

sum

template<typename E1, typename T = value_type_of<E1>, KFR_ENABLE_IF(is_input_expression<E1>::value)>
T sum(const E1 &x)

Returns the sum of all the elements in x.

x must have its size and type specified.

\[x_0 + x_1 + \ldots + x_{N-1}\]

Source:

template <typename E1, typename T = value_type_of<E1>, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_SINTRIN T sum(const E1& x)

mean

template<typename E1, typename T = value_type_of<E1>, KFR_ENABLE_IF(is_input_expression<E1>::value)>
T mean(const E1 &x)

Returns the arithmetic mean of all the elements in x.

x must have its size and type specified.

\[\frac{1}{N}(x_0 + x_1 + \ldots + x_{N-1})\]

Source:

template <typename E1, typename T = value_type_of<E1>, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_SINTRIN T mean(const E1& x)

minof

template<typename E1, typename T = value_type_of<E1>, KFR_ENABLE_IF(is_input_expression<E1>::value)>
T minof(const E1 &x)

Returns the smallest of all the elements in x.

x must have its size and type specified.

Source:

template <typename E1, typename T = value_type_of<E1>, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_SINTRIN T minof(const E1& x)

maxof

template<typename E1, typename T = value_type_of<E1>, KFR_ENABLE_IF(is_input_expression<E1>::value)>
T maxof(const E1 &x)

Returns the greatest of all the elements in x.

x must have its size and type specified.

Source:

template <typename E1, typename T = value_type_of<E1>, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_SINTRIN T maxof(const E1& x)

absminof

template<typename E1, typename T = value_type_of<E1>, KFR_ENABLE_IF(is_input_expression<E1>::value)>
T absminof(const E1 &x)

Returns the smallest in magnitude of all the elements in x.

x must have its size and type specified.

Source:

template <typename E1, typename T = value_type_of<E1>, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_SINTRIN T absminof(const E1& x)

absmaxof

template<typename E1, typename T = value_type_of<E1>, KFR_ENABLE_IF(is_input_expression<E1>::value)>
T absmaxof(const E1 &x)

Returns the greatest in magnitude of all the elements in x.

x must have its size and type specified.

Source:

template <typename E1, typename T = value_type_of<E1>, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_SINTRIN T absmaxof(const E1& x)

dotproduct

template<typename E1, typename E2, typename T = value_type_of<decltype(std::declval<E1>() * std::declval<E2>())>, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)>
T dotproduct(E1 &&x, E2 &&y)

Returns the dot product of two vectors.

x and y must have their sizes and types specified.

\[x_0y_0 + x_1y_1 + \ldots + x_{N-1}y_{N-1}\]

Source:

template <typename E1, typename E2,
          typename T = value_type_of<decltype(std::declval<E1>()*
                                              std::declval<E2>())>,
          KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)>
KFR_SINTRIN T dotproduct(E1&& x, E2&& y)

rms

template<typename E1, typename T = value_type_of<E1>, KFR_ENABLE_IF(is_input_expression<E1>::value)>
T rms(const E1 &x)

Returns the root mean square of all the elements in x.

x must have its size and type specified.

\[\sqrt{\frac{1}{N}( x_0^2 + x_1^2 + \ldots + x_{N-1}^2)}\]

Source:

template <typename E1, typename T = value_type_of<E1>, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_SINTRIN T rms(const E1& x)

sumsqr

template<typename E1, typename T = value_type_of<E1>, KFR_ENABLE_IF(is_input_expression<E1>::value)>
T sumsqr(const E1 &x)

Returns the sum of squares of all the elements in x.

x must have its size and type specified.

\[x_0^2 + x_1^2 + \ldots + x_{N-1}^2\]

Source:

template <typename E1, typename T = value_type_of<E1>, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_SINTRIN T sumsqr(const E1& x)

product

template<typename E1, typename T = value_type_of<E1>, KFR_ENABLE_IF(is_input_expression<E1>::value)>
T product(const E1 &x)

Returns the product of all the elements in x.

x must have its size and type specified.

\[x_0 \cdot x_1 \cdot \ldots \cdot x_{N-1}\]

Source:

template <typename E1, typename T = value_type_of<E1>, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_SINTRIN T product(const E1& x)