c++ markov chain class