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
Thomas Peters
NIFTy
Commits
d328c4e3
Commit
d328c4e3
authored
Sep 21, 2016
by
Jait Dixit
Browse files
Fix index calculation in lm_helper
parent
13a563de
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty/spaces/lm_space/lm_helper.pyx
View file @
d328c4e3
...
...
@@ -10,7 +10,11 @@ cpdef _distance_array_helper(np.ndarray[np.int_t] index_array, np.int_t lmax):
if
index_full
<=
lmax
:
index_half
=
index_full
else
:
index_half
=
(
index_full
+
lmax
+
1
)
/
2
;
if
(
index_full
-
lmax
)
%
2
==
0
:
index_half
=
(
index_full
+
lmax
)
/
2
;
else
:
index_half
=
(
index_full
+
lmax
+
1
)
/
2
;
m
=
(
np
.
ceil
(((
2
*
lmax
+
1
)
-
np
.
sqrt
((
2
*
lmax
+
1
)
**
2
-
8
*
(
index_half
-
lmax
)))
/
2
)).
astype
(
int
)
...
...
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