Skip to content
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

add kwarg to test for approximate symmetric/hermitian matrices #42707

Closed
wants to merge 1 commit into from

Conversation

bjarthur
Copy link
Contributor

@bjarthur bjarthur commented Oct 19, 2021

closes #28885. see recent comments

@@ -74,6 +74,7 @@ Standard library changes
#### Package Manager

#### LinearAlgebra
* `issymmetric` and `ishermitian` can now test for approximate equality
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* `issymmetric` and `ishermitian` can now test for approximate equality
* `issymmetric` and `ishermitian` can now test for approximate symmetry

?

@dkarrasch
Copy link
Member

How would we deal with the tolerance keywords to isapprox? I guess only via a lambda like

issymmetric(A, eq=((x, y) -> isapprox(x, y, atol=..., rtol=...)))

? With so much code, I wonder what is wrong about isapprox(A, A', atol=..., rtol=...), or, if there is no need for special tolerances, A ≈ A'.

@dkarrasch dkarrasch added the linear algebra Linear algebra label Oct 19, 2021
@N5N3
Copy link
Member

N5N3 commented Oct 20, 2021

Comment from another related issue:
I think that isapprox(X, transpose(X), atol=atol, rtol=rtol) is definitely more reasonable here than an element-wise test. Probably should also pass through a norm argument.
Originally posted by @stevengj in #36243 (comment)

@bjarthur
Copy link
Contributor Author

hah. hadn't thought of simply doing isapprox(A,A'). that suffices for me so i'll close this PR.

@bjarthur bjarthur closed this Oct 21, 2021
@bjarthur bjarthur deleted the bja/issymmetric branch October 21, 2021 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear algebra Linear algebra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ishermitian/issymmetric should accept optional atol keyword parameter
3 participants