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
a98f7e72
Commit
a98f7e72
authored
Jul 02, 2018
by
Martin Reinecke
Browse files
tweaks
parent
f4a2efa7
Changes
2
Hide whitespace changes
Inline
Side-by-side
nifty5/operators/mask_operator.py
View file @
a98f7e72
...
...
@@ -24,6 +24,9 @@ from ..field import Field
from
.linear_operator
import
LinearOperator
# MR FIXME: this needs a redesign to avoid most _global_data() calls
# Possible approach: keep everything living on `domain` distributed and only
# collect the unstructured Fields.
class
MaskOperator
(
LinearOperator
):
def
__init__
(
self
,
mask
):
if
not
isinstance
(
mask
,
Field
):
...
...
nifty5/operators/slope_operator.py
View file @
a98f7e72
...
...
@@ -25,9 +25,8 @@ class SlopeOperator(LinearOperator):
rng
=
np
.
arange
(
target
.
shape
[
i
])
tmp
=
np
.
minimum
(
rng
,
target
.
shape
[
i
]
+
1
-
rng
)
*
target
.
bindistances
[
i
]
fst_dims
=
(
1
,)
*
i
lst_dims
=
(
1
,)
*
(
self
.
ndim
-
i
-
1
)
self
.
pos
[
i
]
+=
tmp
.
reshape
(
fst_dims
+
(
shape
[
i
],)
+
lst_dims
)
self
.
pos
[
i
]
+=
tmp
.
reshape
(
(
1
,)
*
i
+
(
shape
[
i
],)
+
(
1
,)
*
(
self
.
ndim
-
i
-
1
))
@
property
def
domain
(
self
):
...
...
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