Skip to content

Commit e897504

Browse files
committed
update specs for median
1 parent 0512789 commit e897504

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

doc/specs/stdlib_stats.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,9 @@ and if `n` is an odd number, the median is:
204204
median(array) = mean( array_sorted( floor( (n + 1) / 2.):floor( (n + 1) / 2.) + 1 ) )
205205
```
206206

207-
The current implementation is a quite naive implementation that relies on sorting
208-
the whole array, using the subroutine `[[stdlib_sorting(module):ord_sort(interface)]]`
209-
provided by the `[[stdlib_sorting(module)]]` module.
207+
The current implementation relies on a selection algorithm applied on a copy of
208+
the whole array, using the subroutine `[[stdlib_selection(module):select(interface)]]`
209+
provided by the `[[stdlib_selection(module)]]` module.
210210

211211
### Syntax
212212

@@ -220,11 +220,12 @@ Generic subroutine
220220

221221
### Arguments
222222

223-
`array`: Shall be an array of type `integer` or `real`.
223+
`array`: Shall be an array of type `integer` or `real`. It is an `intent(in)`
224+
argument.
224225

225-
`dim`: Shall be a scalar of type `integer` with a value in the range from 1 to `n`, where `n` is the rank of `array`.
226+
`dim`: Shall be a scalar of type `integer` with a value in the range from 1 to `n`, where `n` is the rank of `array`. It is an `intent(in)` argument.
226227

227-
`mask` (optional): Shall be of type `logical` and either a scalar or an array of the same shape as `array`.
228+
`mask` (optional): Shall be of type `logical` and either a scalar or an array of the same shape as `array`. It is an `intent(in)` argument.
228229

229230
### Return value
230231

0 commit comments

Comments
 (0)