The simulation code used in http://www.ncbi.nlm.nih.gov/pubmed/23437004
Warning: this code is out of date, and depends on versions of libsequence prior to 1.8.3, boost, and all sorts of other things.
A better, faster version is one of the example programs that comes with fwdpp. You can/should use that instead. It takes advantage of the latest version of fdwpp, in terms of both design and run-time speed.