code: private static void bitReverse(DoubleVector vector, int power) {
          vector.set(0, 0);
          vector.set(1, 2 << (power - 1));
          vector.set(2, 2 << (power - 2));
          vector.set(3, 3 * 2 << (power - 2));
          int prevN = 3;
          for (int k = 3; k < power - 2; ++k) {
              int currN = (2 << k) - 1;
              vector.set(currN, vector.get(prevN) + (2 << (power - k)));
              for (int l = 0; l < prevN - 1; ++l)
                  vector.set(currN - l, vector.get(currN) - vector.get(l));
              prevN = currN;
          }
      }
docs: Reverses the bits, a step required for doing the FFT in place.  This
  implementation is significantly faster than {@link bitreverse}. This
  implementation is based on the following paper:
  
  </li style="font-family:Garamond, Georgia, serif">M. Rubio, P. Gomez,
  and K. Drouice.  "A new superfast bit reversal algorithm"
  <i>International Journal of Adaptive Control and Signal Processing</i>
  
  @param vector The vector to be permuted according to the bit reversal.
  This vector's length must be a power of two
  @param power The log of the vector's length