From add6f7fd0f33e8d5c0612f7d4191f7955ac5c9b8 Mon Sep 17 00:00:00 2001 From: Andreas Noack Date: Fri, 16 Jun 2017 11:41:48 -0400 Subject: [PATCH] Revert "Fix a few naming conflicts in LinAlg/BLAS. Fixes #14268." (#22374) * Revert "Fix a few naming conflicts in LinAlg/BLAS. Fixes #14268." This reverts commit befbcecbdd20b7dbd3544571d394bd7c3125c0ee. * Add test to make sure that dot(Matrix,Matrix) throws for all types --- base/linalg/blas.jl | 4 +++- base/linalg/linalg.jl | 1 - test/linalg/matmul.jl | 11 ++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/base/linalg/blas.jl b/base/linalg/blas.jl index 9e1ab6f53d46c..eb2e5468ff392 100644 --- a/base/linalg/blas.jl +++ b/base/linalg/blas.jl @@ -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!, diff --git a/base/linalg/linalg.jl b/base/linalg/linalg.jl index ffc97a3dd78c4..41dcbdd465bd0 100644 --- a/base/linalg/linalg.jl +++ b/base/linalg/linalg.jl @@ -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") diff --git a/test/linalg/matmul.jl b/test/linalg/matmul.jl index c97f69d224212..ea9a81820f0b7 100644 --- a/test/linalg/matmul.jl +++ b/test/linalg/matmul.jl @@ -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