Move calculation of bic from R to C++