simple least squares linear regression in c++