commit d4182f5efc6f5f3ea3911bf16aa233c66d05b214
parent 786218669f3f3d09a0b20d2f0367f192feee4fc6
Author: [email protected] <[email protected]>
Date: Fri, 19 Aug 2016 17:19:02 +0300
Added documentation for generators
Diffstat:
1 file changed, 40 insertions(+), 0 deletions(-)
diff --git a/include/kfr/base/generators.hpp b/include/kfr/base/generators.hpp
@@ -215,26 +215,66 @@ protected:
};
}
+/**
+ * @brief Returns template expression that generates values starting from the start and using the step as the
+ * increment between numbers.
+ *
+ * \f[
+ x_i = start + i \cdot step
+ \f]
+ */
template <typename T1, typename T2, typename TF = ftype<common_type<T1, T2>>>
KFR_SINTRIN internal::generator_linear<TF> gen_linear(T1 start, T2 step)
{
return internal::generator_linear<TF>(start, step);
}
+
+/**
+ * @brief Returns template expression that generates values using the following formula:
+ * \f[
+ x_i = e^{ start + i \cdot step }
+ \f]
+ */
template <typename T1, typename T2, typename TF = ftype<common_type<T1, T2>>>
KFR_SINTRIN internal::generator_exp<TF> gen_exp(T1 start, T2 step)
{
return internal::generator_exp<TF>(start, step);
}
+
+/**
+ * @brief Returns template expression that generates values using the following formula:
+ * \f[
+ x_i = 2^{ start + i \cdot step }
+ \f]
+ */
template <typename T1, typename T2, typename TF = ftype<common_type<T1, T2>>>
KFR_SINTRIN internal::generator_exp2<TF> gen_exp2(T1 start, T2 step)
{
return internal::generator_exp2<TF>(start, step);
}
+
+/**
+ * @brief Returns template expression that generates values using the following formula:
+ * \f[
+ x_i=
+ \begin{cases}
+ \cos(start + i \cdot step), & \text{if } i \text{ is even}\\
+ \sin(start + i \cdot step), & \text{otherwise}
+ \end{cases}
+ \f]
+ */
template <typename T1, typename T2, typename TF = ftype<common_type<T1, T2>>>
KFR_SINTRIN internal::generator_cossin<TF> gen_cossin(T1 start, T2 step)
{
return internal::generator_cossin<TF>(start, step);
}
+
+/**
+ * @brief Returns template expression that generates values using the following formula:
+ * \f[
+ x_i = \sin( start + i \cdot step )
+ \f]
+ */
template <typename T1, typename T2, typename TF = ftype<common_type<T1, T2>>>
KFR_SINTRIN internal::generator_sin<TF> gen_sin(T1 start, T2 step)
{