Skip to content

Commit 040e4bd

Browse files
remove hard-to-distinguish cases from *(::Number,::Operator)
1 parent 7b924fa commit 040e4bd

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

src/.DS_Store

-6 KB
Binary file not shown.

src/Operators/general/algebra.jl

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -571,20 +571,14 @@ function *(f::Fun, A::Operator)
571571
end
572572
end
573573

574-
function *(c::Number,A::Operator)
575-
if c==1
576-
A
577-
elseif c==0
578-
ZeroOperator(domainspace(A),rangespace(A))
579-
else
580-
ConstantTimesOperator(c,A)
581-
end
582-
end
583-
*(A::Operator,c::Number) = A*(c*one(domainspace(A)))
574+
*(c::Number,A::Operator) = ConstantTimesOperator(c,A)
575+
*(A::Operator,c::Number) = c*A
584576

577+
\(c::Number,B::Operator) = inv(c)*B
578+
\(c::Fun,B::Operator) = inv(c)*B
585579

586-
/(B::Operator,c::Number) = (1.0/c)*B
587-
/(B::Operator,c::Fun) = (1.0/c)*B
580+
/(B::Operator,c::Number) = B*inv(c)
581+
/(B::Operator,c::Fun) = B*inv(c)
588582

589583

590584

src/Spaces/.DS_Store

-6 KB
Binary file not shown.

0 commit comments

Comments
 (0)