kfr

Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
Log | Files | Refs | README

commit 2bec65284938bb9958172dce9a4792ce4e11efc3
parent c3abea02bc810374174b55e05d2116a63bf3f44b
Author: d.levin256@gmail.com <d.levin256@gmail.com>
Date:   Tue,  8 Nov 2016 06:11:28 +0300

Replace CMT_FUNC by KFR_FUNC

Diffstat:
Minclude/kfr/base/atan.hpp | 16++++++++--------
Minclude/kfr/base/complex.hpp | 60++++++++++++++++++++++++++++++------------------------------
Minclude/kfr/base/constants.hpp | 6+++---
Minclude/kfr/base/gamma.hpp | 8++++----
Minclude/kfr/base/hyperbolic.hpp | 24++++++++++++------------
Minclude/kfr/base/log_exp.hpp | 56++++++++++++++++++++++++++++----------------------------
Minclude/kfr/base/modzerobessel.hpp | 4++--
Minclude/kfr/base/sin_cos.hpp | 52++++++++++++++++++++++++++--------------------------
Minclude/kfr/base/tan.hpp | 8++++----
Minclude/kfr/dsp/interpolation.hpp | 10+++++-----
Minclude/kfr/dsp/oscillators.hpp | 92++++++++++++++++++++++++++++++++++++++++----------------------------------------
Minclude/kfr/io/tostring.hpp | 2+-
12 files changed, 169 insertions(+), 169 deletions(-)

