private static void ValidateSign(FftwSign sign) { if (sign != FftwSign.FFTW_FORWARD && sign != FftwSign.FFTW_BACKWARD) { throw new ArgumentException($"Sign is not one of FFTW_FORWARD, FFTW_BACKWARD", nameof(sign)); } }
public static FftwPlan Dft(int[] n, out FftwArray inArray, out FftwArray outArray, FftwSign sign = FftwSign.FFTW_FORWARD, FftwFlags flags = FftwFlags.FFTW_MEASURE) { int length = DftLength(n); inArray = new FftwArray(length); outArray = new FftwArray(length); return(Dft(n, inArray, outArray, sign, flags)); }
public static FftwPlan Dft(int[] n, FftwArray inArray, FftwArray outArray, FftwSign sign = FftwSign.FFTW_FORWARD, FftwFlags flags = FftwFlags.FFTW_MEASURE) { int length = DftLength(n); ValidateSign(sign); ValidateArray(inArray, length, nameof(inArray)); ValidateArray(outArray, length, nameof(outArray)); return(new FftwPlan(flags, fftw_plan_dft(n.Length, n, inArray.Pointer, outArray.Pointer, (int_t)sign, (uint_t)flags), inArray, outArray)); }
public static FftwPlan Dft(int[] n, out FftwArray ioArray, FftwSign sign = FftwSign.FFTW_FORWARD, FftwFlags flags = FftwFlags.FFTW_MEASURE) { ioArray = new FftwArray(DftLength(n)); return(Dft(n, ioArray, ioArray, sign, flags)); }
public static FftwPlan Dft3D(int n0, int n1, int n2, out FftwArray ioArray, FftwSign sign = FftwSign.FFTW_FORWARD, FftwFlags flags = FftwFlags.FFTW_MEASURE) { ioArray = new FftwArray(DftLength(n0, n1, n2)); return(Dft3D(n0, n1, n2, ioArray, ioArray, sign, flags)); }