@@ -27,22 +27,18 @@ isposdef{T}(A::AbstractMatrix{T}, UL::Symbol) = (S = typeof(sqrt(one(T))); ispos
27
27
isposdef {T} (A:: AbstractMatrix{T} ) = (S = typeof (sqrt (one (T))); isposdef! (S == T ? copy (A) : convert (AbstractMatrix{S}, A)))
28
28
isposdef (x:: Number ) = imag (x)== 0 && real (x) > 0
29
29
30
-
31
- Base. sumabs {T<:BlasFloat} (x:: Union(Array{T},StridedVector{T}) ) =
32
- length (x) > 32 ? BLAS. asum (x) : Base. _sumabs (x)
33
-
34
30
stride1 (x:: Array ) = 1
35
31
stride1 (x:: StridedVector ) = stride (x, 1 ):: Int
36
32
37
- function Base. sumabs2 {T<:BlasFloat} (x :: Union( Array{T},StridedVector{T}) )
38
- n = length (x )
39
- if n < DOT_CUTOFF
40
- return Base . _sumabs2 (x)
41
- else
42
- px = pointer (x )
43
- incx = stride1 (x )
44
- return BLAS . dot (n, px, incx, px, incx)
45
- end
33
+ Base. sum_seq {T<:BlasFloat} (:: Base.AbsFun , a :: Array{T} , ifirst :: Int , ilast :: Int ) =
34
+ BLAS . asum (ilast - ifirst + 1 , pointer (a, ifirst), stride1 (a) )
35
+
36
+ # This appears to show a benefit from a larger block size
37
+ Base . sum_pairwise_blocksize ( :: Base.Abs2Fun ) = 4096
38
+ function Base . sum_seq {T<:BlasFloat} ( :: Base.Abs2Fun , a :: Array{T} , ifirst :: Int , ilast :: Int )
39
+ px = pointer (a, ifirst )
40
+ incx = stride1 (a)
41
+ BLAS . dot (ilast - ifirst + 1 , px, incx, px, incx)
46
42
end
47
43
48
44
function norm {T<:BlasFloat, TI<:Integer} (x:: StridedVector{T} , rx:: Union(UnitRange{TI},Range{TI}) )
0 commit comments