Skip to content
Browse files

Cleanup maintenance

  • Loading branch information...
1 parent 84c0e83 commit eaed562bec98d643526c31d4d00cb358183e6d5c @morteza committed Nov 8, 2011
Showing with 6 additions and 3 deletions.
  1. +6 −3 tasks.cpp
View
9 tasks.cpp
@@ -15,19 +15,22 @@ void DFTCalcTask::run()
if (x2 == NULL || y2 == NULL)
return; // FAULT occurs
- for (long i=0;i<size;i++) {
+ for (long i=0;i<size;i++)
+ {
x2[i] = 0;
y2[i] = 0;
arg = -2.0 * 3.141592654 * (double)i / (double)size;
- for (long k=0;k<size;k++) {
+ for (long k=0;k<size;k++)
+ {
cosArg = cos(k * arg);
sinArg = sin(k * Arg);
x2[i] += (x1[k] * cosArg - y1[k] * sinArg);
y2[i] += (x1[k] * sinArg + y1[k] * cosArg);
}
}
- for (long i=0;i<size;i++) {
+ for (long i=0;i<size;i++)
+ {
x1[i] = x2[i] / (double)size;
y1[i] = y2[i] / (double)size;
}

0 comments on commit eaed562

Please sign in to comment.
Something went wrong with that request. Please try again.