Skip to content

Commit

Permalink
Test Symm/Herm and Triangular/RowVector ambiguities (#22727)
Browse files Browse the repository at this point in the history
* Test Symm/Herm and Triangular/RowVector ambiguities

* Remove Int restriction
  • Loading branch information
kshyatt authored and tkelman committed Jul 14, 2017
1 parent 02efe03 commit a22c402
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/linalg/symmetric.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,11 @@ end
# mat * vec
if eltya <: Complex
@test Hermitian(asym)*x+y asym*x+y
@test x' * Hermitian(asym) x' * asym
end
if eltya <: Real && eltya != Int
if eltya <: Real
@test Symmetric(asym)*x+y asym*x+y
@test x' * Symmetric(asym) x' * asym
end

C = zeros(eltya,n,n)
Expand All @@ -181,14 +183,19 @@ end
Base.LinAlg.A_mul_B!(C,a,Hermitian(asym))
@test C a*asym
end
if eltya <: Real && eltya != Int
if eltya <: Real
@test Symmetric(asym) * Symmetric(asym) asym*asym
@test Symmetric(asym) * a asym * a
@test a * Symmetric(asym) a * asym
@test_throws DimensionMismatch Symmetric(asym) * ones(eltya,n+1)
Base.LinAlg.A_mul_B!(C,a,Symmetric(asym))
@test C a*asym
end
tri_b = UpperTriangular(triu(rand(eltya, n, n)))
@test Array(Hermitian(asym).' * tri_b) asym.' * Array(tri_b)
@test Array(tri_b * Hermitian(asym).') Array(tri_b) * asym.'
@test Array(Hermitian(asym)' * tri_b) asym' * Array(tri_b)
@test Array(tri_b * Hermitian(asym)') Array(tri_b) * asym'

# solver
@test Hermitian(asym)\x asym\x
Expand Down

0 comments on commit a22c402

Please sign in to comment.