linear regression in C++