xtensor
 
Loading...
Searching...
No Matches
Searchsorted helpers

Helpers for locating insertion indices in sorted arrays. More...

Functions

template<class E1, class E2>
auto xt::searchsorted (E1 &&a, E2 &&v, bool right=true)
 Find indices where elements should be inserted to maintain order.
 

Detailed Description

Helpers for locating insertion indices in sorted arrays.

Function Documentation

◆ searchsorted()

template<class E1, class E2>
auto xt::searchsorted ( E1 && a,
E2 && v,
bool right = true )
inline

Find indices where elements should be inserted to maintain order.

Parameters
aInput array: sorted (array_like).
vValues to insert into a (array_like).
rightIf false, the index of the first suitable location found is given.
Returns
Array of insertion points with the same shape as v.

Definition at line 193 of file xset_operation.hpp.