experimental/algorithm File Reference

Go to the source code of this file.

## Namespaces

| std

## Macros

#define | __cpp_lib_experimental_sample
#define | _GLIBCXX_EXPERIMENTAL_ALGORITHM

## Functions

template<typename _InputIterator , typename _RandomAccessIterator , typename _Size , typename _UniformRandomNumberGenerator >
_RandomAccessIterator | std::experimental::fundamentals_v1::__sample (_InputIterator __first, _InputIterator __last, input_iterator_tag, _RandomAccessIterator __out, random_access_iterator_tag, _Size __n, _UniformRandomNumberGenerator &&__g)
template<typename _ForwardIterator , typename _OutputIterator , typename _Cat , typename _Size , typename _UniformRandomNumberGenerator >
_OutputIterator | std::experimental::fundamentals_v1::__sample (_ForwardIterator __first, _ForwardIterator __last, forward_iterator_tag, _OutputIterator __out, _Cat, _Size __n, _UniformRandomNumberGenerator &&__g)
template<typename _PopulationIterator , typename _SampleIterator , typename _Distance , typename _UniformRandomNumberGenerator >
_SampleIterator | std::experimental::fundamentals_v1::sample (_PopulationIterator __first, _PopulationIterator __last, _SampleIterator __out, _Distance __n, _UniformRandomNumberGenerator &&__g)
template<typename _ForwardIterator , typename _Searcher >
_ForwardIterator | std::experimental::fundamentals_v1::search (_ForwardIterator __first, _ForwardIterator __last, const _Searcher &__searcher)

## Detailed Description

This is a TS C++ Library header.

Definition in file experimental/algorithm.

## Function Documentation

## __sample() [1/2]

template<typename _InputIterator , typename _RandomAccessIterator , typename _Size , typename _UniformRandomNumberGenerator >

_RandomAccessIterator std::experimental::fundamentals_v1::__sample | ( | _InputIterator | __first,
|  | _InputIterator | __last,
|  | input_iterator_tag | ,
|  | _RandomAccessIterator | __out,
|  | random_access_iterator_tag | ,
|  | _Size | __n,
|  | _UniformRandomNumberGenerator && | __g
| ) |  |

Reservoir sampling algorithm.

Definition at line 62 of file experimental/algorithm.

## __sample() [2/2]

template<typename _ForwardIterator , typename _OutputIterator , typename _Cat , typename _Size , typename _UniformRandomNumberGenerator >

_OutputIterator std::experimental::fundamentals_v1::__sample | ( | _ForwardIterator | __first,
|  | _ForwardIterator | __last,
|  | forward_iterator_tag | ,
|  | _OutputIterator | __out,
|  | _Cat | ,
|  | _Size | __n,
|  | _UniformRandomNumberGenerator && | __g
| ) |  |

Selection sampling algorithm.

Definition at line 89 of file experimental/algorithm.

## sample()

template<typename _PopulationIterator , typename _SampleIterator , typename _Distance , typename _UniformRandomNumberGenerator >

_SampleIterator std::experimental::fundamentals_v1::sample | ( | _PopulationIterator | __first,
|  | _PopulationIterator | __last,
|  | _SampleIterator | __out,
|  | _Distance | __n,
|  | _UniformRandomNumberGenerator && | __g
| ) |  |

Take a random sample from a population.

Definition at line 111 of file experimental/algorithm.