aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported
diff options
context:
space:
mode:
authorGravatar Thomas Capricelli <orzel@freehackers.org>2009-08-24 17:49:37 +0200
committerGravatar Thomas Capricelli <orzel@freehackers.org>2009-08-24 17:49:37 +0200
commit4e62e2986929a2e10b289015453c4e393d8d84b9 (patch)
tree39267b8209843ed66af357f7bff17c99675046dd /unsupported
parent17905c73996aa0a4a3e5146457af29eb827c7422 (diff)
cleaning covar
Diffstat (limited to 'unsupported')
-rw-r--r--unsupported/Eigen/src/NonLinear/covar.h7
-rw-r--r--unsupported/test/NonLinear.cpp2
2 files changed, 3 insertions, 6 deletions
diff --git a/unsupported/Eigen/src/NonLinear/covar.h b/unsupported/Eigen/src/NonLinear/covar.h
index 3c163dd68..2e495cd7f 100644
--- a/unsupported/Eigen/src/NonLinear/covar.h
+++ b/unsupported/Eigen/src/NonLinear/covar.h
@@ -25,9 +25,8 @@ void ei_covar(
for (j = 0; j <= k-1; ++j) {
temp = r(k,k) * r(j,k);
r(j,k) = 0.;
- for (i = 0; i <= j; ++i) {
+ for (i = 0; i <= j; ++i)
r(i,k) -= temp * r(i,j);
- }
}
l = k;
}
@@ -50,12 +49,12 @@ void ei_covar(
/* in the strict lower triangle of r and in wa. */
for (j = 0; j < n; ++j) {
- jj = ipvt[j]-1;
+ jj = ipvt[j];
sing = j > l;
for (i = 0; i <= j; ++i) {
if (sing)
r(i,j) = 0.;
- ii = ipvt[i]-1;
+ ii = ipvt[i];
if (ii > jj)
r(ii,jj) = r(i,j);
if (ii < jj)
diff --git a/unsupported/test/NonLinear.cpp b/unsupported/test/NonLinear.cpp
index 6bb07a716..54e6e9968 100644
--- a/unsupported/test/NonLinear.cpp
+++ b/unsupported/test/NonLinear.cpp
@@ -193,7 +193,6 @@ void testLmder()
// check covariance
covfac = fnorm*fnorm/(m-n);
- ipvt.cwise()+=1; // covar() expects the fortran convention (as qrfac provides)
ei_covar<double>(fjac, ipvt);
MatrixXd cov_ref(n,n);
@@ -567,7 +566,6 @@ void testLmdif()
// check covariance
covfac = fnorm*fnorm/(m-n);
- ipvt.cwise()+=1; // covar() expects the fortran convention (as qrfac provides)
ei_covar<double>(fjac, ipvt);
MatrixXd cov_ref(n,n);