Skip to content
GitLab
Menu
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
6741a646
Commit
6741a646
authored
Aug 11, 2018
by
Martin Reinecke
Browse files
cosmetics
parent
2f5dab3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty5/minimization/scipy_minimizer.py
View file @
6741a646
...
...
@@ -31,16 +31,15 @@ from ..utilities import iscomplextype
def
_multiToArray
(
fld
):
szall
=
0
for
val
in
fld
.
values
():
szall
+=
2
*
val
.
size
if
iscomplextype
(
val
.
dtype
)
else
val
.
size
szall
=
sum
(
2
*
v
.
size
if
iscomplextype
(
v
.
dtype
)
else
v
.
size
for
v
in
fld
.
values
())
res
=
np
.
empty
(
szall
,
dtype
=
np
.
float64
)
ofs
=
0
for
val
in
fld
.
values
():
sz2
=
2
*
val
.
size
if
iscomplextype
(
val
.
dtype
)
else
val
.
size
locdat
=
val
.
local_data
.
reshape
(
-
1
)
if
iscomplextype
(
val
.
dtype
):
locdat
=
locdat
.
astype
(
np
.
complex128
).
view
(
np
.
float64
)
locdat
=
locdat
.
view
(
locdat
.
real
.
dtype
)
res
[
ofs
:
ofs
+
sz2
]
=
locdat
ofs
+=
sz2
return
res
...
...
Write
Preview
Supports
Markdown
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