mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-21 07:19:46 +08:00
Merged in jkflying/eigen-fix-scaling (pull request PR-302)
Make scaling work with non-square matrices
This commit is contained in:
commit
fc45324380
@ -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