40 double pi = 2 * asin(1.0);
42 std::complex<double> om = std::complex<double>(
43 cos(2 * pi / n), sin(2 * pi / n));
45 om.real(om.real() / n);
46 om.imag(om.imag() / n);
48 auto *pe =
new std::complex<double>[n / 2];
50 auto *po =
new std::complex<double>[n / 2];
53 for (
int j = 0; j < n; j++) {
62 std::complex<double> *ye =
65 std::complex<double> *yo =
68 auto *y =
new std::complex<double>[n];
72 for (
int i = 0; i < n / 2; i++) {
74 ye[k1] + pow(om, i) * yo[k2];
76 ye[k1] - pow(om, i) * yo[k2];
104 auto *t1 =
new std::complex<double>[2];
105 auto *t2 =
new std::complex<double>[4];
116 std::vector<std::complex<double>> r1 = {
119 std::vector<std::complex<double>> r2 = {
120 {1, 0}, {2, 0}, {3, 0}, {4, 0}};
122 std::complex<double> *o1 =
125 std::complex<double> *o2 =
128 for (uint8_t i = 0; i < n1; i++) {
129 assert((r1[i].real() - o1[i].real() < 0.000000000001) &&
130 (r1[i].imag() - o1[i].imag() <
135 for (uint8_t i = 0; i < n2; i++) {
136 assert((r2[i].real() - o2[i].real() < 0.000000000001) &&
137 (r2[i].imag() - o2[i].imag() <
146 std::cout <<
"All tests have successfully passed!\n";