mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-21 07:19:46 +08:00
Make scaling work with non-square matrices
This commit is contained in:
parent
a71943b9a4
commit
bbe717fa2f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user