diff --git a/src/Kaczmarz.jl b/src/Kaczmarz.jl index 9303ca4..5f4a96f 100644 --- a/src/Kaczmarz.jl +++ b/src/Kaczmarz.jl @@ -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 diff --git a/test/testKaczmarz.jl b/test/testKaczmarz.jl index 18b4904..709f019 100644 --- a/test/testKaczmarz.jl +++ b/test/testKaczmarz.jl @@ -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