From 2394eccb7e7ef4ea23e66d213820395605446a34 Mon Sep 17 00:00:00 2001 From: jonschumacher Date: Mon, 29 Apr 2024 17:20:00 +0200 Subject: [PATCH] Re-add weights --- src/LeastSquares.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/LeastSquares.jl b/src/LeastSquares.jl index 2a31d4a..f7150f0 100644 --- a/src/LeastSquares.jl +++ b/src/LeastSquares.jl @@ -3,12 +3,13 @@ export LeastSquaresParameters abstract type AbstractSolverParameters <: AbstractMPIRecoParameters end export LeastSquaresParameters -Base.@kwdef struct LeastSquaresParameters{L<:AbstractLinearSolver, O, M, R<:AbstractRegularization, P<:AbstractSolverParameters} <: AbstractMPIRecoParameters +Base.@kwdef struct LeastSquaresParameters{L<:AbstractLinearSolver, O, M, R<:AbstractRegularization, P<:AbstractSolverParameters, W} <: AbstractMPIRecoParameters solver::Type{L} = Kaczmarz op::O = nothing S::M reg::Vector{R} solverParams::P + weights::W = nothing end # TODO place weights and more @@ -37,7 +38,7 @@ function process(t::Type{<:AbstractMPIRecoAlgorithm}, params::LeastSquaresParame reg, args = prepareRegularization(params.reg, params) args[:reg] = reg - solv = createLinearSolver(params.solver, params.S; args...) + solv = createLinearSolver(params.solver, params.S; args..., weights = params.weights) for l=1:L d = solve!(solv, u[:, l])