C++ implements HMM (Hidden Markov Model)