Skip to content

Commit

Permalink
Misc tests for generic
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt committed Sep 12, 2015
1 parent 57968c0 commit 27b0a6e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/linalg/generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,17 @@ y = ['a','b','c','d','e']
α = 'f'
@test_throws DimensionMismatch Base.LinAlg.axpy!(α,x,['g'])
@test_throws BoundsError Base.LinAlg.axpy!(α,x,collect(-1:5),y,collect(1:7))
@test_throws BoundsError Base.LinAlg.axpy!(α,x,collect(1:7),y,collect(-1:5))
@test_throws ArgumentError Base.LinAlg.axpy!(α,x,collect(1:3),y,collect(1:5))
@test_throws BoundsError Base.LinAlg.axpy!(α,x,collect(1:7),y,collect(1:7))
@test_throws DimensionMismatch Base.LinAlg.axpy!(α,x,collect(1:2),['a','b'],collect(1:2))

@test_throws ArgumentError diag(rand(10))
@test !issym(ones(5,3))
@test !ishermitian(ones(5,3))
@test cross(ones(3),ones(3)) == zeros(3)


@test trace(Bidiagonal(ones(5),zeros(4),true)) == 5

# 2-argument version of scale
a = reshape([1.:6;], (2,3))
Expand Down Expand Up @@ -116,6 +123,7 @@ for elty in [Float32,Float64,Complex64,Complex128]
@test rank(one(elty)) == 1
@test !isfinite(cond(zero(elty)))
@test cond(a) == one(elty)
@test cond(a,1) == one(elty)
@test issym(a)
@test ishermitian(one(elty))
@test det(a) == a
Expand All @@ -125,6 +133,7 @@ end

@test norm([2.4e-322, 4.4e-323]) 2.47e-322
@test norm([2.4e-322, 4.4e-323], 3) 2.4e-322
@test_throws ArgumentError norm(ones(5,5),5)

# test generic vecnorm for arrays of arrays
let x = Vector{Int}[[1,2], [3,4]]
Expand Down

0 comments on commit 27b0a6e

Please sign in to comment.