22 #ifndef EDSP_REAL2COMPLEX_HPP 23 #define EDSP_REAL2COMPLEX_HPP 25 #include <edsp/meta/iterator.hpp> 29 namespace edsp {
inline namespace converter {
51 template <
typename InputIt,
typename OutputIt>
52 constexpr
void real2complex(InputIt first, InputIt last, OutputIt d_first) {
53 using input_t = meta::value_type_t<InputIt>;
54 using output_t = meta::value_type_t<OutputIt>;
55 std::transform(first, last, d_first, [](
const input_t value) -> output_t {
return value; });
67 template <
typename InputIt,
typename OutputIt>
68 constexpr
void real2complex(InputIt first1, InputIt last1, InputIt first2, OutputIt d_first) {
69 using input_t = meta::value_type_t<InputIt>;
70 using output_t = meta::value_type_t<OutputIt>;
71 std::transform(first1, last1, first2, d_first, [](
const input_t real,
const input_t
imag) -> output_t {
78 #endif // EASDY_REAL2COMPLEX_HPP constexpr T real(const std::complex< T > &z)
Computes the real component of the complex number z.
Definition: complex.hpp:60
constexpr std::complex< T > real2complex(T real, T imag=static_cast< T >(0)) noexcept
Converts a real scalar to an equivalent complex number.
Definition: real2complex.hpp:38
constexpr T imag(const std::complex< T > &z)
Computes the imaginary component of the complex number z.
Definition: complex.hpp:70
Definition: amplifier.hpp:29