This method pads an ArrayList with zeros in order to have a size equal to the next power of two of the previous size. @param x The ArrayList to be padded.
(Collection<Complex> x)
| 284 | * @param x The ArrayList to be padded. |
| 285 | */ |
| 286 | private static void paddingPowerOfTwo(Collection<Complex> x) { |
| 287 | int n = 1; |
| 288 | int oldSize = x.size(); |
| 289 | while (n < oldSize) { |
| 290 | n *= 2; |
| 291 | } |
| 292 | for (int i = 0; i < n - oldSize; i++) { |
| 293 | x.add(new Complex()); |
| 294 | } |
| 295 | } |
| 296 | } |