private static void forwBackwGenCheck(IILFFT fft, ILArray<fcomplex> A, ILArray<fcomplex> Result, int dim, float mult) { 
ILArray<fcomplex> B = fft.FFTForward1D(A, dim);
if (ILMath.sumall(ILMath.abs(Result - B))/A.Dimensions.NumberOfElements / A.Dimensions[dim] > (double)ILMath.MachineParameterFloat.eps * mult)
    throw new Exception("invalid value");
B = fft.FFTBackward1D(B, dim);
if (ILMath.sumall(ILMath.abs(A - B))/A.Dimensions.NumberOfElements / A.Dimensions[dim] > (double)ILMath.MachineParameterFloat.eps * mult)
    throw new Exception("invalid value");}
Exemplo n.º 2
0
private static void forwBackwGenCheck(IILFFT fft, ILArray<double> A, ILArray<complex> Result, int dim, double mult) { 
ILArray<complex> B = fft.FFTForward1D(A, dim);
if (ILMath.sumall(ILMath.abs(Result - B))/A.Dimensions.NumberOfElements / A.Dimensions[dim] > ILMath.MachineParameterDouble.eps * mult)
    throw new Exception("invalid value");
ILArray<double> ResultR = fft.FFTBackwSym1D(B,dim);
if (ILMath.sumall(ILMath.abs(ResultR - A))/A.Dimensions.NumberOfElements / A.Dimensions[dim] > ILMath.MachineParameterDouble.eps * mult)
   throw new Exception("invalid value");
B = fft.FFTBackward1D(B, dim);
if (ILMath.sumall(ILMath.abs(ILMath.tocomplex(A) - B))/A.Dimensions.NumberOfElements / A.Dimensions[dim] > ILMath.MachineParameterDouble.eps * mult)
    throw new Exception("invalid value");}