We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following behaviour I detected performing the function issymmetric on a symmetric matrix (thus preventing a correct test).
issymmetric
julia> C = Matrix(Hermitian(Complex{Double64}[1 0;0 1])) 2×2 Matrix{Complex{Double64}}: 1.0 + 0.0im 0.0 + 0.0im 0.0 - 0.0im 1.0 + 0.0im julia> ishermitian(C) true julia> Ce = [real(C) imag(C); -imag(C) real(C)] # construct a symmetric real matrix 4×4 Matrix{Double64}: 1.0 0.0 0.0 0.0 0.0 1.0 -0.0 0.0 -0.0 -0.0 1.0 0.0 0.0 -0.0 0.0 1.0 julia> issymmetric(Ce) # this test is in my opinion incorrect false julia> Ce == transpose(Ce) # the matrix is symmetric as expected true
The invalid test can be simply reproduced as shown bellow:
julia> y = -Double64(0) -0.0 julia> z = Double64(0) 0.0 julia> y === z false julia> y == z true julia> y != z true
The text was updated successfully, but these errors were encountered:
I wonder if replacing in compare.jl
compare.jl
@inline function (!=)(x::DoubleFloat{T}, y::DoubleFloat{T}) where {T<:IEEEFloat} return (LO(x) !== LO(y)) || (HI(x) !== HI(y) || posnegzeros(HI(x),HI(y))) end
with
@inline function (!=)(x::DoubleFloat{T}, y::DoubleFloat{T}) where {T<:IEEEFloat} return (LO(x) !== LO(y)) || (HI(x) !== HI(y) && !posnegzeros(HI(x),HI(y))) end
would fix the problem.
This corresponds to what is implemented in Base in operators.jl
Base
operators.jl
!=(x, y) = !(x == y)
An equivalent fix would be
@inline function (!=)(x::DoubleFloat{T}, y::DoubleFloat{T}) where {T<:IEEEFloat} return !(==)(x,y) end
Sorry, something went wrong.
No branches or pull requests
The following behaviour I detected performing the function
issymmetric
on a symmetric matrix (thus preventing a correct test).The invalid test can be simply reproduced as shown bellow:
The text was updated successfully, but these errors were encountered: