Skip to content

Commit

Permalink
Merge pull request JuliaLang#13585 from JuliaLang/anj/importall
Browse files Browse the repository at this point in the history
A few missing imports in LinAlg and DataFmt
  • Loading branch information
mbauman committed Oct 14, 2015
2 parents 6e4c9f1 + cd37f1b commit 03f28fd
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion base/datafmt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module DataFmt

import Base: _default_delims, tryparse_internal
import Base: _default_delims, tryparse_internal, writemime

export countlines, readdlm, readcsv, writedlm, writecsv

Expand Down
5 changes: 3 additions & 2 deletions base/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import Base: A_mul_Bt, At_ldiv_Bt, A_rdiv_Bc, At_ldiv_B, Ac_mul_Bc, A_mul_Bc, Ac
Ac_ldiv_B, Ac_ldiv_Bc, At_mul_Bt, A_rdiv_Bt, At_mul_B
import Base: USE_BLAS64, abs, big, ceil, conj, convert, copy, copy!, copy_transpose!,
ctranspose, ctranspose!, eltype, eye, findmax, findmin, fill!, floor, full, getindex,
imag, inv, isapprox, kron, ndims, power_by_squaring, print_matrix, real, setindex!,
show, similar, size, transpose, transpose!, unsafe_getindex, unsafe_setindex!
imag, inv, isapprox, kron, ndims, power_by_squaring, print_matrix, promote_rule, real,
round, setindex!, show, similar, size, transpose, transpose!, trunc, unsafe_getindex,
unsafe_setindex!

export
# Modules
Expand Down
5 changes: 5 additions & 0 deletions test/linalg/bidiag.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,13 @@ for relty in (Float32, Float64, BigFloat), elty in (relty, Complex{relty})
debug && println("Round,float,trunc,ceil")
if elty <: BlasReal
@test floor(Int,T) == Bidiagonal(floor(Int,T.dv),floor(Int,T.ev),T.isupper)
@test isa(floor(Int,T), Bidiagonal)
@test trunc(Int,T) == Bidiagonal(trunc(Int,T.dv),trunc(Int,T.ev),T.isupper)
@test isa(trunc(Int,T), Bidiagonal)
@test round(Int,T) == Bidiagonal(round(Int,T.dv),round(Int,T.ev),T.isupper)
@test isa(round(Int,T), Bidiagonal)
@test ceil(Int,T) == Bidiagonal(ceil(Int,T.dv),ceil(Int,T.ev),T.isupper)
@test isa(ceil(Int,T), Bidiagonal)
end

debug && println("Generic Mat-vec ops")
Expand Down Expand Up @@ -184,5 +188,6 @@ end
A = Bidiagonal(ones(Float32,10),ones(Float32,9),true)
B = rand(Float64,10,10)
C = Tridiagonal(rand(Float64,9),rand(Float64,10),rand(Float64,9))
@test promote_rule(Matrix{Float64}, Bidiagonal{Float64}) == Matrix{Float64}
@test promote(B,A) == (B,convert(Matrix{Float64},full(A)))
@test promote(C,A) == (C,Tridiagonal(zeros(Float64,9),convert(Vector{Float64},A.dv),convert(Vector{Float64},A.ev)))
8 changes: 8 additions & 0 deletions test/linalg/tridiag.jl
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,13 @@ let n = 12 #Size of matrix problem to test
debug && println("Rounding to Ints")
if elty <: Real
@test round(Int,A) == round(Int,fA)
@test isa(round(Int,A), SymTridiagonal)
@test trunc(Int,A) == trunc(Int,fA)
@test isa(trunc(Int,A), SymTridiagonal)
@test ceil(Int,A) == ceil(Int,fA)
@test isa(ceil(Int,A), SymTridiagonal)
@test floor(Int,A) == floor(Int,fA)
@test isa(floor(Int,A), SymTridiagonal)
end

debug && println("Tridiagonal/SymTridiagonal mixing ops")
Expand Down Expand Up @@ -341,9 +345,13 @@ let n = 12 #Size of matrix problem to test
debug && println("Rounding to Ints")
if elty <: Real
@test round(Int,A) == round(Int,fA)
@test isa(round(Int,A), Tridiagonal)
@test trunc(Int,A) == trunc(Int,fA)
@test isa(trunc(Int,A), Tridiagonal)
@test ceil(Int,A) == ceil(Int,fA)
@test isa(ceil(Int,A), Tridiagonal)
@test floor(Int,A) == floor(Int,fA)
@test isa(floor(Int,A), Tridiagonal)
end

debug && println("Binary operations")
Expand Down
4 changes: 4 additions & 0 deletions test/readdlm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,7 @@ end
let data = "1 2 3"
readdlm(IOBuffer(data), ' ', BigInt) == BigInt[1 2 3]
end

# test writemime
@test sprint(io -> writemime(io, "text/csv", [1 2; 3 4])) == "1,2\n3,4\n"

0 comments on commit 03f28fd

Please sign in to comment.