Created
October 27, 2013 16:49
-
-
Save majiang/7184833 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main() | |
| { | |
| import std.algorithm, std.random, std.range, std.numeric; | |
| auto obj = new Fft2D!Fft(4, 4); // FFT を提供するクラスのインスタンスは1つあれば十分な気がする (x, y でサイズが違っても大きい方を持ってよい) | |
| double[][] input; | |
| foreach (i; 0..4) | |
| input ~= iota(0, 4).map!(b => uniform(0.0, 1.0))().array(); | |
| auto result = obj.fft!real(input); | |
| auto inv = obj.inverseFft!real(result); | |
| import std.stdio; | |
| writeln(input); | |
| writeln(result); | |
| writeln(inv); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment