Skip to content

Generator expressions

gen_cossin function

template <typename T1, typename T2,
          typename TF = ftype<common_type<T1, T2>>>
internal::generator_cossin<TF> gen_cossin(T1 start, T2 step)

Returns template expression that generates values using the following formula:

\[ x_i= \begin{cases} \cos(start + i \cdot step), & \text{if } i \text{ is even}\\ \sin(start + i \cdot step), & \text{otherwise} \end{cases} \]
Source code
template <typename T1, typename T2, typename TF = ftype<common_type<T1, T2>>>
KFR_FUNCTION internal::generator_cossin<TF> gen_cossin(T1 start, T2 step)
{
    return internal::generator_cossin<TF>(start, step);
}

https://github.com/kfrlib/kfr/blob//include/kfr/base/generators.hpp#L278

gen_exp function

template <typename T1, typename T2,
          typename TF = ftype<common_type<T1, T2>>>
internal::generator_exp<TF> gen_exp(T1 start, T2 step)

Returns template expression that generates values using the following formula:

\[ x_i = e^{ start + i \cdot step } \]
Source code
template <typename T1, typename T2, typename TF = ftype<common_type<T1, T2>>>
KFR_FUNCTION internal::generator_exp<TF> gen_exp(T1 start, T2 step)
{
    return internal::generator_exp<TF>(start, step);
}

https://github.com/kfrlib/kfr/blob//include/kfr/base/generators.hpp#L250

gen_exp2 function

template <typename T1, typename T2,
          typename TF = ftype<common_type<T1, T2>>>
internal::generator_exp2<TF> gen_exp2(T1 start, T2 step)

Returns template expression that generates values using the following formula:

\[ x_i = 2^{ start + i \cdot step } \]
Source code
template <typename T1, typename T2, typename TF = ftype<common_type<T1, T2>>>
KFR_FUNCTION internal::generator_exp2<TF> gen_exp2(T1 start, T2 step)
{
    return internal::generator_exp2<TF>(start, step);
}

https://github.com/kfrlib/kfr/blob//include/kfr/base/generators.hpp#L262

gen_linear function

template <typename T1, typename T2,
          typename TF = ftype<common_type<T1, T2>>>
internal::generator_linear<TF> gen_linear(T1 start, T2 step)

Returns template expression that generates values starting from the start and using the step as the increment between numbers.

\[ x_i = start + i \cdot step \]
Source code
template <typename T1, typename T2, typename TF = ftype<common_type<T1, T2>>>
KFR_FUNCTION internal::generator_linear<TF> gen_linear(T1 start, T2 step)
{
    return internal::generator_linear<TF>(start, step);
}

https://github.com/kfrlib/kfr/blob//include/kfr/base/generators.hpp#L238

gen_sin function

template <typename T1, typename T2,
          typename TF = ftype<common_type<T1, T2>>>
internal::generator_sin<TF> gen_sin(T1 start, T2 step)

Returns template expression that generates values using the following formula:

\[ x_i = \sin( start + i \cdot step ) \]
Source code
template <typename T1, typename T2, typename TF = ftype<common_type<T1, T2>>>
KFR_FUNCTION internal::generator_sin<TF> gen_sin(T1 start, T2 step)
{
    return internal::generator_sin<TF>(start, step);
}

https://github.com/kfrlib/kfr/blob//include/kfr/base/generators.hpp#L290


Auto-generated from sources, Revision , https://github.com/kfrlib/kfr/blob//include/kfr/