Skip to content

Commit

Permalink
scale! test fleshing out
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt committed Sep 12, 2015
1 parent e8d70a1 commit 57968c0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/linalg/triangular.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ for elty1 in (Float32, Float64, Complex64, Complex128, BigFloat, Int)

# scale
if (t1 == UpperTriangular || t1 == LowerTriangular)
unitt = istriu(A1) ? UnitUpperTriangular : UnitLowerTriangular
if elty1 == Int
cr = 2
else
Expand All @@ -146,10 +147,24 @@ for elty1 in (Float32, Float64, Complex64, Complex128, BigFloat, Int)
A1tmp = copy(A1)
scale!(A1tmp,cr)
@test A1tmp == cr*A1
A1tmp = copy(A1)
scale!(cr,A1tmp)
@test A1tmp == cr*A1
A1tmp = copy(A1)
A2tmp = unitt(A1)
scale!(A1tmp,A2tmp,cr)
@test A1tmp == cr * A2tmp
else
A1tmp = copy(A1)
scale!(A1tmp,ci)
@test A1tmp == ci*A1
A1tmp = copy(A1)
scale!(ci,A1tmp)
@test A1tmp == ci*A1
A1tmp = copy(A1)
A2tmp = unitt(A1)
scale!(A1tmp,A2tmp,ci)
@test A1tmp == ci * A2tmp
end
end

Expand Down

0 comments on commit 57968c0

Please sign in to comment.