|
5 | 5 | ## BLAS cutoff threshold constants |
6 | 6 |
|
7 | 7 | const SCAL_CUTOFF = 2048 |
8 | | -const DOT_CUTOFF = 128 |
| 8 | +#TODO const DOT_CUTOFF = 128 |
9 | 9 | const ASUM_CUTOFF = 32 |
10 | 10 | const NRM2_CUTOFF = 32 |
11 | 11 |
|
@@ -137,11 +137,11 @@ function norm(x::StridedVector{T}, rx::Union{UnitRange{TI},AbstractRange{TI}}) w |
137 | 137 | GC.@preserve x BLAS.nrm2(length(rx), pointer(x)+(first(rx)-1)*sizeof(T), step(rx)) |
138 | 138 | end |
139 | 139 |
|
140 | | -vecnorm1(x::Union{Array{T},StridedVector{T}}) where {T<:BlasReal} = |
141 | | - length(x) < ASUM_CUTOFF ? generic_vecnorm1(x) : BLAS.asum(x) |
| 140 | +norm1(x::Union{Array{T},StridedVector{T}}) where {T<:BlasReal} = |
| 141 | + length(x) < ASUM_CUTOFF ? generic_norm1(x) : BLAS.asum(x) |
142 | 142 |
|
143 | | -vecnorm2(x::Union{Array{T},StridedVector{T}}) where {T<:BlasFloat} = |
144 | | - length(x) < NRM2_CUTOFF ? generic_vecnorm2(x) : BLAS.nrm2(x) |
| 143 | +norm2(x::Union{Array{T},StridedVector{T}}) where {T<:BlasFloat} = |
| 144 | + length(x) < NRM2_CUTOFF ? generic_norm2(x) : BLAS.nrm2(x) |
145 | 145 |
|
146 | 146 | """ |
147 | 147 | triu!(M, k::Integer) |
@@ -509,7 +509,7 @@ function exp!(A::StridedMatrix{T}) where T<:BlasFloat |
509 | 509 | return copytri!(parent(exp(Hermitian(A))), 'U', true) |
510 | 510 | end |
511 | 511 | ilo, ihi, scale = LAPACK.gebal!('B', A) # modifies A |
512 | | - nA = norm(A, 1) |
| 512 | + nA = opnorm(A, 1) |
513 | 513 | Inn = Matrix{T}(I, n, n) |
514 | 514 | ## For sufficiently small nA, use lower order Padé-Approximations |
515 | 515 | if (nA <= 2.1) |
@@ -1370,8 +1370,8 @@ function cond(A::AbstractMatrix, p::Real=2) |
1370 | 1370 | end |
1371 | 1371 | throw(ArgumentError("p-norm must be 1, 2 or Inf, got $p")) |
1372 | 1372 | end |
1373 | | -_cond1Inf(A::StridedMatrix{<:BlasFloat}, p::Real) = _cond1Inf(lu(A), p, norm(A, p)) |
1374 | | -_cond1Inf(A::AbstractMatrix, p::Real) = norm(A, p)*norm(inv(A), p) |
| 1373 | +_cond1Inf(A::StridedMatrix{<:BlasFloat}, p::Real) = _cond1Inf(lu(A), p, opnorm(A, p)) |
| 1374 | +_cond1Inf(A::AbstractMatrix, p::Real) = opnorm(A, p)*opnorm(inv(A), p) |
1375 | 1375 |
|
1376 | 1376 | ## Lyapunov and Sylvester equation |
1377 | 1377 |
|
|
0 commit comments