Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NIFTy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
10
Merge Requests
10
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ift
NIFTy
Commits
081deabf
Commit
081deabf
authored
Feb 12, 2019
by
Martin Reinecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more cleanups
parent
d3e0dbec
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
+9
-10
nifty5/operators/operator.py
nifty5/operators/operator.py
+2
-1
nifty5/operators/simple_linear_operators.py
nifty5/operators/simple_linear_operators.py
+5
-7
nifty5/operators/sum_operator.py
nifty5/operators/sum_operator.py
+2
-2
No files found.
nifty5/operators/operator.py
View file @
081deabf
...
@@ -196,7 +196,8 @@ class _ConstCollector(object):
...
@@ -196,7 +196,8 @@ class _ConstCollector(object):
self
.
_nc
|=
set
(
fulldom
.
keys
())
-
set
(
const
.
keys
())
self
.
_nc
|=
set
(
fulldom
.
keys
())
-
set
(
const
.
keys
())
if
self
.
_const
is
None
:
if
self
.
_const
is
None
:
self
.
_const
=
MultiField
.
from_dict
(
self
.
_const
=
MultiField
.
from_dict
(
{
key
:
const
[
key
]
for
key
in
const
.
keys
()
if
key
not
in
self
.
_nc
})
{
key
:
const
[
key
]
for
key
in
const
.
keys
()
if
key
not
in
self
.
_nc
})
else
:
else
:
self
.
_const
=
self
.
_const
.
unite
(
const
)
self
.
_const
=
self
.
_const
.
unite
(
const
)
self
.
_const
=
MultiField
.
from_dict
(
self
.
_const
=
MultiField
.
from_dict
(
...
...
nifty5/operators/simple_linear_operators.py
View file @
081deabf
...
@@ -296,15 +296,13 @@ class _PartialExtractor(LinearOperator):
...
@@ -296,15 +296,13 @@ class _PartialExtractor(LinearOperator):
raise
TypeError
(
"MultiDomain expected"
)
raise
TypeError
(
"MultiDomain expected"
)
self
.
_domain
=
domain
self
.
_domain
=
domain
self
.
_target
=
target
self
.
_target
=
target
for
key
in
self
.
_target
.
keys
():
if
not
(
self
.
_domain
[
key
]
is
not
self
.
_target
[
key
]):
raise
ValueError
(
"domain mismatch"
)
self
.
_capability
=
self
.
TIMES
|
self
.
ADJOINT_TIMES
self
.
_capability
=
self
.
TIMES
|
self
.
ADJOINT_TIMES
def
apply
(
self
,
x
,
mode
):
def
apply
(
self
,
x
,
mode
):
self
.
_check_input
(
x
,
mode
)
self
.
_check_input
(
x
,
mode
)
if
mode
==
self
.
TIMES
:
if
mode
==
self
.
TIMES
:
res
=
x
.
extract
(
self
.
_target
)
return
x
.
extract
(
self
.
_target
)
assert
res
.
domain
is
self
.
target
return
MultiField
.
from_dict
({
key
:
x
[
key
]
for
key
in
x
.
domain
.
keys
()})
return
res
fld
=
{
key
:
x
[
key
]
if
key
in
x
.
domain
.
keys
()
else
Field
.
full
(
self
.
_domain
[
key
],
0.
)
for
key
in
self
.
_domain
.
keys
()}
assert
MultiField
.
from_dict
(
fld
).
domain
is
self
.
domain
return
MultiField
.
from_dict
(
fld
)
nifty5/operators/sum_operator.py
View file @
081deabf
...
@@ -202,8 +202,8 @@ class SumOperator(LinearOperator):
...
@@ -202,8 +202,8 @@ class SumOperator(LinearOperator):
return
"SumOperator:
\n
"
+
indent
(
subs
)
return
"SumOperator:
\n
"
+
indent
(
subs
)
def
_simplify_for_constant_input_nontrivial
(
self
,
c_inp
):
def
_simplify_for_constant_input_nontrivial
(
self
,
c_inp
):
f
=
[]
f
=
[]
o
=
[]
o
=
[]
for
op
in
self
.
_ops
:
for
op
in
self
.
_ops
:
tf
,
to
=
op
.
simplify_for_constant_input
(
tf
,
to
=
op
.
simplify_for_constant_input
(
c_inp
.
extract_part
(
op
.
domain
))
c_inp
.
extract_part
(
op
.
domain
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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