CLBP implementation in C++