Skip to content

Commit a346c40

Browse files
committed
Remove the kaxis function
1 parent f00e46b commit a346c40

File tree

6 files changed

+6
-23
lines changed

6 files changed

+6
-23
lines changed

docs/src/reference.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Krylov.FloatOrComplex
1111
Krylov.niterations
1212
Krylov.Aprod
1313
Krylov.Atprod
14-
Krylov.kaxis
1514
Krylov.kaxes
1615
Base.show
1716
```

src/fgmres.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ function fgmres!(solver :: FgmresSolver{T,FC,S}, A, b :: AbstractVector{FC};
111111
callback = solver -> false, iostream :: IO=kstdout) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}}
112112

113113
m, n = size(A)
114-
ixn = kaxis(solver.x)
115114
m == n || error("System must be square")
116115
length(b) == m || error("Inconsistent problem size")
117116
(verbose > 0) && @printf(iostream, "FGMRES: system of size %d\n", n)
@@ -229,7 +228,7 @@ function fgmres!(solver :: FgmresSolver{T,FC,S}, A, b :: AbstractVector{FC};
229228
end
230229
push!(s, zero(FC))
231230
push!(c, zero(T))
232-
push!(Z, similar(S, ixn))
231+
push!(Z, similar(x))
233232
end
234233

235234
# Continue the process.
@@ -296,7 +295,7 @@ function fgmres!(solver :: FgmresSolver{T,FC,S}, A, b :: AbstractVector{FC};
296295
# Compute vₖ₊₁
297296
if !(solved || inner_tired || breakdown)
298297
if !restart && (inner_iter mem)
299-
push!(V, S(undef, n))
298+
push!(V, similar(x))
300299
push!(z, zero(FC))
301300
end
302301
@. V[inner_iter+1] = q / Hbis # hₖ₊₁.ₖvₖ₊₁ = q

src/fom.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ function fom!(solver :: FomSolver{T,FC,S}, A, b :: AbstractVector{FC};
104104
callback = solver -> false, iostream :: IO=kstdout) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}}
105105

106106
m, n = size(A)
107-
ixn = kaxis(solver.x)
108107
m == n || error("System must be square")
109108
length(b) == m || error("Inconsistent problem size")
110109
(verbose > 0) && @printf(iostream, "FOM: system of size %d\n", n)
@@ -279,7 +278,7 @@ function fom!(solver :: FomSolver{T,FC,S}, A, b :: AbstractVector{FC};
279278
# Compute vₖ₊₁.
280279
if !(solved || inner_tired || breakdown)
281280
if !restart && (inner_iter mem)
282-
push!(V, similar(S, ixn))
281+
push!(V, similar(x))
283282
end
284283
@. V[inner_iter+1] = q / Hbis # hₖ₊₁.ₖvₖ₊₁ = q
285284
end

src/gmres.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ function gmres!(solver :: GmresSolver{T,FC,S}, A, b :: AbstractVector{FC};
104104
callback = solver -> false, iostream :: IO=kstdout) where {T <: AbstractFloat, FC <: FloatOrComplex{T}, S <: AbstractVector{FC}}
105105

106106
m, n = size(A)
107-
ixn = kaxis(solver.x)
108107
m == n || error("System must be square")
109108
length(b) == m || error("Inconsistent problem size")
110109
(verbose > 0) && @printf(iostream, "GMRES: system of size %d\n", n)
@@ -289,7 +288,7 @@ function gmres!(solver :: GmresSolver{T,FC,S}, A, b :: AbstractVector{FC};
289288
# Compute vₖ₊₁
290289
if !(solved || inner_tired || breakdown)
291290
if !restart && (inner_iter mem)
292-
push!(V, similar(S, ixn))
291+
push!(V, similar(x))
293292
push!(z, zero(FC))
294293
end
295294
@. V[inner_iter+1] = q / Hbis # hₖ₊₁.ₖvₖ₊₁ = q

src/gpmr.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ function gpmr!(solver :: GpmrSolver{T,FC,S}, A, B, b :: AbstractVector{FC}, c ::
144144

145145
m, n = size(A)
146146
s, t = size(B)
147-
ixm = kaxis(solver.x)
148-
ixn = kaxis(solver.y)
149147
m == t || error("Inconsistent problem size")
150148
s == n || error("Inconsistent problem size")
151149
length(b) == m || error("Inconsistent problem size")
@@ -437,8 +435,8 @@ function gpmr!(solver :: GpmrSolver{T,FC,S}, A, B, b :: AbstractVector{FC}, c ::
437435
# Compute vₖ₊₁ and uₖ₊₁
438436
if !(solved || tired || breakdown || user_requested_exit)
439437
if iter mem
440-
push!(V, similar(S, ixm))
441-
push!(U, similar(S, ixn))
438+
push!(V, similar(x))
439+
push!(U, similar(y))
442440
push!(zt, zero(FC), zero(FC))
443441
end
444442

src/krylov_utils.jl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -198,17 +198,6 @@ function vec2str(x :: AbstractVector{T}; ndisp :: Int=7) where T <: Union{Abstra
198198
return s
199199
end
200200

201-
"""
202-
ixm = kaxis(b)
203-
204-
Return the length of `b` if `b` is a `DenseVector`.
205-
Otherwise, it returns the axis of `b` along the first dimension.
206-
"""
207-
function kaxis end
208-
209-
kaxis(v::S) where S <: DenseVector = length(v)
210-
kaxis(v::S) where S <: AbstractVector = axes(v, 1)
211-
212201
"""
213202
ixm, ixn = kaxes(S, A)
214203

0 commit comments

Comments
 (0)