mir-algorithm ~master (2021-09-24T13:11:04Z)
Dub
Repo
minmaxPos.minmaxPos
mir
algorithm
iteration
minmaxPos
Slice
!(
Iterator
,
N
,
kind
==
Contiguous
&&
N
>
1
?
Canonical
:
kind
)[
2
]
minmaxPos
(Slice!(Iterator, N, kind) slice)
template
minmaxPos
(alias pred = "a < b")
@
optmath
static if
(
__traits(isSame, naryFun!pred, pred)
)
@
optmath
Slice
!(
Iterator
,
N
,
kind
==
Contiguous
&&
N
> 1
?
Canonical
:
kind
)[2]
minmaxPos
(
Iterator
size_t
N
SliceKind
kind
)
(
Slice
!(
Iterator
,
N
,
kind
)
slice
)
alias
minmaxPos
=
.
minmaxPos
!(
naryFun
!
pred
)
Parameters
slice
Slice
!(
Iterator
,
N
,
kind
)
ndslice.
Return Value
Type:
Slice
!(
Iterator
,
N
,
kind
==
Contiguous
&&
N
> 1
?
Canonical
:
kind
)[2]
2 subslices with minimal and maximal
first
elements.
Meta
Source
See Implementation
mir
algorithm
iteration
minmaxPos
functions
minmaxPos