From 6a7442775d1b701f7fb471eb098cdac35eaacb63 Mon Sep 17 00:00:00 2001 From: Paul Jungeblut Date: Tue, 12 Jan 2016 23:49:05 +0100 Subject: Adding an FFT and sample code to multiply two polynomials in O(n log(n)). --- math/fft.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'math/fft.cpp') 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 cplx; // Eigene Implementierung ist noch deutlich schneller. // s.size() muss eine Zweierpotenz sein! vector fft(const vector &a, bool inverse = 0) { int logn = 1, n = a.size(); -- cgit v1.2.3