Commit 57f14dac authored by Philipp Arras's avatar Philipp Arras
Browse files

Merge branch 'add_one_over' into 'NIFTy_6'

added the one_over method to MutliField

See merge request !421
parents 35cf799b c5386f78
Pipeline #70651 passed with stages
in 18 minutes and 46 seconds
...@@ -310,6 +310,9 @@ class MultiField(object): ...@@ -310,6 +310,9 @@ class MultiField(object):
res[key] = -val if neg else val res[key] = -val if neg else val
return MultiField.from_dict(res) return MultiField.from_dict(res)
def one_over(self):
return 1/self
def _binary_op(self, other, op): def _binary_op(self, other, op):
f = getattr(Field, op) f = getattr(Field, op)
if isinstance(other, MultiField): if isinstance(other, MultiField):
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