20 std::vector<double> result(values.size() * 2);
22 for (
size_t i = 0; i < values.size(); i++)
23 result[2 * i] = values[i];
35 if (values.size() % 2) {
36 throw std::invalid_argument(
"Cannot convert to real vector");
40 std::vector<double> result(values.size() / 2);
42 for (
size_t i = 0; i < result.size(); i++) {
43 result[i] = values[2 * i];
std::vector< double > fromComplex(const std::vector< double > &values) override
Converts a vector of complex numbers to a vector of real numbers.
std::vector< double > toComplex(const std::vector< double > &values) override
Converts a vector of real values to a vector of complex numbers.