C++ CRF implementation