|
53 | 53 |
|
54 | 54 | const libblas = Base.libblas_name
|
55 | 55 |
|
56 |
| -import ..LinAlg: BlasFloat, BlasChar, BlasInt, blas_int, DimensionMismatch, chksquare, axpy! |
| 56 | +import ..LinAlg: BlasReal, BlasComplex, BlasFloat, BlasChar, BlasInt, blas_int, DimensionMismatch, chksquare, axpy! |
57 | 57 |
|
58 | 58 | # Level 1
|
59 | 59 | ## copy
|
@@ -154,17 +154,17 @@ for (fname, elty) in ((:cblas_zdotu_sub,:Complex128),
|
154 | 154 | end
|
155 | 155 | end
|
156 | 156 | end
|
157 |
| -function dot{T<:BlasFloat}(DX::StridedArray{T}, DY::StridedArray{T}) |
| 157 | +function dot{T<:BlasReal}(DX::StridedArray{T}, DY::StridedArray{T}) |
158 | 158 | n = length(DX)
|
159 | 159 | n == length(DY) || throw(DimensionMismatch("dot product arguments have lengths $(length(DX)) and $(length(DY))"))
|
160 | 160 | dot(n, DX, stride(DX, 1), DY, stride(DY, 1))
|
161 | 161 | end
|
162 |
| -function dotc{T<:BlasFloat}(DX::StridedArray{T}, DY::StridedArray{T}) |
| 162 | +function dotc{T<:BlasComplex}(DX::StridedArray{T}, DY::StridedArray{T}) |
163 | 163 | n = length(DX)
|
164 | 164 | n == length(DY) || throw(DimensionMismatch("dot product arguments have lengths $(length(DX)) and $(length(DY))"))
|
165 | 165 | dotc(n, DX, stride(DX, 1), DY, stride(DY, 1))
|
166 | 166 | end
|
167 |
| -function dotu{T<:BlasFloat}(DX::StridedArray{T}, DY::StridedArray{T}) |
| 167 | +function dotu{T<:BlasComplex}(DX::StridedArray{T}, DY::StridedArray{T}) |
168 | 168 | n = length(DX)
|
169 | 169 | n == length(DY) || throw(DimensionMismatch("dot product arguments have lengths $(length(DX)) and $(length(DY))"))
|
170 | 170 | dotu(n, DX, stride(DX, 1), DY, stride(DY, 1))
|
@@ -249,7 +249,6 @@ for (fname, elty) in ((:idamax_,:Float64),
|
249 | 249 | (:icamax_,:Complex64))
|
250 | 250 | @eval begin
|
251 | 251 | function iamax(n::BlasInt, dx::Union(StridedVector{$elty}, Ptr{$elty}), incx::BlasInt)
|
252 |
| - n*incx >= length(x) || throw(DimensionMismatch("")) |
253 | 252 | ccall(($(string(fname)), libblas),BlasInt,
|
254 | 253 | (Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}),
|
255 | 254 | &n, dx, &incx)
|
@@ -319,8 +318,9 @@ for (fname, elty) in ((:dgbmv_,:Float64),
|
319 | 318 | y
|
320 | 319 | end
|
321 | 320 | function gbmv(trans::BlasChar, m::Integer, kl::Integer, ku::Integer, alpha::($elty), A::StridedMatrix{$elty}, x::StridedVector{$elty})
|
322 |
| - n = stride(A,2) |
323 |
| - gbmv!(trans, m, kl, ku, alpha, A, x, zero($elty), similar(x, $elty, n)) |
| 321 | + n = size(A,2) |
| 322 | + leny = trans == 'N' ? m : n |
| 323 | + gbmv!(trans, m, kl, ku, alpha, A, x, zero($elty), similar(x, $elty, leny)) |
324 | 324 | end
|
325 | 325 | function gbmv(trans::BlasChar, m::Integer, kl::Integer, ku::Integer, A::StridedMatrix{$elty}, x::StridedVector{$elty})
|
326 | 326 | gbmv(trans, m, kl, ku, one($elty), A, x)
|
|
366 | 366 |
|
367 | 367 | ### hemv
|
368 | 368 | for (fname, elty) in ((:zhemv_,:Complex128),
|
369 |
| - (:cgemv_,:Complex64)) |
| 369 | + (:chemv_,:Complex64)) |
370 | 370 | @eval begin
|
371 | 371 | function hemv!(uplo::Char, α::$elty, A::StridedMatrix{$elty}, x::StridedVector{$elty}, β::$elty, y::StridedVector{$elty})
|
372 | 372 | n = size(A, 2)
|
|
0 commit comments