diff --git a/base/exports.jl b/base/exports.jl index 285134b6e5ac4..1bee26066a743 100644 --- a/base/exports.jl +++ b/base/exports.jl @@ -457,6 +457,7 @@ export airyprime, airyx, besselh, + besselhx, besseli, besselix, besselj, diff --git a/base/math.jl b/base/math.jl index 83f10939081cd..6a2d5b3d88dbe 100644 --- a/base/math.jl +++ b/base/math.jl @@ -18,7 +18,7 @@ export sin, cos, tan, sinh, cosh, tanh, asin, acos, atan, besselj0, besselj1, besselj, besseljx, bessely0, bessely1, bessely, besselyx, hankelh1, hankelh2, hankelh1x, hankelh2x, - besseli, besselix, besselk, besselkx, besselh, + besseli, besselix, besselk, besselkx, besselh, besselhx, beta, lbeta, eta, zeta, polygamma, invdigamma, digamma, trigamma, erfinv, erfcinv, @evalpoly diff --git a/test/linalg/symmetric.jl b/test/linalg/symmetric.jl index d3724b46c448c..7b5a37a798d94 100644 --- a/test/linalg/symmetric.jl +++ b/test/linalg/symmetric.jl @@ -91,7 +91,7 @@ let n=10 @test_approx_eq a * Hermitian(asym) a * asym @test_approx_eq Hermitian(asym) * Hermitian(asym) asym*asym @test_throws DimensionMismatch Hermitian(asym) * ones(eltya,n+1) - Base.LinAlg.A_mul_B!(C,a,asym) + Base.LinAlg.A_mul_B!(C,a,Hermitian(asym)) @test_approx_eq C a*asym end if eltya <: Real && eltya != Int @@ -99,7 +99,7 @@ let n=10 @test_approx_eq Symmetric(asym) * a asym * a @test_approx_eq a * Symmetric(asym) a * asym @test_throws DimensionMismatch Symmetric(asym) * ones(eltya,n+1) - Base.LinAlg.A_mul_B!(C,a,asym) + Base.LinAlg.A_mul_B!(C,a,Symmetric(asym)) @test_approx_eq C a*asym end diff --git a/test/linalg2.jl b/test/linalg2.jl index 4b08dd3ea6bb2..e84e184cf22e0 100644 --- a/test/linalg2.jl +++ b/test/linalg2.jl @@ -349,6 +349,9 @@ end @test UniformScaling(α)./α == UniformScaling(1.0) @test α + UniformScaling(1.0) == UniformScaling(1.0) + α @test α - UniformScaling(1.0) == -(UniformScaling(1.0) - α) +@test copy(UniformScaling(one(Float64))) == UniformScaling(one(Float64)) +@test sprint(show,UniformScaling(one(Float32))) == "Base.LinAlg.UniformScaling{Float32}\n1.0*I" + λ = complex(randn(),randn()) J = UniformScaling(λ) @test ndims(J) == 2 diff --git a/test/math.jl b/test/math.jl index d243096b5a608..2eba56556eceb 100644 --- a/test/math.jl +++ b/test/math.jl @@ -130,7 +130,6 @@ end @test erfcinv(one(Int)) == erfcinv(1.0) # airy -@test_approx_eq airy(1.8) 0.0470362168668458052247 @test_approx_eq airy(1.8) airyai(1.8) @test_approx_eq airyprime(1.8) -0.0685247801186109345638 @test_approx_eq airyaiprime(1.8) airyprime(1.8) @@ -140,12 +139,16 @@ end @test_throws Base.Math.AmosException airybi(200) @test_throws ArgumentError airy(5,one(Complex128)) z = 1.8 + 1.0im -@test_approx_eq airyx(z) airyx(0,z) -@test_approx_eq airyx(0, z) airy(0, z) * exp(2/3 * z * sqrt(z)) -@test_approx_eq airyx(1, z) airy(1, z) * exp(2/3 * z * sqrt(z)) -@test_approx_eq airyx(2, z) airy(2, z) * exp(-abs(real(2/3 * z * sqrt(z)))) -@test_approx_eq airyx(3, z) airy(3, z) * exp(-abs(real(2/3 * z * sqrt(z)))) -@test_throws ArgumentError airyx(5,z) +for elty in [Complex64,Complex128] + @test_approx_eq airy(convert(elty,1.8)) 0.0470362168668458052247 + z = convert(elty,z) + @test_approx_eq airyx(z) airyx(0,z) + @test_approx_eq airyx(0, z) airy(0, z) * exp(2/3 * z * sqrt(z)) + @test_approx_eq airyx(1, z) airy(1, z) * exp(2/3 * z * sqrt(z)) + @test_approx_eq airyx(2, z) airy(2, z) * exp(-abs(real(2/3 * z * sqrt(z)))) + @test_approx_eq airyx(3, z) airy(3, z) * exp(-abs(real(2/3 * z * sqrt(z)))) + @test_throws ArgumentError airyx(5,z) +end # bessely0, bessely1, besselj0, besselj1 @test_approx_eq besselj0(Float32(2.0)) besselj0(Float64(2.0)) @@ -206,6 +209,7 @@ j43 = besselj(4,3.) @test_approx_eq besselj(0.1, complex(-0.4)) 0.820421842809028916 + 0.266571215948350899im @test_approx_eq besselj(3.2, 1.3+0.6im) 0.01135309305831220201 + 0.03927719044393515275im @test_approx_eq besselj(1, 3im) 3.953370217402609396im +@test_approx_eq besselj(1.0,3im) besselj(1,3im) @test_throws Base.Math.AmosException besselj(20,1000im) # besselk @@ -234,6 +238,12 @@ y33 = bessely(3,3.) @test_throws DomainError bessely(0.4,Float32(-1.0)) @test_throws DomainError bessely(1,Float32(-1.0)) +#besselhx +for elty in [Complex64,Complex128] + z = convert(elty, 1.0 + 1.9im) + @test_approx_eq besselhx(1.0, 1, z) convert(elty,-0.5949634147786144 - 0.18451272807835967im) +end + # issue #6653 for f in (besselj,bessely,besseli,besselk,hankelh1,hankelh2) @test_approx_eq f(0,1) f(0,Complex128(1))