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
72f9ca29
Commit
72f9ca29
authored
Aug 27, 2018
by
Philipp Arras
Browse files
Fixup
parent
f4b1c9d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty5/operators/domain_tuple_field_inserter.py
View file @
72f9ca29
...
...
@@ -35,17 +35,19 @@ class DomainTupleFieldInserter(LinearOperator):
domain : Domain, tuple of Domain or DomainTuple
new_space : Domain, tuple of Domain or DomainTuple
index : Integer
Position
at which new_space shall be added to domain.
Index
at which new_space shall be added to domain.
position : tuple
Slice in new_space
at
which the field shall be
inserted
.
Slice in new_space
in
which the
input
field shall be
written into
.
'''
self
.
_domain
=
DomainTuple
.
make
(
domain
)
tgt
=
list
(
self
.
domain
)
tgt
.
insert
(
index
,
new_space
)
self
.
_target
=
DomainTuple
.
make
(
tgt
)
self
.
_capability
=
self
.
TIMES
|
self
.
ADJOINT_TIMES
self
.
_slc
=
(
slice
(
None
),)
*
index
+
position
+
(
slice
(
None
),)
*
(
len
(
self
.
domain
.
shape
)
-
index
)
fst_dims
=
sum
([
len
(
dd
.
shape
)
for
dd
in
self
.
domain
][:
index
])
last_dims
=
len
(
self
.
domain
.
shape
)
-
fst_dims
self
.
_slc
=
(
slice
(
None
),)
*
fst_dims
+
position
+
(
slice
(
None
),)
*
last_dims
def
apply
(
self
,
x
,
mode
):
self
.
_check_input
(
x
,
mode
)
...
...
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