added logreg cpp implementation