diff options
author | Julian Kent <anonymous@invalid.net> | 2017-03-03 12:58:51 +0100 |
---|---|---|
committer | Julian Kent <anonymous@invalid.net> | 2017-03-03 12:58:51 +0100 |
commit | bbe717fa2f9fe4828c845b27f4a7d4bb77fffdb2 (patch) | |
tree | baf9d03bb6d0204cefabf94fad8b0fba2ab43c0b /unsupported/Eigen/src/IterativeSolvers | |
parent | a71943b9a432c8962f025b56313584f33111ace4 (diff) |
Make scaling work with non-square matrices
Diffstat (limited to 'unsupported/Eigen/src/IterativeSolvers')
-rw-r--r-- | unsupported/Eigen/src/IterativeSolvers/Scaling.h | 6 |
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 |