aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/src
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2017-11-10 10:11:36 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2017-11-10 10:11:36 +0000
commitfc453243801f883a0a7ac3614e43fd9f5c8de2b8 (patch)
tree3f167e8296ca5859daaa562a775c617a1c818bfe /unsupported/Eigen/src
parentd306b96fb7e52fe7a6c1c4ab159cc9423211e1c5 (diff)
parentbbe717fa2f9fe4828c845b27f4a7d4bb77fffdb2 (diff)
Merged in jkflying/eigen-fix-scaling (pull request PR-302)
Make scaling work with non-square matrices
Diffstat (limited to 'unsupported/Eigen/src')
-rw-r--r--unsupported/Eigen/src/IterativeSolvers/Scaling.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/unsupported/Eigen/src/IterativeSolvers/Scaling.h b/unsupported/Eigen/src/IterativeSolvers/Scaling.h
index d113e6e90..9b3eb53e0 100644
--- a/unsupported/Eigen/src/IterativeSolvers/Scaling.h
+++ b/unsupported/Eigen/src/IterativeSolvers/Scaling.h
@@ -104,12 +104,18 @@ class IterScaling
for (int i = 0; i < m; ++i)
{
Dr(i) = std::sqrt(Dr(i));
+ }
+ for (int i = 0; i < n; ++i)
+ {
Dc(i) = std::sqrt(Dc(i));
}
// Save the scaling factors
for (int i = 0; i < m; ++i)
{
m_left(i) /= Dr(i);
+ }
+ for (int i = 0; i < n; ++i)
+ {
m_right(i) /= Dc(i);
}
// Scale the rows and the columns of the matrix