Skip to content

Commit d4201d6

Browse files
committed
Only define for one ordering
1 parent ef0bcf3 commit d4201d6

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

src/uniformscaling.jl

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -217,20 +217,15 @@ function (-)(J::UniformScaling{<:Complex}, A::Hermitian)
217217
return B
218218
end
219219

220-
for f in (:+, :-)
221-
@eval begin
222-
function $f(A::AdjOrTransAbsMat, J::UniformScaling)
223-
checksquare(A)
224-
op = wrapperop(A)
225-
op($f(op(A), op(J)))
226-
end
227-
228-
function $f(J::UniformScaling, A::AdjOrTransAbsMat)
229-
checksquare(A)
230-
op = wrapperop(A)
231-
op($f(op(J), op(A)))
232-
end
233-
end
220+
function (+)(A::AdjOrTransAbsMat, J::UniformScaling)
221+
checksquare(A)
222+
op = wrapperop(A)
223+
op(op(A) + op(J))
224+
end
225+
function (-)(J::UniformScaling, A::AdjOrTransAbsMat)
226+
checksquare(A)
227+
op = wrapperop(A)
228+
op(op(J) - op(A))
234229
end
235230

236231
function (+)(A::AbstractMatrix, J::UniformScaling)

0 commit comments

Comments
 (0)