Skip to content

Commit

Permalink
Changed the test for symmetry of a Number. (#18529)
Browse files Browse the repository at this point in the history
* Changed the test for symmetry of a Number.

* added tests for issymmetric with NaN16, NaN32, and NaN as arguments
  • Loading branch information
mcognetta authored and andreasnoack committed Sep 18, 2016
1 parent 45bc17d commit a648f4a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/linalg/generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ function issymmetric(A::AbstractMatrix)
return true
end

issymmetric(x::Number) = true
issymmetric(x::Number) = x == x

"""
ishermitian(A) -> Bool
Expand Down
4 changes: 4 additions & 0 deletions test/linalg/generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ for elty in [Float32,Float64,Complex64,Complex128]
@test det(a) == a
end

@test !issymmetric(NaN16)
@test !issymmetric(NaN32)
@test !issymmetric(NaN)

@test rank([1.0 0.0; 0.0 0.9],0.95) == 1
@test qr(big([0 1; 0 0]))[2] == [0 1; 0 0]

Expand Down

0 comments on commit a648f4a

Please sign in to comment.