| 790 | } |
| 791 | |
| 792 | QVector getDFT(QVector in) { |
| 793 | REQUIRE( in.size() > 0 ); |
| 794 | |
| 795 | size_t dim = in.size(); |
| 796 | qreal ampFac = 1 / sqrt( dim ); |
| 797 | qreal phaseFac = 2 * M_PI / dim; |
| 798 | |
| 799 | QVector dftVec = QVector(dim); |
| 800 | |
| 801 | for (size_t x=0; x<dim; x++) { |
| 802 | dftVec[x] = 0; |
| 803 | for (size_t y=0; y<dim; y++) |
| 804 | dftVec[x] += expI(phaseFac * x * y) * in[y]; |
| 805 | dftVec[x] *= ampFac; |
| 806 | } |
| 807 | return dftVec; |
| 808 | } |
| 809 | |
| 810 | long long int getValueOfTargets(long long int ind, int* targs, int numTargs) { |
| 811 | DEMAND( ind >= 0 ); |
no test coverage detected