Commit bc58ad03 authored by Philipp Arras's avatar Philipp Arras
Browse files

Add rmul to Operator for scalar multiplication

Multiplication of operators had worked before. Only multiplication with scalars
was not possible.
parent 6bb2b958
...@@ -79,6 +79,9 @@ class Operator(NiftyMetaBase()): ...@@ -79,6 +79,9 @@ class Operator(NiftyMetaBase()):
return self.scale(x) return self.scale(x)
return NotImplemented return NotImplemented
def __rmul__(self, x):
return self.__mul__(x)
def __add__(self, x): def __add__(self, x):
if not isinstance(x, Operator): if not isinstance(x, Operator):
return NotImplemented return NotImplemented
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment