commit b5672ce18f854d0256879d30b04e4c1a5575dae1
parent 11d9a1568b6157ebe6b4b44e121be8c9d3e587bf
Author: Nicholas Corgan <n.corgan@gmail.com>
Date: Sun, 12 May 2019 15:30:52 -0500
Fixed window and complex_math API consistency
* window_rectangular: templatize T instead of forcing to fbase
* cconj: added missing non-instrinsic scalar function
Diffstat:
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/include/kfr/dsp/window.hpp b/include/kfr/dsp/window.hpp
@@ -476,9 +476,10 @@ KFR_WINDOW_BY_TYPE(lanczos)
/**
* @brief Returns template expression that generates Rrectangular window of length @c size
*/
-KFR_FUNCTION internal::expression_rectangular<fbase> window_rectangular(size_t size)
+template <typename T = fbase>
+KFR_FUNCTION internal::expression_rectangular<T> window_rectangular(size_t size, ctype_t<T> = ctype_t<T>())
{
- return internal::expression_rectangular<fbase>(size, fbase());
+ return internal::expression_rectangular<T>(size, T());
}
/**
diff --git a/include/kfr/math/complex_math.hpp b/include/kfr/math/complex_math.hpp
@@ -273,6 +273,13 @@ KFR_FUNCTION internal::expression_function<fn::carg, E1> carg(E1&& x)
return { fn::carg(), std::forward<E1>(x) };
}
+/// @brief Returns the complex conjugate of the complex number x
+template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
+KFR_FUNCTION T1 cconj(const T1& x)
+{
+ return intrinsics::cconj(x);
+}
+
/// @brief Returns template expression that returns the complex conjugate of the complex number x
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::cconj, E1> cconj(E1&& x)