Skip to content

Commit 39363bb

Browse files
authored
Merge pull request #261 from jbmuir/fiveargmul
2 parents 1824c69 + f3b6190 commit 39363bb

File tree

7 files changed

+11
-14
lines changed

7 files changed

+11
-14
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
matrix:
2020
version:
2121
- '1'
22-
- '1.5'
22+
- '1.3'
2323
# - 'nightly'
2424
os:
2525
- ubuntu-latest

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1111

1212
[compat]
1313
RecipesBase = "0.6, 0.7, 0.8, 1.0"
14-
julia = "1"
14+
julia = "1.3"

src/bicgstabl.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,9 @@ function iterate(it::BiCGStabIterable, iteration::Int=start(it))
130130
F = lu!(view(it.M, L, L))
131131
ldiv!(it.γ, F, view(it.M, L, 1))
132132

133-
# This could even be BLAS 3 when combined.
134-
BLAS.gemv!('N', -one(T), view(it.us, :, L), it.γ, one(T), view(it.us, :, 1))
135-
BLAS.gemv!('N', one(T), view(it.rs, :, 1 : it.l), it.γ, one(T), it.x)
136-
BLAS.gemv!('N', -one(T), view(it.rs, :, L), it.γ, one(T), view(it.rs, :, 1))
133+
mul!(view(it.us, :, 1), view(it.us, :, L), it.γ, -one(T), one(T))
134+
mul!(it.x, view(it.rs, :, 1 : it.l), it.γ, one(T), one(T))
135+
mul!(view(it.rs, :, 1), view(it.rs, :, L), it.γ, -one(T), one(T))
137136

138137
it.ω = it.γ[it.l]
139138
it.residual = norm(view(it.rs, :, 1))

src/gmres.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,7 @@ end
278278

279279
function update_solution!(x, y, arnoldi::ArnoldiDecomp{T}, Pr::Identity, k::Int, Ax) where {T}
280280
# Update x ← x + V * y
281-
282-
# TODO: find the SugarBLAS alternative
283-
BLAS.gemv!('N', one(T), view(arnoldi.V, :, 1 : k - 1), y, one(T), x)
281+
mul!(x, view(arnoldi.V, :, 1 : k - 1), y, one(T), one(T))
284282
end
285283

286284
function update_solution!(x, y, arnoldi::ArnoldiDecomp{T}, Pr, k::Int, Ax) where {T}

src/minres.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export minres_iterable, minres, minres!
22
using Printf
3-
import LinearAlgebra: BLAS.axpy!, givensAlgorithm
3+
import LinearAlgebra: axpy!, givensAlgorithm
44
import Base: iterate
55

66
mutable struct MINRESIterable{matT, solT, vecT <: DenseVector, smallVecT <: DenseVector, rotT <: Number, realT <: Real}

src/orthogonalize.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ struct ModifiedGramSchmidt <: OrthogonalizationMethod end
1212
function orthogonalize_and_normalize!(V::StridedMatrix{T}, w::StridedVector{T}, h::StridedVector{T}, ::Type{DGKS}) where {T}
1313
# Orthogonalize using BLAS-2 ops
1414
mul!(h, adjoint(V), w)
15-
BLAS.gemv!('N', -one(T), V, h, one(T), w)
15+
mul!(w, V, h, -one(T), one(T))
1616
nrm = norm(w)
1717

1818
# Constant used by ARPACK.
@@ -26,7 +26,7 @@ function orthogonalize_and_normalize!(V::StridedMatrix{T}, w::StridedVector{T},
2626
correction = adjoint(V)*w
2727
projection_size = norm(correction)
2828
# w = w - V * correction
29-
BLAS.gemv!('N', -one(T), V, correction, one(T), w)
29+
mul!(w, V, correction, -one(T), one(T))
3030
h .+= correction
3131
nrm = norm(w)
3232
end
@@ -40,7 +40,7 @@ end
4040
function orthogonalize_and_normalize!(V::StridedMatrix{T}, w::StridedVector{T}, h::StridedVector{T}, ::Type{ClassicalGramSchmidt}) where {T}
4141
# Orthogonalize using BLAS-2 ops
4242
mul!(h, adjoint(V), w)
43-
BLAS.gemv!('N', -one(T), V, h, one(T), w)
43+
mul!(w, V, h, -one(T), one(T))
4444
nrm = norm(w)
4545

4646
# Normalize

src/simple.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function iterate(p::PowerMethodIterable, iteration::Int=start(p))
3535

3636
# (Previous) residual vector r = Ax - λx
3737
copyto!(p.r, p.Ax)
38-
BLAS.axpy!(-p.θ, p.x, p.r)
38+
axpy!(-p.θ, p.x, p.r)
3939

4040
# Normed residual
4141
p.residual = norm(p.r)

0 commit comments

Comments
 (0)