Skip to content

Replace the call to sort by select in stdlib_stats_median #584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 10, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add left option in select
  • Loading branch information
jvdp1 committed Dec 1, 2021
commit 94d16c8a6ee90d66b3cf56722fca36e6fcb498d3
8 changes: 4 additions & 4 deletions src/stdlib_stats_median.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ contains
call select(x_tmp, c, val)

if (mod(n, 2_int64) == 0) then
call select(x_tmp, c+1, val1)
call select(x_tmp, c+1, val1, left = c)
#:if t1[0] == 'r'
res = (val + val1) / 2._${o1}$
#:else
Expand Down Expand Up @@ -111,7 +111,7 @@ contains
call select(x_tmp, c, val)

if (mod(n, 2) == 0) then
call select(x_tmp, c+1, val1)
call select(x_tmp, c+1, val1, left = c)
res${reduce_subvector('j', rank, fi)}$ = &
#:if t1[0] == 'r'
(val + val1) / 2._${o1}$
Expand Down Expand Up @@ -171,7 +171,7 @@ contains
call select(x_tmp, c, val)

if (mod(n, 2_int64) == 0) then
call select(x_tmp, c+1, val1)
call select(x_tmp, c+1, val1, left = c)
#:if t1[0] == 'r'
res = (val + val1) / 2._${o1}$
#:else
Expand Down Expand Up @@ -242,7 +242,7 @@ contains
call select(x_tmp, c, val)

if (mod(n, 2_int64) == 0) then
call select(x_tmp, c+1, val1)
call select(x_tmp, c+1, val1, left = c)
res${reduce_subvector('j', rank, fi)}$ = &
#:if t1[0] == 'r'
(val + val1) / 2._${o1}$
Expand Down