Boost logo

Boost Users :

From: Jeff F (TriumphSprint2000_at_[hidden])
Date: 2006-11-06 08:10:31


Chun,

> "chun ping wang" cablepuff_at_[hidden]> wrote in message
> news:7253f6b30611040957jd863beyc72ffb73605002bf_at_mail.gmail.com...
> Hey i have a quick question regarding dynamic bits. Is there a quick and
> effective way to reverse bits.
> (if so how)... i try >swapping.. but i get compile time error. so that i
> can calculate iterative-fft since it
> requires bit-reverse-copy
>
> for (i = 0; i<num_bits/2; ++i)
> swap(b[i], b[i+numbits/2]);

Have your tried: std::reverse( b.begin(), b.end() ); or some other valid
range in b? Also there is a std::reverse_copy algorithm. IIRC, fft does not
use a simple bit reverse. I don't have the details readily accessible to me
now but can look into it this evening.

Jeff Flinn


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net