Skip to content

Commit

Permalink
Revert "Fix a few naming conflicts in LinAlg/BLAS. Fixes #14268." (#2…
Browse files Browse the repository at this point in the history
…2374)

* Revert "Fix a few naming conflicts in LinAlg/BLAS. Fixes #14268."

This reverts commit befbcec.

* Add test to make sure that dot(Matrix,Matrix) throws for all types
  • Loading branch information
andreasnoack authored and quinnj committed Jun 19, 2017
1 parent df13186 commit add6f7f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion base/linalg/blas.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

module BLAS

import ..axpy!
import Base: copy!
import Base.LinAlg: axpy!, dot

export
# Level 1
asum,
axpy!,
blascopy!,
dot,
dotc,
dotu,
scal!,
Expand Down
1 change: 0 additions & 1 deletion base/linalg/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ include("exceptions.jl")
include("generic.jl")

include("blas.jl")
import .BLAS: gemv! # consider renaming gemv! in matmul
include("matmul.jl")
include("lapack.jl")

Expand Down
11 changes: 6 additions & 5 deletions test/linalg/matmul.jl
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,15 @@ end
# issue #6450
@test dot(Any[1.0,2.0], Any[3.5,4.5]) === 12.5

for elty in (Float32,Float64,Complex64,Complex128)
x = convert(Vector{elty},[1.0,2.0,3.0])
y = convert(Vector{elty},[3.5,4.5,5.5])
@testset "dot" for elty in (Float32, Float64, Complex64, Complex128)
x = convert(Vector{elty},[1.0, 2.0, 3.0])
y = convert(Vector{elty},[3.5, 4.5, 5.5])
@test_throws DimensionMismatch dot(x, 1:2, y, 1:3)
@test_throws BoundsError dot(x, 1:4, y, 1:4)
@test_throws BoundsError dot(x, 1:3, y, 2:4)
@test dot(x,1:2,y,1:2) == convert(elty,12.5)
@test x.'*y == convert(elty,29.0)
@test dot(x, 1:2,y, 1:2) == convert(elty, 12.5)
@test x.'*y == convert(elty, 29.0)
@test_throws MethodError dot(rand(elty, 2, 2), randn(elty, 2, 2))
end

vecdot_(x,y) = invoke(vecdot, Tuple{Any,Any}, x,y) # generic vecdot
Expand Down

0 comments on commit add6f7f

Please sign in to comment.