forked from AMSC-24-25/20-fft-20-fft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbit-reversal.hpp
26 lines (23 loc) · 1023 Bytes
/
bit-reversal.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef BIT_REVERSAL_HPP
#define BIT_REVERSAL_HPP
#include <complex>
#include <vector>
/**
* Perform a sequential bit-reversal on the input data vector.
*
* The operation is done in-place and the input data vector is modified.
* The returned vector is done for convenience.
* @param data The input data vector.
* @return The input data vector after bit-reversal. It is modified in-place, so the return value is for convenience.
*/
std::vector<std::complex<double>> & sequentialBitReversal(std::vector<std::complex<double>> &data);
/**
* Perform a parallel (OpenMP) bit-reversal on the input data vector.
*
* The operation is done in-place and the input data vector is modified.
* The returned vector is done for convenience.
* @param data The input data vector.
* @return The input data vector after bit-reversal. It is modified in-place, so the return value is for convenience.
*/
std::vector<std::complex<double>> & parallelBitReversal(std::vector<std::complex<double>> &data);
#endif //BIT_REVERSAL_HPP