[Rcpp-commits] r2909 - pkg/RcppArmadillo/src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Feb 21 04:45:41 CET 2011
Author: edd
Date: 2011-02-21 04:45:38 +0100 (Mon, 21 Feb 2011)
New Revision: 2909
Modified:
pkg/RcppArmadillo/src/fastLm.cpp
Log:
init inner_product with 0.0. not double()
Modified: pkg/RcppArmadillo/src/fastLm.cpp
===================================================================
--- pkg/RcppArmadillo/src/fastLm.cpp 2011-02-20 23:07:09 UTC (rev 2908)
+++ pkg/RcppArmadillo/src/fastLm.cpp 2011-02-21 03:45:38 UTC (rev 2909)
@@ -31,7 +31,7 @@
arma::colvec coef = arma::solve(X, y); // fit model y ~ X
arma::colvec res = y - X*coef; // residuals
- double s2 = std::inner_product(res.begin(), res.end(), res.begin(), double())/df;
+ double s2 = std::inner_product(res.begin(), res.end(), res.begin(), 0.0)/df;
// std.errors of coefficients
arma::colvec std_err = arma::sqrt(s2 * arma::diagvec( arma::pinv(arma::trans(X)*X) ));
More information about the Rcpp-commits
mailing list