Skip to content

Conversation

@eprovst
Copy link
Contributor

@eprovst eprovst commented Mar 27, 2023

Description

This PR should improve the readability of xGEBAL, without changing it functionally. In my testing, this does give identical results to the original, however a second pair of eyes is needed to verify. Execution times also seem to be identical, if not ever so slightly better.

The first commit contains the refactor. The second is a slight change where the NaN check is taken outside the loop. As far as I know, multiplying and dividing by 2 should not introduce NaNs, else the latter change is of course incorrect.

I also noticed that although the 2-norm is used, the stopping criterion seems to be for the 1-norm (cf. James, R., Langou, J., & Lowery, B. R. (2014). On matrix balancing and eigenvector computation. arXiv:1401.5766.)? I'll leave that one to the experts.

(As some background: balancing seemed relevant to an issue I was facing, so I wanted to be able to tinker with DGEBAL, in the end it was irrelevant to my work, but maybe this refactor could be useful to someone else later.)

Checklist

  • The documentation has been updated.
  • If the PR solves a specific issue, it is set to be closed on merge.
@eprovst eprovst marked this pull request as draft March 27, 2023 16:13
@eprovst
Copy link
Contributor Author

eprovst commented Mar 27, 2023

Now suddenly tests are failing on my side, so changing this to draft...

As of latest (force) push all tests succeed fully on my machine.

langou
langou previously approved these changes Mar 27, 2023
@codecov
Copy link

codecov bot commented Mar 27, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (d6b6ed7) 0.00% compared to head (1a5c922) 0.00%.

❗ Current head 1a5c922 differs from pull request most recent head 9c489fd. Consider uploading reports for the commit 9c489fd to get more accurate results

Additional details and impacted files
@@ Coverage Diff @@ ## master #808 +/- ## ======================================== Coverage 0.00% 0.00% ======================================== Files 1908 1908 Lines 187072 186968 -104 ======================================== + Misses 187072 186968 -104 
Impacted Files Coverage Δ
SRC/cgebal.f 0.00% <0.00%> (ø)
SRC/cgees.f 0.00% <ø> (ø)
SRC/cgeesx.f 0.00% <ø> (ø)
SRC/cgeev.f 0.00% <ø> (ø)
SRC/cgeevx.f 0.00% <ø> (ø)
SRC/cgels.f 0.00% <ø> (ø)
SRC/cgelsd.f 0.00% <ø> (ø)
SRC/cgelss.f 0.00% <ø> (ø)
SRC/cgelst.f 0.00% <ø> (ø)
SRC/cgelsy.f 0.00% <ø> (ø)
... and 124 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@eprovst eprovst marked this pull request as ready for review March 28, 2023 11:44
@eprovst
Copy link
Contributor Author

eprovst commented Mar 28, 2023

I seem to have missed a part of the code when translating my changes from the real to the complex case. Fixed as of now, sorry about missing that before opening the PR.

Copy link
Collaborator

@thijssteel thijssteel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original code is quite hard to read, so it's also hard to verify that this code does the same. That being said, I trust the tests for standard eigenvalue problems to be thorough enough. The scaling routine makes much more sense now. Good job @eprovst

@langou langou merged commit 38f7703 into Reference-LAPACK:master Mar 28, 2023
@eprovst eprovst deleted the gebal branch March 28, 2023 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants