Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
db6c8996
Commit
db6c8996
authored
Jul 08, 2018
by
Martin Reinecke
Browse files
simplifications and comments
parent
8466e7fc
Changes
3
Hide whitespace changes
Inline
Side-by-side
nifty5/operators/domain_distributor.py
View file @
db6c8996
...
...
@@ -6,9 +6,9 @@ from ..domain_tuple import DomainTuple
from
.linear_operator
import
LinearOperator
# MR FIXME: this needs to be rewritten in a generic fashion
class
DomainDistributor
(
LinearOperator
):
def
__init__
(
self
,
target
,
axis
):
# TODO Replace this by a DiagonalOperator
if
dobj
.
ntask
>
1
:
raise
NotImplementedError
(
'UpProj class does not support MPI.'
)
assert
len
(
target
)
==
2
...
...
nifty5/operators/multi_adaptor.py
View file @
db6c8996
...
...
@@ -17,12 +17,10 @@
# and financially supported by the Studienstiftung des deutschen Volkes.
from
..multi.multi_domain
import
MultiDomain
from
..multi.multi_field
import
MultiField
from
.linear_operator
import
LinearOperator
class
MultiAdaptor
(
LinearOperator
):
"""Transforms a Field into a MultiField and vi
s
e versa when
def
MultiAdaptor
(
target
):
"""Transforms a Field into a MultiField and vi
c
e versa when
using adjoint_times.
Parameters
...
...
@@ -30,30 +28,8 @@ class MultiAdaptor(LinearOperator):
target: MultiDomain
MultiDomain with only one entry (key).
"""
def
__init__
(
self
,
target
):
super
(
MultiAdaptor
,
self
).
__init__
()
if
not
isinstance
(
target
,
MultiDomain
)
or
len
(
target
)
>
1
:
raise
TypeError
self
.
_target
=
target
self
.
_domain
=
list
(
target
.
values
())[
0
]
@
property
def
domain
(
self
):
return
self
.
_domain
@
property
def
target
(
self
):
return
self
.
_target
@
property
def
capability
(
self
):
return
self
.
TIMES
|
self
.
ADJOINT_TIMES
def
apply
(
self
,
x
,
mode
):
self
.
_check_input
(
x
,
mode
)
key
=
list
(
self
.
target
.
keys
())[
0
]
if
mode
==
self
.
TIMES
:
return
MultiField
({
key
:
x
})
else
:
return
x
[
key
]
if
not
isinstance
(
target
,
MultiDomain
)
or
len
(
target
)
>
1
:
raise
TypeError
return
SelectionOperator
(
target
,
target
.
keys
()[
0
]).
adjoint
self
.
_target
=
target
self
.
_domain
=
list
(
target
.
values
())[
0
]
nifty5/operators/symmetrizing_operator.py
View file @
db6c8996
...
...
@@ -4,6 +4,7 @@ from .endomorphic_operator import EndomorphicOperator
from
..
import
dobj
# MR FIXME: we should make sure that the domain is a harmonic RGSpace, correct?
class
SymmetrizingOperator
(
EndomorphicOperator
):
def
__init__
(
self
,
domain
):
self
.
_domain
=
DomainTuple
.
make
(
domain
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment