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
d0c8860d
Commit
d0c8860d
authored
Sep 26, 2019
by
Martin Reinecke
Browse files
more uncontroversial changes
parent
d444452d
Pipeline
#61048
passed with stages
in 9 minutes and 1 second
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty5/domains/log_rg_space.py
View file @
d0c8860d
...
@@ -93,10 +93,10 @@ class LogRGSpace(StructuredDomain):
...
@@ -93,10 +93,10 @@ class LogRGSpace(StructuredDomain):
Returns
Returns
-------
-------
LogRGSpace
LogRGSpace
The parter domain
The part
n
er domain
"""
"""
codomain_bindistances
=
1.
/
(
self
.
bindistances
*
self
.
shape
)
codomain_bindistances
=
1.
/
(
self
.
bindistances
*
self
.
shape
)
return
LogRGSpace
(
self
.
shape
,
codomain_bindistances
,
self
.
_t_0
,
True
)
return
LogRGSpace
(
self
.
shape
,
codomain_bindistances
,
self
.
_t_0
,
not
self
.
harmonic
)
def
get_k_length_array
(
self
):
def
get_k_length_array
(
self
):
"""Generates array of distances to origin of the space.
"""Generates array of distances to origin of the space.
...
...
nifty5/domains/rg_space.py
View file @
d0c8860d
...
@@ -181,7 +181,7 @@ class RGSpace(StructuredDomain):
...
@@ -181,7 +181,7 @@ class RGSpace(StructuredDomain):
Returns
Returns
-------
-------
RGSpace
RGSpace
The parter domain
The part
n
er domain
"""
"""
distances
=
1.
/
(
np
.
array
(
self
.
shape
)
*
np
.
array
(
self
.
distances
))
distances
=
1.
/
(
np
.
array
(
self
.
shape
)
*
np
.
array
(
self
.
distances
))
return
RGSpace
(
self
.
shape
,
distances
,
not
self
.
harmonic
)
return
RGSpace
(
self
.
shape
,
distances
,
not
self
.
harmonic
)
...
...
nifty5/operators/block_diagonal_operator.py
View file @
d0c8860d
...
@@ -30,7 +30,7 @@ class BlockDiagonalOperator(EndomorphicOperator):
...
@@ -30,7 +30,7 @@ class BlockDiagonalOperator(EndomorphicOperator):
Domain and target of the operator.
Domain and target of the operator.
operators : dict
operators : dict
Dictionary with subdomain names as keys and :class:`LinearOperator` s
Dictionary with subdomain names as keys and :class:`LinearOperator` s
as items.
as items.
Any missing item will be treated as unity operator.
"""
"""
def
__init__
(
self
,
domain
,
operators
):
def
__init__
(
self
,
domain
,
operators
):
if
not
isinstance
(
domain
,
MultiDomain
):
if
not
isinstance
(
domain
,
MultiDomain
):
...
@@ -44,13 +44,17 @@ class BlockDiagonalOperator(EndomorphicOperator):
...
@@ -44,13 +44,17 @@ class BlockDiagonalOperator(EndomorphicOperator):
def
apply
(
self
,
x
,
mode
):
def
apply
(
self
,
x
,
mode
):
self
.
_check_input
(
x
,
mode
)
self
.
_check_input
(
x
,
mode
)
val
=
tuple
(
op
.
apply
(
v
,
mode
=
mode
)
if
op
is
not
None
else
None
val
=
tuple
(
op
.
apply
(
v
,
mode
=
mode
)
if
op
is
not
None
else
v
for
op
,
v
in
zip
(
self
.
_ops
,
x
.
values
()))
for
op
,
v
in
zip
(
self
.
_ops
,
x
.
values
()))
return
MultiField
(
self
.
_domain
,
val
)
return
MultiField
(
self
.
_domain
,
val
)
def
draw_sample
(
self
,
from_inverse
=
False
,
dtype
=
np
.
float64
):
def
draw_sample
(
self
,
from_inverse
=
False
,
dtype
=
np
.
float64
):
val
=
tuple
(
op
.
draw_sample
(
from_inverse
,
dtype
)
from
..sugar
import
from_random
if
op
is
not
None
else
None
for
op
in
self
.
_ops
)
val
=
tuple
(
op
.
draw_sample
(
from_inverse
,
dtype
)
if
op
is
not
None
else
from_random
(
'normal'
,
self
.
_domain
[
key
],
dtype
=
dtype
)
for
op
,
key
in
zip
(
self
.
_ops
,
self
.
_domain
.
keys
()))
return
MultiField
(
self
.
_domain
,
val
)
return
MultiField
(
self
.
_domain
,
val
)
def
_combine_chain
(
self
,
op
):
def
_combine_chain
(
self
,
op
):
...
...
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