CRF implementation in C++