diff options
| author | Paul Jungeblut <paul.jungeblut@gmail.com> | 2016-01-12 23:49:05 +0100 |
|---|---|---|
| committer | Paul Jungeblut <paul.jungeblut@gmail.com> | 2016-01-12 23:49:05 +0100 |
| commit | 6a7442775d1b701f7fb471eb098cdac35eaacb63 (patch) | |
| tree | b18d07d4b21318f0c436aca13a2fb16957d87a44 /math/fft.cpp | |
| parent | 83dc7884f730e98e853662fb9d14c68aa177635f (diff) | |
Adding an FFT and sample code to multiply two polynomials in O(n log(n)).
Diffstat (limited to 'math/fft.cpp')
| -rw-r--r-- | math/fft.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/math/fft.cpp b/math/fft.cpp index 89018c5..8fe38e5 100644 --- a/math/fft.cpp +++ b/math/fft.cpp @@ -1,3 +1,5 @@ +// Laufzeit: O(n log(n)). +typedef complex<double> cplx; // Eigene Implementierung ist noch deutlich schneller. // s.size() muss eine Zweierpotenz sein! vector<cplx> fft(const vector<cplx> &a, bool inverse = 0) { int logn = 1, n = a.size(); |
