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
c6b2dea3
Commit
c6b2dea3
authored
Jun 14, 2013
by
Marco Selig
Browse files
minor improvement of projection_operator.
parent
6e23c2ab
Changes
1
Show whitespace changes
Inline
Side-by-side
nifty_core.py
View file @
c6b2dea3
...
...
@@ -484,7 +484,7 @@ class _about(object): ## nifty support class for global settings
"""
## version
self
.
_version
=
"0.4.
0
"
self
.
_version
=
"0.4.
1
"
## switches and notifications
self
.
_errors
=
notification
(
default
=
True
,
ccode
=
notification
.
_code
)
...
...
@@ -9652,7 +9652,7 @@ class projection_operator(operator):
band
=
int
(
band
)
if
(
band
>
self
.
bands
()
-
1
)
or
(
band
<
0
):
raise
TypeError
(
about
.
_errors
.
cstring
(
"ERROR: invalid band."
))
Px
=
np
.
zeros
(
self
.
domain
.
dim
(
split
=
Tru
e
),
dtype
=
self
.
domain
.
datatype
,
order
=
'C'
)
.
flatten
(
order
=
'C'
)
Px
=
np
.
zeros
(
self
.
domain
.
dim
(
split
=
Fals
e
),
dtype
=
self
.
domain
.
datatype
,
order
=
'C'
)
Px
[
self
.
ind
[
band
]]
+=
x
.
val
.
flatten
(
order
=
'C'
)[
self
.
ind
[
band
]]
Px
=
field
(
self
.
domain
,
val
=
Px
,
target
=
x
.
target
)
return
Px
...
...
@@ -9664,7 +9664,7 @@ class projection_operator(operator):
bandsup
=
np
.
array
(
bandsup
,
dtype
=
np
.
int
)
if
(
np
.
any
(
bandsup
>
self
.
bands
()
-
1
))
or
(
np
.
any
(
bandsup
<
0
)):
raise
ValueError
(
about
.
_errors
.
cstring
(
"ERROR: invalid input."
))
Px
=
np
.
zeros
(
self
.
domain
.
dim
(
split
=
Tru
e
),
dtype
=
self
.
domain
.
datatype
,
order
=
'C'
)
.
flatten
(
order
=
'C'
)
Px
=
np
.
zeros
(
self
.
domain
.
dim
(
split
=
Fals
e
),
dtype
=
self
.
domain
.
datatype
,
order
=
'C'
)
x_
=
x
.
val
.
flatten
(
order
=
'C'
)
for
bb
in
bandsup
:
Px
[
self
.
ind
[
bb
]]
+=
x_
[
self
.
ind
[
bb
]]
...
...
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