Skip to content

Commit

Permalink
ENH: make some C2R operator derivatives linear (odlgroup#1513)
Browse files Browse the repository at this point in the history
* ENH: make some C2R operator derivatives linear

* PEP8 fix
  • Loading branch information
kohr-h committed Aug 12, 2019
1 parent 82a0d4c commit fcc61fd
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions odl/operator/default_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -993,8 +993,7 @@ def __init__(self, space):
"""
real_space = space.real_space
self.space_is_real = (space == real_space)
linear = True
super(RealPart, self).__init__(space, real_space, linear=linear)
super(RealPart, self).__init__(space, real_space, linear=True)

def _call(self, x):
"""Return ``self(x)``."""
Expand Down Expand Up @@ -1121,8 +1120,7 @@ def __init__(self, space):
"""
real_space = space.real_space
self.space_is_real = (space == real_space)
linear = True
super(ImagPart, self).__init__(space, real_space, linear=linear)
super(ImagPart, self).__init__(space, real_space, linear=True)

def _call(self, x):
"""Return ``self(x)``."""
Expand Down Expand Up @@ -1553,10 +1551,10 @@ def adjoint(self):
return deriv

return ComplexModulusDerivativeAdjoint(
deriv.range, deriv.domain, linear=deriv.domain.is_real)
deriv.range, deriv.domain, linear=True
)

return ComplexModulusDerivative(op.domain, op.range,
linear=op.domain.is_real)
return ComplexModulusDerivative(op.domain, op.range, linear=True)


class ComplexModulusSquared(Operator):
Expand Down Expand Up @@ -1747,10 +1745,12 @@ def adjoint(self):
return deriv

return ComplexModulusSquaredDerivAdj(
deriv.range, deriv.domain, linear=deriv.domain.is_real)
deriv.range, deriv.domain, linear=True
)

return ComplexModulusSquaredDerivative(op.domain, op.range,
linear=op.domain.is_real)
return ComplexModulusSquaredDerivative(
op.domain, op.range, linear=True
)


if __name__ == '__main__':
Expand Down

0 comments on commit fcc61fd

Please sign in to comment.