Skip to content

Commit

Permalink
Add weighting to rownorm²
Browse files Browse the repository at this point in the history
  • Loading branch information
nHackel committed Feb 19, 2024
1 parent 29aa336 commit a0cfb72
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function rownorm²(A::AbstractMatrix,row::Int)
end

rownorm²(A::AbstractLinearOperator,row) = rownorm²(Matrix(A[row, :]), 1)
rownorm²(A::ProdOp{T, <:WeightingOp, matT}, row) where {T, matT} = rownorm²(A.B, row)
rownorm²(A::ProdOp{T, <:WeightingOp, matT}, row) where {T, matT} = A.A.weights[row]^2*rownorm²(A.B, row)

"""
This function computes the 2-norm² of a rows of S for sparse matrices.
Expand All @@ -33,9 +33,6 @@ function rownorm²(B::Transpose{T,S},row::Int) where {T,S<:SparseMatrixCSC}
end


solverweights(solver::S) where S <: AbstractLinearSolver = solverweights(S, solver.A)
solverweights(::Type{<:AbstractLinearSolver}, A) = ones(real(eltype(A)), size(A, 1))

### dot_with_matrix_row ###


Expand Down

0 comments on commit a0cfb72

Please sign in to comment.