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
10
Issues
10
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
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
bf20b328
Commit
bf20b328
authored
Jul 04, 2018
by
Martin Reinecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more work
parent
201a6a28
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
21 deletions
+13
-21
nifty5/domains/lm_space.py
nifty5/domains/lm_space.py
+1
-6
nifty5/operators/dof_distributor.py
nifty5/operators/dof_distributor.py
+4
-3
nifty5/operators/qht_operator.py
nifty5/operators/qht_operator.py
+2
-4
nifty5/operators/sum_operator.py
nifty5/operators/sum_operator.py
+4
-4
nifty5/operators/symmetrizing_operator.py
nifty5/operators/symmetrizing_operator.py
+2
-4
No files found.
nifty5/domains/lm_space.py
View file @
bf20b328
...
...
@@ -101,12 +101,7 @@ class LMSpace(StructuredDomain):
# by Challinor et al.
# http://arxiv.org/abs/astro-ph/0008228
from
..sugar
import
exp
res
=
x
+
1.
res
*=
x
res
*=
-
0.5
*
sigma
*
sigma
exp
(
res
,
out
=
res
)
return
res
return
exp
((
x
+
1.
)
*
x
*
(
-
0.5
*
sigma
*
sigma
))
def
get_fft_smoothing_kernel_function
(
self
,
sigma
):
return
lambda
x
:
self
.
_kernel
(
x
,
sigma
)
...
...
nifty5/operators/dof_distributor.py
View file @
bf20b328
...
...
@@ -125,9 +125,10 @@ class DOFDistributor(LinearOperator):
else
:
arr
=
x
.
local_data
arr
=
arr
.
reshape
(
self
.
_hshape
)
oarr
=
arr
[(
slice
(
None
),
self
.
_dofdex
,
slice
(
None
))]
return
Field
.
from_local_data
(
self
.
_target
,
oarr
.
reshape
(
self
.
_target
.
local_shape
))
oarr
=
res
.
local_data
.
reshape
(
self
.
_pshape
)
oarr
=
np
.
empty
(
self
.
_pshape
,
dtype
=
x
.
dtype
)
oarr
[()]
=
arr
[(
slice
(
None
),
self
.
_dofdex
,
slice
(
None
))]
return
Field
.
from_local_data
(
self
.
_target
,
oarr
.
reshape
(
self
.
_target
.
local_shape
))
def
apply
(
self
,
x
,
mode
):
self
.
_check_input
(
x
,
mode
)
...
...
nifty5/operators/qht_operator.py
View file @
bf20b328
...
...
@@ -55,10 +55,8 @@ class QHTOperator(LinearOperator):
sl
=
(
slice
(
None
),)
*
i
+
(
slice
(
1
,
None
),)
if
i
==
ax
:
x
=
dobj
.
redistribute
(
x
,
nodist
=
(
ax
,))
curax
=
dobj
.
distaxis
(
x
)
x
=
dobj
.
local_data
(
x
)
x
[
sl
]
=
hartley
(
x
[
sl
],
axes
=
(
i
,))
x
=
dobj
.
from_local_data
(
globshape
,
x
,
distaxis
=
curax
)
tmp
=
dobj
.
local_data
(
x
)
tmp
[
sl
]
=
hartley
(
tmp
[
sl
],
axes
=
(
i
,))
if
i
==
ax
:
x
=
dobj
.
redistribute
(
x
,
dist
=
ax
)
return
Field
(
self
.
_tgt
(
mode
),
val
=
x
)
...
...
nifty5/operators/sum_operator.py
View file @
bf20b328
...
...
@@ -16,6 +16,8 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from
builtins
import
*
from
..utilities
import
my_sum
from
.linear_operator
import
LinearOperator
import
numpy
as
np
...
...
@@ -187,7 +189,5 @@ class SumOperator(LinearOperator):
if
from_inverse
:
raise
NotImplementedError
(
"cannot draw from inverse of this operator"
)
res
=
self
.
_ops
[
0
].
draw_sample
(
from_inverse
,
dtype
)
for
op
in
self
.
_ops
[
1
:]:
res
+=
op
.
draw_sample
(
from_inverse
,
dtype
)
return
res
return
my_sum
(
map
(
lambda
op
:
op
.
draw_sample
(
from_inverse
,
dtype
),
self
.
_ops
))
nifty5/operators/symmetrizing_operator.py
View file @
bf20b328
...
...
@@ -22,10 +22,8 @@ class SymmetrizingOperator(EndomorphicOperator):
lead
=
(
slice
(
None
),)
*
i
if
i
==
ax
:
tmp
=
dobj
.
redistribute
(
tmp
,
nodist
=
(
ax
,))
curax
=
dobj
.
distaxis
(
tmp
)
tmp
=
dobj
.
local_data
(
tmp
)
tmp
[
lead
+
(
slice
(
1
,
None
),)]
-=
tmp
[
lead
+
(
slice
(
None
,
0
,
-
1
),)]
tmp
=
dobj
.
from_local_data
(
globshape
,
tmp
,
distaxis
=
curax
)
tmp2
=
dobj
.
local_data
(
tmp
)
tmp2
[
lead
+
(
slice
(
1
,
None
),)]
-=
tmp2
[
lead
+
(
slice
(
None
,
0
,
-
1
),)]
if
i
==
ax
:
tmp
=
dobj
.
redistribute
(
tmp
,
dist
=
ax
)
return
Field
(
self
.
target
,
val
=
tmp
)
...
...
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