Skip to content

Commit

Permalink
More tests for throwing in triangular matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt committed Jun 2, 2015
1 parent 44b703e commit 7546101
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
9 changes: 8 additions & 1 deletion test/linalg/triangular.jl
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,14 @@ for elty1 in (Float32, Float64, Complex64, Complex128, BigFloat, Int)
@test_approx_eq full(A1*A2') full(A1)*full(A2)'
@test_approx_eq full(A1'A2') full(A1)'full(A2)'
@test_approx_eq full(A1/A2) full(A1)/full(A2)

if elty2 != BigFloat
@test_throws DimensionMismatch eye(n+1)/A2
@test_throws DimensionMismatch eye(n+1)/A2'
@test_throws DimensionMismatch eye(n+1)*A2
@test_throws DimensionMismatch eye(n+1)*A2'
@test_throws DimensionMismatch A2'*eye(n+1)
@test_throws DimensionMismatch A2*eye(n+1)
end
end
end

Expand Down
7 changes: 6 additions & 1 deletion test/linalg2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
debug = false

import Base.LinAlg
import Base.LinAlg: BlasComplex, BlasFloat, BlasReal
import Base.LinAlg: BlasComplex, BlasFloat, BlasReal, UnitUpperTriangular, UnitLowerTriangular

# basic tridiagonal operations
n = 5
Expand Down Expand Up @@ -63,6 +63,11 @@ for elty in (Float32, Float64, Complex64, Complex128, Int)
@test_approx_eq x invFv
@test_approx_eq det(T) det(F)

@test_approx_eq T * UnitUpperTriangular(eye(n)) F*eye(n)
@test_approx_eq T * UnitLowerTriangular(eye(n)) F*eye(n)
@test_approx_eq T * UpperTriangular(eye(n)) F*eye(n)
@test_approx_eq T * LowerTriangular(eye(n)) F*eye(n)

# symmetric tridiagonal
if elty <: Real
Ts = SymTridiagonal(d, dl)
Expand Down

0 comments on commit 7546101

Please sign in to comment.