Skip to content

Commit f17b890

Browse files
committed
median: replace _ by numbers
1 parent 9bbcb74 commit f17b890

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/common.fypp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,17 @@ ${prefix + joinstr.join([line.strip() for line in txt.split("\n")]) + suffix}$
169169
#!
170170
#! E.g.,
171171
#! select_subvector('j', 5, 2)
172-
#! -> (j_, :, j___, j____, j_____)
172+
#! -> (j1, :, j3, j4, j5)
173173
#!
174174
#:def select_subvector(varname, rank, idim)
175175
#:assert rank > 0
176176
#:call join_lines(joinstr=", ", prefix="(", suffix=")")
177177
#:for i in range(1, idim)
178-
${varname}$${ "_" * (i) }$
178+
${varname}$${i}$
179179
#:endfor
180180
:
181181
#:for i in range(idim + 1, rank + 1)
182-
${varname}$${ "_" * (i) }$
182+
${varname}$${i}$
183183
#:endfor
184184
#:endcall
185185
#:enddef
@@ -197,17 +197,17 @@ ${prefix + joinstr.join([line.strip() for line in txt.split("\n")]) + suffix}$
197197
#!
198198
#! E.g.,
199199
#! reduce_subvector('j', 5, 2)
200-
#! -> (j_, j___, j____, j_____)
200+
#! -> (j1, j3, j4, j5)
201201
#!
202202
#:def reduce_subvector(varname, rank, idim)
203203
#:assert rank > 0
204204
#:if rank > 1
205205
#:call join_lines(joinstr=", ", prefix="(", suffix=")")
206206
#:for i in range(1, idim)
207-
${varname}$${ "_" * (i) }$
207+
${varname}$${i}$
208208
#:endfor
209209
#:for i in range(idim + 1, rank + 1)
210-
${varname}$${ "_" * (i) }$
210+
${varname}$${i}$
211211
#:endfor
212212
#:endcall
213213
#:endif

src/stdlib_stats_median.fypp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ contains
6464
integer :: c, n
6565
#:if rank > 1
6666
#:for fj in range(1, rank+1)
67-
integer :: j${"_" * fj}$
67+
integer :: j${fj}$
6868
#:endfor
6969
#:endif
7070
${t1}$, allocatable :: x_tmp(:)
@@ -84,7 +84,7 @@ contains
8484
case(${fi}$)
8585
! Loop over every dimension of the array except "dim"
8686
#:for fj in list(range(1, fi)) + list(range(fi+1, rank+1))
87-
do j${"_" * fj}$ = 1, size(x, ${fj}$)
87+
do j${fj}$ = 1, size(x, ${fj}$)
8888
#:endfor
8989
x_tmp(:) = x${select_subvector('j', rank, fi)}$
9090
call sort(x_tmp)
@@ -162,7 +162,7 @@ contains
162162
integer(kind = int64) :: c, n
163163
#:if rank > 1
164164
#:for fj in range(1, rank+1)
165-
integer :: j${"_" * fj}$
165+
integer :: j${fj}$
166166
#:endfor
167167
#:endif
168168
${t1}$, allocatable :: x_tmp(:)
@@ -176,7 +176,7 @@ contains
176176
case(${fi}$)
177177
! Loop over every dimension of the array except "dim"
178178
#:for fj in list(range(1, fi)) + list(range(fi+1, rank+1))
179-
do j${"_" * fj}$ = 1, size(x, ${fj}$)
179+
do j${fj}$ = 1, size(x, ${fj}$)
180180
#:endfor
181181
x_tmp = pack(x${select_subvector('j', rank, fi)}$, &
182182
mask${select_subvector('j', rank, fi)}$)

0 commit comments

Comments
 (0)