Make scaling work with non-square matrices

This commit is contained in:
Julian Kent 2017-03-03 12:58:51 +01:00
parent a71943b9a4
commit bbe717fa2f

View File

@ -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