Gibbs sampler and Metropolis Hasting algorithm in C and C++