Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Kaczmarz.jl
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ function init!(solver::Kaczmarz, state::KaczmarzState{T, vecT}, b::vecT; x0 = 0)
if λ_ != λ_prev
# A must be unchanged, since we do not store the original SM
_, solver.denom, solver.rowindex = initkaczmarz(solver.A, λ_)
solver.rowIndexCycle = collect(1:length(rowindex))
solver.rowIndexCycle = collect(1:length(solver.rowindex))
if solver.randomized
solver.probabilities = T.(rowProbabilities(solver.A, rowindex))
solver.probabilities = T.(rowProbabilities(solver.A, solver.rowindex))
end
end

Expand Down
9 changes: 9 additions & 0 deletions test/testKaczmarz.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ Random.seed!(12345)
x_approx = Array(solve!(S, arrayType(b)))
@test norm(x - x_approx) / norm(x) ≈ 0 atol = 0.1
end

# Normalization
for strategy in [SystemMatrixBasedNormalization(), MeasurementBasedNormalization()]
l2 = L2Regularization(0.1)
S = createLinearSolver(solver, arrayType(A), iterations=200, randomized=true, reg = l2, normalizeReg = strategy)
x_approx = Array(solve!(S, arrayType(b)))
@test norm(x - x_approx) / norm(x) ≈ 0 atol = 0.1
end

end
end
end
Expand Down
Loading