Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Complex[] multiPoly(Complex[] t, Complex[] p, int N)
- {
- Complex[] tempt = new Complex[2*N];
- Complex[] tempp = new Complex[2*N];
- for(int i=0; i<2*N; i++)
- {
- if(i<N)
- {
- tempt[i]=t[i];
- tempp[i]=p[i];
- }
- else
- {
- tempt[i]=new Complex(0, 0);
- tempp[i]=new Complex(0, 0);
- }
- }
- Complex[] transformedt = FFT(tempt, 2*N);
- Complex[] transformedp = FFT(tempp, 2*N);
- Complex[] timeser = new Complex[2*N];
- for(int i= 0; i<timeser.length; i++) timeser[i] = transformedt[i].times(transformedp[i]);
- Complex[] inversed = iFFT(timeser, 2*N);
- return inversed;
- }
Add Comment
Please, Sign In to add comment