Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1436 +/- ##
==========================================
- Coverage 93.89% 93.85% -0.04%
==========================================
Files 34 34
Lines 15920 15927 +7
==========================================
+ Hits 14948 14949 +1
- Misses 972 978 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a951fec to
efc43b4
Compare
| issymmetrictype(::Type) = false | ||
| issymmetrictype(::Type{<:Union{Symmetric,Hermitian{<:Real}}}) = true | ||
| issymmetrictype(::Type{<:Real}) = true | ||
| issymmetrictype(::Type{<:AbstractFloat}) = false |
There was a problem hiding this comment.
Shouldn't it be
issymmetrictype(::Type{<:Number}) = true
?
There was a problem hiding this comment.
The exception is NaN, which isn't equal to itself. I didn't want to make this more generic in case the number types contain NaN as a field.
| ishermitiantype(::Type) = false | ||
| ishermitiantype(::Type{<:Union{Symmetric{<:Real},Hermitian}}) = true | ||
| ishermitiantype(::Type{<:Real}) = true | ||
| ishermitiantype(::Type{<:AbstractFloat}) = false |
There was a problem hiding this comment.
I don't understand this AbstractFloat rule?
There was a problem hiding this comment.
This is to stay consistent with the current behavior
julia> issymmetric(NaN)
falseThere was a problem hiding this comment.
That seems highly questionable to me, as opposed to issymmetric(::Number) = true and ishermitian(x::Number) = isreal(x).
e.g. we have have a type-based issymmetric test for floating-point Symmetric matrices, even though they can also have NaN values.
julia> A = Symmetric(fill(NaN, 3,3))
3×3 Symmetric{Float64, Matrix{Float64}}:
NaN NaN NaN
NaN NaN NaN
NaN NaN NaN
julia> A == A'
false
julia> issymmetric(A)
true
Add functions that determine if all instances of a type
Tsatisfyissymmetric/ishermitianwithout having to check the values. In other words, the symmetry is known at compile time from the type.The main use case for this would be if we wish to have
Symmetric/Hermitianbroadcasting in the future, where we would want to generate the destination by checking if the arguments are all symmetric.