Commit 19e28338 authored by Jakob Knollmueller's avatar Jakob Knollmueller
Browse files

merge master

parents c0f6f64a c15669d0
......@@ -16,7 +16,8 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from ..multi import MultiDomain, MultiField
from ..multi.multi_domain import MultiDomain
from ..multi.multi_field import MultiField
from .linear_operator import LinearOperator
......
......@@ -21,7 +21,24 @@ import numpy as np
class OperatorAdapter(LinearOperator):
"""Class representing the inverse and/or adjoint of another operator."""
"""Class representing the inverse and/or adjoint of another operator.
Objects of this class are created internally by `LinearOperator` whenever
the inverse and/or adjoint of an already existing operator object is
requested via the `LinearOperator` attributes `inverse`, `adjoint` or
`_flip_modes()`.
Users should never have to create instances of this class directly.
Parameters
----------
op : LinearOperator
The operator on which the adapter will act
op_transform : int
1) adjoint
2) inverse
3) adjoint inverse
"""
def __init__(self, op, op_transform):
super(OperatorAdapter, self).__init__()
......
......@@ -27,7 +27,7 @@ class QHTOperator(LinearOperator):
if target.harmonic:
raise TypeError("Target is not a codomain of domain")
from ..domains import LogRGSpace
from ..domains.log_rg_space import LogRGSpace
if not isinstance(domain, LogRGSpace):
raise ValueError("Domain has to be a LogRGSpace!")
if not isinstance(target, LogRGSpace):
......
......@@ -16,7 +16,7 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from ..operators import LinearOperator
from .linear_operator import LinearOperator
class SelectionOperator(LinearOperator):
......@@ -31,7 +31,7 @@ class SelectionOperator(LinearOperator):
String identifier of the wanted subdomain
"""
def __init__(self, domain, key):
from ..multi import MultiDomain
from ..multi.multi_domain import MultiDomain
if not isinstance(domain, MultiDomain):
raise TypeError("Domain must be a MultiDomain")
self._target = domain[key]
......@@ -56,5 +56,5 @@ class SelectionOperator(LinearOperator):
if mode == self.TIMES:
return x[self._key].copy()
else:
from ..multi import MultiField
from ..multi.multi_field import MultiField
return MultiField({self._key: x.copy()})
......@@ -7,6 +7,8 @@ from .linear_operator import LinearOperator
class SlopeOperator(LinearOperator):
def __init__(self, domain, target, sigmas):
# MR FIXME: check explicitly for the required domain types etc.
# Maybe compute domain from target automatically?
self._domain = DomainTuple.make(domain)
self._target = DomainTuple.make(target)
......@@ -24,7 +26,7 @@ class SlopeOperator(LinearOperator):
for i in range(self.ndim):
rng = np.arange(target.shape[i])
tmp = np.minimum(
rng, target.shape[i] + 1 - rng) * target.bindistances[i]
rng, target.shape[i]+1-rng) * target.bindistances[i]
self.pos[i] += tmp.reshape(
(1,)*i + (shape[i],) + (1,)*(self.ndim-i-1))
......
Markdown is supported
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