Skip to content

Commit

Permalink
Test scale b with weights for Kaczmarz
Browse files Browse the repository at this point in the history
  • Loading branch information
nHackel committed Feb 16, 2024
1 parent d1bb9b3 commit cc8adc2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Kaczmarz.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ function init!(solver::Kaczmarz, b; x0 = 0)
if solver.shuffleRows
shuffle!(solver.rowIndexCycle)
end
solver.u .= b

# start vector
solver.x .= x0
solver.vl .= 0

weights = solverweights(solver)
solver.u .= b ./(weights)
for (i, weight) = enumerate(weights[solver.rowindex])
solver.ɛw[i] = sqrt(λ_) / weight
end
Expand Down Expand Up @@ -174,6 +174,7 @@ 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 @@ -220,7 +221,7 @@ function initkaczmarz(A,λ)
for (i, weight) in enumerate(weights)
= rownorm²(A,i)*weight^2
if>0
push!(denom,1/(s²+/weight)))
push!(denom,1/(s²+/weight^2)))
push!(rowindex,i)
end
end
Expand Down

0 comments on commit cc8adc2

Please sign in to comment.