summaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authorPaul Jungeblut <paul.jungeblut@gmail.com>2016-01-12 23:49:05 +0100
committerPaul Jungeblut <paul.jungeblut@gmail.com>2016-01-12 23:49:05 +0100
commit6a7442775d1b701f7fb471eb098cdac35eaacb63 (patch)
treeb18d07d4b21318f0c436aca13a2fb16957d87a44 /math
parent83dc7884f730e98e853662fb9d14c68aa177635f (diff)
Adding an FFT and sample code to multiply two polynomials in O(n log(n)).
Diffstat (limited to 'math')
-rw-r--r--math/fft.cpp2
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();