diff --git a/include/kfr/base/atan.hpp b/include/kfr/base/atan.hpp @@ -232,7 +232,7 @@ KFR_I_FN(atan2deg) * \f$\pi/2\f$. */ template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> atan(const T1& x) +KFR_FUNC flt_type<T1> atan(const T1& x) { return intrinsics::atan(x); } @@ -241,7 +241,7 @@ CMT_FUNC flt_type<T1> atan(const T1& x) * @brief Returns template expression that returns the arc tangent of x. */ template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::atan, E1> atan(E1&& x) +KFR_FUNC internal::expression_function<fn::atan, E1> atan(E1&& x) { return { fn::atan(), std::forward<E1>(x) }; } @@ -251,7 +251,7 @@ CMT_FUNC internal::expression_function<fn::atan, E1> atan(E1&& x) * through 90. */ template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> atandeg(const T1& x) +KFR_FUNC flt_type<T1> atandeg(const T1& x) { return intrinsics::atandeg(x); } @@ -260,7 +260,7 @@ CMT_FUNC flt_type<T1> atandeg(const T1& x) * @brief Returns template expression that returns the arc tangent of the x, expressed in degrees. */ template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::atandeg, E1> atandeg(E1&& x) +KFR_FUNC internal::expression_function<fn::atandeg, E1> atandeg(E1&& x) { return { fn::atandeg(), std::forward<E1>(x) }; } @@ -269,7 +269,7 @@ CMT_FUNC internal::expression_function<fn::atandeg, E1> atandeg(E1&& x) * @brief Returns the arc tangent of y/x using the signs of arguments to determine the correct quadrant. */ template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value)> -CMT_FUNC common_type<T1, T2> atan2(const T1& x, const T2& y) +KFR_FUNC common_type<T1, T2> atan2(const T1& x, const T2& y) { return intrinsics::atan2(x, y); } @@ -278,7 +278,7 @@ CMT_FUNC common_type<T1, T2> atan2(const T1& x, const T2& y) * @brief Returns template expression that returns the arc tangent of y/x. */ template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)> -CMT_FUNC internal::expression_function<fn::atan2, E1, E2> atan2(E1&& x, E2&& y) +KFR_FUNC internal::expression_function<fn::atan2, E1, E2> atan2(E1&& x, E2&& y) { return { fn::atan2(), std::forward<E1>(x), std::forward<E2>(y) }; } @@ -288,7 +288,7 @@ CMT_FUNC internal::expression_function<fn::atan2, E1, E2> atan2(E1&& x, E2&& y) * correct quadrant. */ template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value)> -CMT_FUNC common_type<T1, T2> atan2deg(const T1& x, const T2& y) +KFR_FUNC common_type<T1, T2> atan2deg(const T1& x, const T2& y) { return intrinsics::atan2deg(x, y); } @@ -297,7 +297,7 @@ CMT_FUNC common_type<T1, T2> atan2deg(const T1& x, const T2& y) * @brief Returns template expression that returns the arc tangent of y/x (expressed in degrees). */ template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)> -CMT_FUNC internal::expression_function<fn::atan2deg, E1, E2> atan2deg(E1&& x, E2&& y) +KFR_FUNC internal::expression_function<fn::atan2deg, E1, E2> atan2deg(E1&& x, E2&& y) { return { fn::atan2deg(), std::forward<E1>(x), std::forward<E2>(y) }; } diff --git a/include/kfr/base/complex.hpp b/include/kfr/base/complex.hpp @@ -662,152 +662,152 @@ KFR_I_FN(cartesian) KFR_I_FN(csqrt) template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC T1 csin(const T1& x) +KFR_FUNC T1 csin(const T1& x) { return intrinsics::csin(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::csin, E1> csin(E1&& x) +KFR_FUNC internal::expression_function<fn::csin, E1> csin(E1&& x) { return { fn::csin(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC T1 csinh(const T1& x) +KFR_FUNC T1 csinh(const T1& x) { return intrinsics::csinh(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::csinh, E1> csinh(E1&& x) +KFR_FUNC internal::expression_function<fn::csinh, E1> csinh(E1&& x) { return { fn::csinh(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC T1 ccos(const T1& x) +KFR_FUNC T1 ccos(const T1& x) { return intrinsics::ccos(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::ccos, E1> ccos(E1&& x) +KFR_FUNC internal::expression_function<fn::ccos, E1> ccos(E1&& x) { return { fn::ccos(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC T1 ccosh(const T1& x) +KFR_FUNC T1 ccosh(const T1& x) { return intrinsics::ccosh(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::ccosh, E1> ccosh(E1&& x) +KFR_FUNC internal::expression_function<fn::ccosh, E1> ccosh(E1&& x) { return { fn::ccosh(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC realtype<T1> cabs(const T1& x) +KFR_FUNC realtype<T1> cabs(const T1& x) { return intrinsics::cabs(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::cabs, E1> cabs(E1&& x) +KFR_FUNC internal::expression_function<fn::cabs, E1> cabs(E1&& x) { return { fn::cabs(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC realtype<T1> carg(const T1& x) +KFR_FUNC realtype<T1> carg(const T1& x) { return intrinsics::carg(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::carg, E1> carg(E1&& x) +KFR_FUNC internal::expression_function<fn::carg, E1> carg(E1&& x) { return { fn::carg(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC T1 clog(const T1& x) +KFR_FUNC T1 clog(const T1& x) { return intrinsics::clog(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::clog, E1> clog(E1&& x) +KFR_FUNC internal::expression_function<fn::clog, E1> clog(E1&& x) { return { fn::clog(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC T1 clog2(const T1& x) +KFR_FUNC T1 clog2(const T1& x) { return intrinsics::clog2(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::clog2, E1> clog2(E1&& x) +KFR_FUNC internal::expression_function<fn::clog2, E1> clog2(E1&& x) { return { fn::clog2(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC T1 clog10(const T1& x) +KFR_FUNC T1 clog10(const T1& x) { return intrinsics::clog10(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::clog10, E1> clog10(E1&& x) +KFR_FUNC internal::expression_function<fn::clog10, E1> clog10(E1&& x) { return { fn::clog10(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC T1 cexp(const T1& x) +KFR_FUNC T1 cexp(const T1& x) { return intrinsics::cexp(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::cexp, E1> cexp(E1&& x) +KFR_FUNC internal::expression_function<fn::cexp, E1> cexp(E1&& x) { return { fn::cexp(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC T1 cexp2(const T1& x) +KFR_FUNC T1 cexp2(const T1& x) { return intrinsics::cexp2(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::cexp2, E1> cexp2(E1&& x) +KFR_FUNC internal::expression_function<fn::cexp2, E1> cexp2(E1&& x) { return { fn::cexp2(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC T1 cexp10(const T1& x) +KFR_FUNC T1 cexp10(const T1& x) { return intrinsics::cexp10(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::cexp10, E1> cexp10(E1&& x) +KFR_FUNC internal::expression_function<fn::cexp10, E1> cexp10(E1&& x) { return { fn::cexp10(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC T1 polar(const T1& x) +KFR_FUNC T1 polar(const T1& x) { return intrinsics::polar(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::polar, E1> polar(E1&& x) +KFR_FUNC internal::expression_function<fn::polar, E1> polar(E1&& x) { return { fn::polar(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC T1 cartesian(const T1& x) +KFR_FUNC T1 cartesian(const T1& x) { return intrinsics::cartesian(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::cartesian, E1> cartesian(E1&& x) +KFR_FUNC internal::expression_function<fn::cartesian, E1> cartesian(E1&& x) { return { fn::cartesian(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC T1 csqrt(const T1& x) +KFR_FUNC T1 csqrt(const T1& x) { return intrinsics::csqrt(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::csqrt, E1> csqrt(E1&& x) +KFR_FUNC internal::expression_function<fn::csqrt, E1> csqrt(E1&& x) { return { fn::csqrt(), std::forward<E1>(x) }; } diff --git a/include/kfr/base/constants.hpp b/include/kfr/base/constants.hpp @@ -79,8 +79,8 @@ public: #if CMT_COMPILER_GNU -CMT_PRAGMA_GNU(GCC diagnostic push) -CMT_PRAGMA_GNU(GCC diagnostic ignored "-Woverflow") + CMT_PRAGMA_GNU(GCC diagnostic push) + CMT_PRAGMA_GNU(GCC diagnostic ignored "-Woverflow") constexpr static Tsub allones() { @@ -131,7 +131,7 @@ CMT_PRAGMA_GNU(GCC diagnostic ignored "-Woverflow") return static_cast<Tsub>((1ull << (sizeof(Tsub) * 8 - 1)) - 1); } } -CMT_PRAGMA_GNU(GCC diagnostic pop) + CMT_PRAGMA_GNU(GCC diagnostic pop) #else static Tsub allones() diff --git a/include/kfr/base/gamma.hpp b/include/kfr/base/gamma.hpp @@ -68,25 +68,25 @@ KFR_I_FN(gamma) KFR_I_FN(factorial_approx) template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> gamma(const T1& x) +KFR_FUNC flt_type<T1> gamma(const T1& x) { return intrinsics::gamma(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::gamma, E1> gamma(E1&& x) +KFR_FUNC internal::expression_function<fn::gamma, E1> gamma(E1&& x) { return { fn::gamma(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> factorial_approx(const T1& x) +KFR_FUNC flt_type<T1> factorial_approx(const T1& x) { return intrinsics::factorial_approx(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::factorial_approx, E1> factorial_approx(E1&& x) +KFR_FUNC internal::expression_function<fn::factorial_approx, E1> factorial_approx(E1&& x) { return { fn::factorial_approx(), std::forward<E1>(x) }; } diff --git a/include/kfr/base/hyperbolic.hpp b/include/kfr/base/hyperbolic.hpp @@ -97,73 +97,73 @@ KFR_I_FN(sinhcosh) KFR_I_FN(coshsinh) template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> sinh(const T1& x) +KFR_FUNC flt_type<T1> sinh(const T1& x) { return intrinsics::sinh(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::sinh, E1> sinh(E1&& x) +KFR_FUNC internal::expression_function<fn::sinh, E1> sinh(E1&& x) { return { fn::sinh(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> cosh(const T1& x) +KFR_FUNC flt_type<T1> cosh(const T1& x) { return intrinsics::cosh(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::cosh, E1> cosh(E1&& x) +KFR_FUNC internal::expression_function<fn::cosh, E1> cosh(E1&& x) { return { fn::cosh(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> tanh(const T1& x) +KFR_FUNC flt_type<T1> tanh(const T1& x) { return intrinsics::tanh(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::tanh, E1> tanh(E1&& x) +KFR_FUNC internal::expression_function<fn::tanh, E1> tanh(E1&& x) { return { fn::tanh(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> coth(const T1& x) +KFR_FUNC flt_type<T1> coth(const T1& x) { return intrinsics::coth(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::coth, E1> coth(E1&& x) +KFR_FUNC internal::expression_function<fn::coth, E1> coth(E1&& x) { return { fn::coth(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> sinhcosh(const T1& x) +KFR_FUNC flt_type<T1> sinhcosh(const T1& x) { return intrinsics::sinhcosh(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::sinhcosh, E1> sinhcosh(E1&& x) +KFR_FUNC internal::expression_function<fn::sinhcosh, E1> sinhcosh(E1&& x) { return { fn::sinhcosh(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> coshsinh(const T1& x) +KFR_FUNC flt_type<T1> coshsinh(const T1& x) { return intrinsics::coshsinh(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::coshsinh, E1> coshsinh(E1&& x) +KFR_FUNC internal::expression_function<fn::coshsinh, E1> coshsinh(E1&& x) { return { fn::coshsinh(), std::forward<E1>(x) }; } diff --git a/include/kfr/base/log_exp.hpp b/include/kfr/base/log_exp.hpp @@ -312,169 +312,169 @@ KFR_I_FN(root) KFR_I_FN(cbrt) template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> exp(const T1& x) +KFR_FUNC flt_type<T1> exp(const T1& x) { return intrinsics::exp(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::exp, E1> exp(E1&& x) +KFR_FUNC internal::expression_function<fn::exp, E1> exp(E1&& x) { return { fn::exp(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> exp2(const T1& x) +KFR_FUNC flt_type<T1> exp2(const T1& x) { return intrinsics::exp2(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::exp2, E1> exp2(E1&& x) +KFR_FUNC internal::expression_function<fn::exp2, E1> exp2(E1&& x) { return { fn::exp2(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> exp10(const T1& x) +KFR_FUNC flt_type<T1> exp10(const T1& x) { return intrinsics::exp10(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::exp10, E1> exp10(E1&& x) +KFR_FUNC internal::expression_function<fn::exp10, E1> exp10(E1&& x) { return { fn::exp10(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> log(const T1& x) +KFR_FUNC flt_type<T1> log(const T1& x) { return intrinsics::log(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::log, E1> log(E1&& x) +KFR_FUNC internal::expression_function<fn::log, E1> log(E1&& x) { return { fn::log(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> log2(const T1& x) +KFR_FUNC flt_type<T1> log2(const T1& x) { return intrinsics::log2(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::log2, E1> log2(E1&& x) +KFR_FUNC internal::expression_function<fn::log2, E1> log2(E1&& x) { return { fn::log2(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> log10(const T1& x) +KFR_FUNC flt_type<T1> log10(const T1& x) { return intrinsics::log10(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::log10, E1> log10(E1&& x) +KFR_FUNC internal::expression_function<fn::log10, E1> log10(E1&& x) { return { fn::log10(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> logb(const T1& x) +KFR_FUNC flt_type<T1> logb(const T1& x) { return intrinsics::logb(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::logb, E1> logb(E1&& x) +KFR_FUNC internal::expression_function<fn::logb, E1> logb(E1&& x) { return { fn::logb(), std::forward<E1>(x) }; } template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value)> -CMT_FUNC flt_type<common_type<T1, T2>> logn(const T1& x, const T2& y) +KFR_FUNC flt_type<common_type<T1, T2>> logn(const T1& x, const T2& y) { return intrinsics::logn(x, y); } template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)> -CMT_FUNC internal::expression_function<fn::logn, E1, E2> logn(E1&& x, E2&& y) +KFR_FUNC internal::expression_function<fn::logn, E1, E2> logn(E1&& x, E2&& y) { return { fn::logn(), std::forward<E1>(x), std::forward<E2>(y) }; } template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value)> -CMT_FUNC flt_type<common_type<T1, T2>> logm(const T1& x, const T2& y) +KFR_FUNC flt_type<common_type<T1, T2>> logm(const T1& x, const T2& y) { return intrinsics::logm(x, y); } template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)> -CMT_FUNC internal::expression_function<fn::logm, E1, E2> logm(E1&& x, E2&& y) +KFR_FUNC internal::expression_function<fn::logm, E1, E2> logm(E1&& x, E2&& y) { return { fn::logm(), std::forward<E1>(x), std::forward<E2>(y) }; } template <typename T1, typename T2, typename T3, KFR_ENABLE_IF(is_numeric_args<T1, T2, T3>::value)> -CMT_FUNC flt_type<common_type<T1, T2, T3>> exp_fmadd(const T1& x, const T2& y, const T3& z) +KFR_FUNC flt_type<common_type<T1, T2, T3>> exp_fmadd(const T1& x, const T2& y, const T3& z) { return intrinsics::exp_fmadd(x, y, z); } template <typename E1, typename E2, typename E3, KFR_ENABLE_IF(is_input_expressions<E1, E2, E3>::value)> -CMT_FUNC internal::expression_function<fn::exp_fmadd, E1, E2, E3> exp_fmadd(E1&& x, E2&& y, E3&& z) +KFR_FUNC internal::expression_function<fn::exp_fmadd, E1, E2, E3> exp_fmadd(E1&& x, E2&& y, E3&& z) { return { fn::exp_fmadd(), std::forward<E1>(x), std::forward<E2>(y), std::forward<E3>(z) }; } template <typename T1, typename T2, typename T3, KFR_ENABLE_IF(is_numeric_args<T1, T2, T3>::value)> -CMT_FUNC flt_type<common_type<T1, T2, T3>> log_fmadd(const T1& x, const T2& y, const T3& z) +KFR_FUNC flt_type<common_type<T1, T2, T3>> log_fmadd(const T1& x, const T2& y, const T3& z) { return intrinsics::log_fmadd(x, y, z); } template <typename E1, typename E2, typename E3, KFR_ENABLE_IF(is_input_expressions<E1, E2, E3>::value)> -CMT_FUNC internal::expression_function<fn::log_fmadd, E1, E2, E3> log_fmadd(E1&& x, E2&& y, E3&& z) +KFR_FUNC internal::expression_function<fn::log_fmadd, E1, E2, E3> log_fmadd(E1&& x, E2&& y, E3&& z) { return { fn::log_fmadd(), std::forward<E1>(x), std::forward<E2>(y), std::forward<E3>(z) }; } template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value)> -CMT_FUNC flt_type<common_type<T1, T2>> pow(const T1& x, const T2& y) +KFR_FUNC flt_type<common_type<T1, T2>> pow(const T1& x, const T2& y) { return intrinsics::pow(x, y); } template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)> -CMT_FUNC internal::expression_function<fn::pow, E1, E2> pow(E1&& x, E2&& y) +KFR_FUNC internal::expression_function<fn::pow, E1, E2> pow(E1&& x, E2&& y) { return { fn::pow(), std::forward<E1>(x), std::forward<E2>(y) }; } template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value)> -CMT_FUNC flt_type<common_type<T1, T2>> root(const T1& x, const T2& y) +KFR_FUNC flt_type<common_type<T1, T2>> root(const T1& x, const T2& y) { return intrinsics::root(x, y); } template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)> -CMT_FUNC internal::expression_function<fn::root, E1, E2> root(E1&& x, E2&& y) +KFR_FUNC internal::expression_function<fn::root, E1, E2> root(E1&& x, E2&& y) { return { fn::root(), std::forward<E1>(x), std::forward<E2>(y) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> cbrt(const T1& x) +KFR_FUNC flt_type<T1> cbrt(const T1& x) { return intrinsics::cbrt(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::cbrt, E1> cbrt(E1&& x) +KFR_FUNC internal::expression_function<fn::cbrt, E1> cbrt(E1&& x) { return { fn::cbrt(), std::forward<E1>(x) }; } diff --git a/include/kfr/base/modzerobessel.hpp b/include/kfr/base/modzerobessel.hpp @@ -100,13 +100,13 @@ KFR_I_CONVERTER(modzerobessel) KFR_I_FN(modzerobessel) template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC T1 modzerobessel(const T1& x) +KFR_FUNC T1 modzerobessel(const T1& x) { return intrinsics::modzerobessel(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::modzerobessel, E1> modzerobessel(E1&& x) +KFR_FUNC internal::expression_function<fn::modzerobessel, E1> modzerobessel(E1&& x) { return { fn::modzerobessel(), std::forward<E1>(x) }; } diff --git a/include/kfr/base/sin_cos.hpp b/include/kfr/base/sin_cos.hpp @@ -338,7 +338,7 @@ KFR_I_FN(sinc) * @brief Returns the trigonometric sine of x. */ template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> sin(const T1& x) +KFR_FUNC flt_type<T1> sin(const T1& x) { return intrinsics::sin(x); } @@ -347,7 +347,7 @@ CMT_FUNC flt_type<T1> sin(const T1& x) * @brief Returns template expression that returns the trigonometric sine of x. */ template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::sin, E1> sin(E1&& x) +KFR_FUNC internal::expression_function<fn::sin, E1> sin(E1&& x) { return { fn::sin(), std::forward<E1>(x) }; } @@ -356,7 +356,7 @@ CMT_FUNC internal::expression_function<fn::sin, E1> sin(E1&& x) * @brief Returns the trigonometric cosine of x. */ template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> cos(const T1& x) +KFR_FUNC flt_type<T1> cos(const T1& x) { return intrinsics::cos(x); } @@ -365,7 +365,7 @@ CMT_FUNC flt_type<T1> cos(const T1& x) * @brief Returns template expression that returns the trigonometric cosine of x. */ template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::cos, E1> cos(E1&& x) +KFR_FUNC internal::expression_function<fn::cos, E1> cos(E1&& x) { return { fn::cos(), std::forward<E1>(x) }; } @@ -374,7 +374,7 @@ CMT_FUNC internal::expression_function<fn::cos, E1> cos(E1&& x) * @brief Returns an approximation of the trigonometric sine of x. */ template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> fastsin(const T1& x) +KFR_FUNC flt_type<T1> fastsin(const T1& x) { return intrinsics::fastsin(x); } @@ -383,7 +383,7 @@ CMT_FUNC flt_type<T1> fastsin(const T1& x) * @brief Returns template expression that returns an approximation of the trigonometric sine of x. */ template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::fastsin, E1> fastsin(E1&& x) +KFR_FUNC internal::expression_function<fn::fastsin, E1> fastsin(E1&& x) { return { fn::fastsin(), std::forward<E1>(x) }; } @@ -392,7 +392,7 @@ CMT_FUNC internal::expression_function<fn::fastsin, E1> fastsin(E1&& x) * @brief Returns an approximation of the trigonometric cosine of x. */ template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> fastcos(const T1& x) +KFR_FUNC flt_type<T1> fastcos(const T1& x) { return intrinsics::fastcos(x); } @@ -401,7 +401,7 @@ CMT_FUNC flt_type<T1> fastcos(const T1& x) * @brief Returns template expression that returns an approximation of the trigonometric cosine of x. */ template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::fastcos, E1> fastcos(E1&& x) +KFR_FUNC internal::expression_function<fn::fastcos, E1> fastcos(E1&& x) { return { fn::fastcos(), std::forward<E1>(x) }; } @@ -411,7 +411,7 @@ CMT_FUNC internal::expression_function<fn::fastcos, E1> fastcos(E1&& x) * be a vector. */ template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> sincos(const T1& x) +KFR_FUNC flt_type<T1> sincos(const T1& x) { return intrinsics::sincos(x); } @@ -421,7 +421,7 @@ CMT_FUNC flt_type<T1> sincos(const T1& x) * cosine of the odd elements. x must be a vector. */ template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::sincos, E1> sincos(E1&& x) +KFR_FUNC internal::expression_function<fn::sincos, E1> sincos(E1&& x) { return { fn::sincos(), std::forward<E1>(x) }; } @@ -431,7 +431,7 @@ CMT_FUNC internal::expression_function<fn::sincos, E1> sincos(E1&& x) * be a vector. */ template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> cossin(const T1& x) +KFR_FUNC flt_type<T1> cossin(const T1& x) { return intrinsics::cossin(x); } @@ -441,7 +441,7 @@ CMT_FUNC flt_type<T1> cossin(const T1& x) * sine of the odd elements. x must be a vector. */ template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::cossin, E1> cossin(E1&& x) +KFR_FUNC internal::expression_function<fn::cossin, E1> cossin(E1&& x) { return { fn::cossin(), std::forward<E1>(x) }; } @@ -450,7 +450,7 @@ CMT_FUNC internal::expression_function<fn::cossin, E1> cossin(E1&& x) * @brief Returns the trigonometric sine of the x (expressed in degrees). */ template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> sindeg(const T1& x) +KFR_FUNC flt_type<T1> sindeg(const T1& x) { return intrinsics::sindeg(x); } @@ -459,7 +459,7 @@ CMT_FUNC flt_type<T1> sindeg(const T1& x) * @brief Returns template expression that returns the trigonometric sine of the x (expressed in degrees). */ template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::sindeg, E1> sindeg(E1&& x) +KFR_FUNC internal::expression_function<fn::sindeg, E1> sindeg(E1&& x) { return { fn::sindeg(), std::forward<E1>(x) }; } @@ -468,7 +468,7 @@ CMT_FUNC internal::expression_function<fn::sindeg, E1> sindeg(E1&& x) * @brief Returns the trigonometric cosine of the x (expressed in degrees). */ template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> cosdeg(const T1& x) +KFR_FUNC flt_type<T1> cosdeg(const T1& x) { return intrinsics::cosdeg(x); } @@ -477,7 +477,7 @@ CMT_FUNC flt_type<T1> cosdeg(const T1& x) * @brief Returns template expression that returns the trigonometric cosine of the x (expressed in degrees). */ template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::cosdeg, E1> cosdeg(E1&& x) +KFR_FUNC internal::expression_function<fn::cosdeg, E1> cosdeg(E1&& x) { return { fn::cosdeg(), std::forward<E1>(x) }; } @@ -486,7 +486,7 @@ CMT_FUNC internal::expression_function<fn::cosdeg, E1> cosdeg(E1&& x) * @brief Returns an approximation of the trigonometric sine of the x (expressed in degrees). */ template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> fastsindeg(const T1& x) +KFR_FUNC flt_type<T1> fastsindeg(const T1& x) { return intrinsics::fastsindeg(x); } @@ -496,7 +496,7 @@ CMT_FUNC flt_type<T1> fastsindeg(const T1& x) * (expressed in degrees). */ template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::fastsindeg, E1> fastsindeg(E1&& x) +KFR_FUNC internal::expression_function<fn::fastsindeg, E1> fastsindeg(E1&& x) { return { fn::fastsindeg(), std::forward<E1>(x) }; } @@ -505,7 +505,7 @@ CMT_FUNC internal::expression_function<fn::fastsindeg, E1> fastsindeg(E1&& x) * @brief Returns an approximation of the trigonometric cosine of the x (expressed in degrees). */ template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> fastcosdeg(const T1& x) +KFR_FUNC flt_type<T1> fastcosdeg(const T1& x) { return intrinsics::fastcosdeg(x); } @@ -515,7 +515,7 @@ CMT_FUNC flt_type<T1> fastcosdeg(const T1& x) * (expressed in degrees). */ template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::fastcosdeg, E1> fastcosdeg(E1&& x) +KFR_FUNC internal::expression_function<fn::fastcosdeg, E1> fastcosdeg(E1&& x) { return { fn::fastcosdeg(), std::forward<E1>(x) }; } @@ -525,7 +525,7 @@ CMT_FUNC internal::expression_function<fn::fastcosdeg, E1> fastcosdeg(E1&& x) * be a vector and expressed in degrees. */ template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> sincosdeg(const T1& x) +KFR_FUNC flt_type<T1> sincosdeg(const T1& x) { return intrinsics::sincosdeg(x); } @@ -535,7 +535,7 @@ CMT_FUNC flt_type<T1> sincosdeg(const T1& x) * cosine of the odd elements. x must be expressed in degrees. */ template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::sincosdeg, E1> sincosdeg(E1&& x) +KFR_FUNC internal::expression_function<fn::sincosdeg, E1> sincosdeg(E1&& x) { return { fn::sincosdeg(), std::forward<E1>(x) }; } @@ -545,7 +545,7 @@ CMT_FUNC internal::expression_function<fn::sincosdeg, E1> sincosdeg(E1&& x) * be a vector and expressed in degrees. */ template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> cossindeg(const T1& x) +KFR_FUNC flt_type<T1> cossindeg(const T1& x) { return intrinsics::cossindeg(x); } @@ -555,7 +555,7 @@ CMT_FUNC flt_type<T1> cossindeg(const T1& x) * sine of the odd elements. x must be expressed in degrees. */ template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::cossindeg, E1> cossindeg(E1&& x) +KFR_FUNC internal::expression_function<fn::cossindeg, E1> cossindeg(E1&& x) { return { fn::cossindeg(), std::forward<E1>(x) }; } @@ -567,7 +567,7 @@ CMT_FUNC internal::expression_function<fn::cossindeg, E1> cossindeg(E1&& x) * \f] */ template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> sinc(const T1& x) +KFR_FUNC flt_type<T1> sinc(const T1& x) { return intrinsics::sinc(x); } @@ -576,7 +576,7 @@ CMT_FUNC flt_type<T1> sinc(const T1& x) * @brief Returns template expression that returns the sinc function of x. */ template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::sinc, E1> sinc(E1&& x) +KFR_FUNC internal::expression_function<fn::sinc, E1> sinc(E1&& x) { return { fn::sinc(), std::forward<E1>(x) }; } diff --git a/include/kfr/base/tan.hpp b/include/kfr/base/tan.hpp @@ -134,25 +134,25 @@ KFR_I_FN(tan) KFR_I_FN(tandeg) template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> tan(const T1& x) +KFR_FUNC flt_type<T1> tan(const T1& x) { return intrinsics::tan(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::tan, E1> tan(E1&& x) +KFR_FUNC internal::expression_function<fn::tan, E1> tan(E1&& x) { return { fn::tan(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -CMT_FUNC flt_type<T1> tandeg(const T1& x) +KFR_FUNC flt_type<T1> tandeg(const T1& x) { return intrinsics::tandeg(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -CMT_FUNC internal::expression_function<fn::tandeg, E1> tandeg(E1&& x) +KFR_FUNC internal::expression_function<fn::tandeg, E1> tandeg(E1&& x) { return { fn::tandeg(), std::forward<E1>(x) }; } diff --git a/include/kfr/dsp/interpolation.hpp b/include/kfr/dsp/interpolation.hpp @@ -33,25 +33,25 @@ namespace kfr { template <typename T, typename M> -KFR_SINTRIN T nearest(M mu, T x1, T x2) +KFR_FUNC T nearest(M mu, T x1, T x2) { return select(mu < M(0.5), x1, x2); } template <typename T, typename M> -KFR_SINTRIN T linear(M mu, T x1, T x2) +KFR_FUNC T linear(M mu, T x1, T x2) { return mix(mu, x1, x2); } template <typename T, typename M> -KFR_SINTRIN T cosine(M mu, T x1, T x2) +KFR_FUNC T cosine(M mu, T x1, T x2) { return mix((M(1) - fastcos(mu * c_pi<T>)) * M(0.5), x1, x2); } template <typename T, typename M> -KFR_SINTRIN T cubic(M mu, T x0, T x1, T x2, T x3) +KFR_FUNC T cubic(M mu, T x0, T x1, T x2, T x3) { const T a0 = x3 - x2 - x0 + x1; const T a1 = x0 - x1 - a0; @@ -61,7 +61,7 @@ KFR_SINTRIN T cubic(M mu, T x0, T x1, T x2, T x3) } template <typename T, typename M> -KFR_SINTRIN T catmullrom(M mu, T x0, T x1, T x2, T x3) +KFR_FUNC T catmullrom(M mu, T x0, T x1, T x2, T x3) { const T a0 = T(0.5) * (x3 - x0) - T(1.5) * (x2 - x1); const T a1 = x0 - T(2.5) * x1 + T(2) * x2 - T(0.5) * x3; diff --git a/include/kfr/dsp/oscillators.hpp b/include/kfr/dsp/oscillators.hpp @@ -32,14 +32,14 @@ namespace kfr { template <typename T = fbase> -auto jaehne(identity<T> magn, size_t size) +KFR_FUNC auto jaehne(identity<T> magn, size_t size) { return truncate(magn * sin(constants<T>::pi_s(1, 2) * sqr(linspace(T(0), T(size), size, false)) / size), size); } template <typename T = fbase> -auto swept(identity<T> magn, size_t size) +KFR_FUNC auto swept(identity<T> magn, size_t size) { return truncate( magn * sin(c_pi<T, 1, 4> * sqr(sqr(linspace(T(0), T(size), size, false)) / sqr(T(size))) * T(size)), @@ -47,13 +47,13 @@ auto swept(identity<T> magn, size_t size) } template <typename T = fbase> -auto phasor(identity<T> frequency) +KFR_FUNC auto phasor(identity<T> frequency) { return fract(counter(T(0), frequency)); } template <typename T = fbase> -auto phasor(identity<T> frequency, identity<T> sample_rate) +KFR_FUNC static auto phasor(identity<T> frequency, identity<T> sample_rate) { return fract(counter(T(0), frequency / sample_rate)); } @@ -61,76 +61,76 @@ auto phasor(identity<T> frequency, identity<T> sample_rate) namespace intrinsics { template <typename T> -KFR_SINTRIN T rawsine(const T& x) +KFR_FUNC T rawsine(const T& x) { return intrinsics::fastsin(x * constants<T>::pi_s(2)); } template <typename T> -KFR_SINTRIN T sinenorm(const T& x) +KFR_FUNC T sinenorm(const T& x) { return intrinsics::rawsine(fract(x)); } template <typename T> -KFR_SINTRIN T sine(const T& x) +KFR_FUNC T sine(const T& x) { return intrinsics::sinenorm(constants<T>::recip_pi_s(1, 2) * x); } template <typename T> -KFR_SINTRIN T rawsquare(const T& x) +KFR_FUNC T rawsquare(const T& x) { return select(x < T(0.5), T(1), -T(1)); } template <typename T> -KFR_SINTRIN T squarenorm(const T& x) +KFR_FUNC T squarenorm(const T& x) { return intrinsics::rawsquare(fract(x)); } template <typename T> -KFR_SINTRIN T square(const T& x) +KFR_FUNC T square(const T& x) { return intrinsics::squarenorm(constants<T>::recip_pi_s(1, 2) * x); } template <typename T> -KFR_SINTRIN T rawsawtooth(const T& x) +KFR_FUNC T rawsawtooth(const T& x) { return T(1) - 2 * x; } template <typename T> -KFR_SINTRIN T sawtoothnorm(const T& x) +KFR_FUNC T sawtoothnorm(const T& x) { return intrinsics::rawsawtooth(fract(x)); } template <typename T> -KFR_SINTRIN T sawtooth(const T& x) +KFR_FUNC T sawtooth(const T& x) { return intrinsics::sawtoothnorm(constants<T>::recip_pi_s(1, 2) * x); } template <typename T> -KFR_SINTRIN T isawtoothnorm(const T& x) +KFR_FUNC T isawtoothnorm(const T& x) { return T(-1) + 2 * fract(x + 0.5); } template <typename T> -KFR_SINTRIN T isawtooth(const T& x) +KFR_FUNC T isawtooth(const T& x) { return intrinsics::isawtoothnorm(constants<T>::recip_pi_s(1, 2) * x); } template <typename T> -KFR_SINTRIN T rawtriangle(const T& x) +KFR_FUNC T rawtriangle(const T& x) { return 1 - abs(4 * x - 2); } template <typename T> -KFR_SINTRIN T trianglenorm(const T& x) +KFR_FUNC T trianglenorm(const T& x) { return intrinsics::rawtriangle(fract(x + 0.25)); } template <typename T> -KFR_SINTRIN T triangle(const T& x) +KFR_FUNC T triangle(const T& x) { return intrinsics::trianglenorm(constants<T>::recip_pi_s(1, 2) * x); } @@ -151,142 +151,142 @@ KFR_I_FN(isawtooth) KFR_I_FN(isawtoothnorm) template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -KFR_INTRIN T1 rawsine(const T1& x) +KFR_FUNC T1 rawsine(const T1& x) { return intrinsics::rawsine(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -KFR_INTRIN internal::expression_function<fn::rawsine, E1> rawsine(E1&& x) +KFR_FUNC internal::expression_function<fn::rawsine, E1> rawsine(E1&& x) { return { fn::rawsine(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -KFR_INTRIN T1 sine(const T1& x) +KFR_FUNC T1 sine(const T1& x) { return intrinsics::sine(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -KFR_INTRIN internal::expression_function<fn::sine, E1> sine(E1&& x) +KFR_FUNC internal::expression_function<fn::sine, E1> sine(E1&& x) { return { fn::sine(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -KFR_INTRIN T1 sinenorm(const T1& x) +KFR_FUNC T1 sinenorm(const T1& x) { return intrinsics::sinenorm(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -KFR_INTRIN internal::expression_function<fn::sinenorm, E1> sinenorm(E1&& x) +KFR_FUNC internal::expression_function<fn::sinenorm, E1> sinenorm(E1&& x) { return { fn::sinenorm(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -KFR_INTRIN T1 rawsquare(const T1& x) +KFR_FUNC T1 rawsquare(const T1& x) { return intrinsics::rawsquare(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -KFR_INTRIN internal::expression_function<fn::rawsquare, E1> rawsquare(E1&& x) +KFR_FUNC internal::expression_function<fn::rawsquare, E1> rawsquare(E1&& x) { return { fn::rawsquare(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -KFR_INTRIN T1 square(const T1& x) +KFR_FUNC T1 square(const T1& x) { return intrinsics::square(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -KFR_INTRIN internal::expression_function<fn::square, E1> square(E1&& x) +KFR_FUNC internal::expression_function<fn::square, E1> square(E1&& x) { return { fn::square(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -KFR_INTRIN T1 squarenorm(const T1& x) +KFR_FUNC T1 squarenorm(const T1& x) { return intrinsics::squarenorm(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -KFR_INTRIN internal::expression_function<fn::squarenorm, E1> squarenorm(E1&& x) +KFR_FUNC internal::expression_function<fn::squarenorm, E1> squarenorm(E1&& x) { return { fn::squarenorm(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -KFR_INTRIN T1 rawtriangle(const T1& x) +KFR_FUNC T1 rawtriangle(const T1& x) { return intrinsics::rawtriangle(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -KFR_INTRIN internal::expression_function<fn::rawtriangle, E1> rawtriangle(E1&& x) +KFR_FUNC internal::expression_function<fn::rawtriangle, E1> rawtriangle(E1&& x) { return { fn::rawtriangle(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -KFR_INTRIN T1 triangle(const T1& x) +KFR_FUNC T1 triangle(const T1& x) { return intrinsics::triangle(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -KFR_INTRIN internal::expression_function<fn::triangle, E1> triangle(E1&& x) +KFR_FUNC internal::expression_function<fn::triangle, E1> triangle(E1&& x) { return { fn::triangle(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -KFR_INTRIN T1 trianglenorm(const T1& x) +KFR_FUNC T1 trianglenorm(const T1& x) { return intrinsics::trianglenorm(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -KFR_INTRIN internal::expression_function<fn::trianglenorm, E1> trianglenorm(E1&& x) +KFR_FUNC internal::expression_function<fn::trianglenorm, E1> trianglenorm(E1&& x) { return { fn::trianglenorm(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -KFR_INTRIN T1 rawsawtooth(const T1& x) +KFR_FUNC T1 rawsawtooth(const T1& x) { return intrinsics::rawsawtooth(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -KFR_INTRIN internal::expression_function<fn::rawsawtooth, E1> rawsawtooth(E1&& x) +KFR_FUNC internal::expression_function<fn::rawsawtooth, E1> rawsawtooth(E1&& x) { return { fn::rawsawtooth(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -KFR_INTRIN T1 sawtooth(const T1& x) +KFR_FUNC T1 sawtooth(const T1& x) { return intrinsics::sawtooth(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -KFR_INTRIN internal::expression_function<fn::sawtooth, E1> sawtooth(E1&& x) +KFR_FUNC internal::expression_function<fn::sawtooth, E1> sawtooth(E1&& x) { return { fn::sawtooth(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -KFR_INTRIN T1 sawtoothnorm(const T1& x) +KFR_FUNC T1 sawtoothnorm(const T1& x) { return intrinsics::sawtoothnorm(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -KFR_INTRIN internal::expression_function<fn::sawtoothnorm, E1> sawtoothnorm(E1&& x) +KFR_FUNC internal::expression_function<fn::sawtoothnorm, E1> sawtoothnorm(E1&& x) { return { fn::sawtoothnorm(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -KFR_INTRIN T1 isawtooth(const T1& x) +KFR_FUNC T1 isawtooth(const T1& x) { return intrinsics::isawtooth(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -KFR_INTRIN internal::expression_function<fn::isawtooth, E1> isawtooth(E1&& x) +KFR_FUNC internal::expression_function<fn::isawtooth, E1> isawtooth(E1&& x) { return { fn::isawtooth(), std::forward<E1>(x) }; } template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)> -KFR_INTRIN T1 isawtoothnorm(const T1& x) +KFR_FUNC T1 isawtoothnorm(const T1& x) { return intrinsics::isawtoothnorm(x); } template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)> -KFR_INTRIN internal::expression_function<fn::isawtoothnorm, E1> isawtoothnorm(E1&& x) +KFR_FUNC internal::expression_function<fn::isawtoothnorm, E1> isawtoothnorm(E1&& x) { return { fn::isawtoothnorm(), std::forward<E1>(x) }; } diff --git a/include/kfr/io/tostring.hpp b/include/kfr/io/tostring.hpp @@ -142,7 +142,7 @@ struct representation<kfr::mask<T, N>> static std::string get(const kfr::mask<T, N>& value) { bool values[N]; - for(size_t i = 0; i < N; i++) + for (size_t i = 0; i < N; i++) values[i] = value[i]; return details::array_to_string(values, N); }