added LFMCMC function, using boost templates