-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[stdlib_linalg] matrix property checks #499
Conversation
I just realized the tests for |
The most recent commit says |
I believe with the docs added all of the major tasks on my side are complete. I was getting an error from one of the test builds, but it appears I have now fixed that. Please let me know if this is not the case. |
Hermiticity comes from the name of the French mathematician Charles
Hermite, who invented the concept. Hermeticity comes from the Greek god
Hermes, who in Renaissance times and earlier was also known as Hermes
Trismegistus and in that guise he was the god/patron "saint" of the
alchemists. So if Iwere you, I'd opt for the first spelling ;), even though
the second is more common in everyday speech.
Op ma 27 sep. 2021 om 16:36 schreef Gabriel Brown ***@***.***
…:
***@***.**** commented on this pull request.
------------------------------
In src/stdlib_linalg.fypp
<#499 (comment)>:
> + logical :: res
+ ${t1}$ :: zero
+ integer :: m, n, o, i, j
+ zero = 0 !zero of relevant type
+ m = size(A,1)
+ n = size(A,2)
+ do j = 1, n !loop over all columns
+ o = min(j-1,m) !index of row above diagonal (or last row)
+ do i = 1, o !loop over rows above diagonal
+ if (.not. (A(i,j) .eq. zero)) then
+ res = .false.
+ return
+ end if
+ end do
+ do i = o+2, m !loop over rows below diagonal
+ if (.not. (A(i,j) .eq. zero)) then
No good reason. I always forget which language use which negated equality
with symbols (between !=, ~=, /=, and more), so I just reverted to
something I knew would work (while forgetting about .neq.).
I'll make the changes, thanks for catching this.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#499 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN6YR6EJ4UOAHIZP7V7UBTUEB6NHANCNFSM5C6Q5BDA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
@arjenmarkus Thanks for the etymology! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I left a number of specific comments on style, namely on using the modern relational operators instead of the old ones (still standard, but deprecated by Metcalf, Reid & Cohen).
@milancurcic Thanks for the style notes. I always preferred the alphabetic relational operators since they read easily (like Python), but did not realize they had been deprecated (too bad). I will update to conform. |
@ghbrown FWIW here's how I've been doing it, there may be other or better ways:
|
@ghbrown Note the conflict with |
@milancurcic Thanks! I had been tracking it via the
will alert me of the relevant merge conflicts? @jvdp1 Thanks for the heads up on that. I had originally wanted to use |
Yes, it will. I just tested it and the two conflicts mentioned on this page are mentioned too.
The current |
@ghbrown did you get a chance to look at this PR? Don't hesitate to ping me if you need help. |
@jvdp1 I took a quick look about a week ago when it was bumped and have a general idea of what needs to be done and slightly less of an idea of how to do it. The real constraint for me is time, of which I'll have almost none until December 20. If it can wait that long, I'm more than happy to take care of it, as I think it would be good to see what's new with testdrive, etc. I suspect I'll be able to figure things out just fine when I actually have time to work on it, but if not I will reach out. Apologies for the delay. |
@ghbrown Thank you for answer. No worries. There is no rush! |
A bit later than planned, but with the latest commits things are hopefully much closer to completion. A few outstanding concerns:
Any suggestions on these concerns would be greatly appreciated. |
The manual makefile build probably fails because of a missing module dependency (those have to be added by hand, because make doesn't know how to compile Fortran without our help). Missing dependencies might or might not show up as build failure, we try to run make with as many threads as possible in the CI to ensure it almost always fails when a dependency is not specified. Regarding test-drive, you can always run the test executable from the build directory directly to inspect the printout manually. Calling I can also have a look on those issues, if you like. |
@awvwgk Thanks for the suggestions. The issue with tests not failing when intended was a mistake in my A lot has changed since this PR originally got its approvals, so if further review is necessary it's no problem. |
Thanks @ghbrown and reviewers, let's merge tomorrow if there are no further objections. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before merging, could you remove the files related to the hash procedures, please? They should not appear in this PR.
Otherwise, I have no other comments. Thank you @ghbrown
@jvdp1 Thanks for catching that, fixed. Should those get added to a |
yes, I think it should be. But not in this PR. Could you open a new PR with those added to |
Thank you @ghbrown for this PR, and also all reviewers. I will merge it. |
@jvdp1 Sure, no problem. |
As discussed in #482 and #476, this adds common matrix property checks (all returning a
logical
), including:is_square(A)
is_diagonal(A)
, extended for nonsquare matrices as wellis_symmetric(A)
is_skew_symmetric(A)
is_hermitian(A)
is_triangular(A,uplo)
, inputuplo
in{'u',U','l','L'}
to decide if checking for upper or lower, also extended to nonsquare matricesis_hessenberg(A,uplo)
, inputuplo
in{'u',U','l','L'}
to decide if checking for upper or lower, also extended to nonsquare matricescmake
andmake
builds appear to go fine (with a few warnings). Testing viacmake
also gives quite a few warnings specifically related to the relevant tests, but all pass with no problem. The tests are especially long (~2000 lines worth), but I've discussed assisting in porting them over to something friendlier (fypp
/test-drive
/ etc.) after this PR is finished.Documentation has not been written yet, I wanted to check in midway and make sure everything looked acceptable. Thanks.