Skip to content

Commit

Permalink
Remove weight-scaled b, simplify denom, use weight in dot with matrix…
Browse files Browse the repository at this point in the history
… row
  • Loading branch information
nHackel committed Feb 19, 2024
1 parent cc8adc2 commit e79c600
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Kaczmarz.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ function init!(solver::Kaczmarz, b; x0 = 0)
solver.vl .= 0

weights = solverweights(solver)
solver.u .= b ./(weights)
solver.u .= b
for (i, weight) = enumerate(weights[solver.rowindex])
solver.ɛw[i] = sqrt(λ_) / weight
solver.ɛw[i] = sqrt(λ_)
end
end

Expand Down Expand Up @@ -174,7 +174,6 @@ function iterate(solver::Kaczmarz, iteration::Int=0)
end

iterate_row_index(solver::Kaczmarz, A::AbstractLinearSolver, row, index) = iterate_row_index(solver, Matrix(A[row, :]), row, index)
iterate_row_index(solver::Kaczmarz, A::ProdOp{T, <:WeightingOp, matT}, row, index) where {T, matT} = iterate_row_index(solver, A.B, row, index)
function iterate_row_index(solver::Kaczmarz, A, row, index)
solver.τl = dot_with_matrix_row(A,solver.x,row)
solver.αl = solver.denom[index]*(solver.u[row]-solver.τl-solver.ɛw[index]*solver.vl[row])
Expand Down Expand Up @@ -221,7 +220,7 @@ function initkaczmarz(A,λ)
for (i, weight) in enumerate(weights)
= rownorm²(A,i)*weight^2
if>0
push!(denom,1/(s²+/weight^2)))
push!(denom,1/(s²+λ))
push!(rowindex,i)
end
end
Expand Down

0 comments on commit e79c600

Please sign in to comment.