Skip to content

Commit c5ccd53

Browse files
committed
Fix NormalOp weights handling
1 parent 7323698 commit c5ccd53

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/NormalOp.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ end
66

77
# TODO Are weights always restricted to T or can they also be real(T)?
88
function NormalOp(::Type{T}, parent, ::Nothing) where T
9-
weights = similar(storage_type(parent), size(parent, 1))
10-
weights .= one(eltype(parent))
9+
weights = opEye(eltype(parent), size(parent, 1), S = storage_type(parent))
1110
return NormalOp(T, parent, weights)
1211
end
1312
NormalOp(::Type{T}, parent, weights::AbstractVector{T}) where T = NormalOp(T, parent, WeightingOp(weights))
@@ -48,6 +47,7 @@ function NormalOpImpl(parent, weights, tmp)
4847
function produ!(y, parent, weights, tmp, x)
4948
mul!(tmp, parent, x)
5049
mul!(tmp, weights, tmp) # This can be dangerous. We might need to create two tmp vectors
50+
mul!(tmp, weights, tmp)
5151
return mul!(y, adjoint(parent), tmp)
5252
end
5353

0 commit comments

Comments
 (0)