CGAL 5.6 - STL Extensions for CGAL
|
Functions | |
template<class ForwardIterator > | |
std::pair< ForwardIterator, ForwardIterator > | CGAL::min_max_element (ForwardIterator first, ForwardIterator last) |
Computes the minimal and the maximal element of a range. More... | |
template<class ForwardIterator , class CompareMin , class CompareMax > | |
std::pair< ForwardIterator, ForwardIterator > | CGAL::min_max_element (ForwardIterator first, ForwardIterator last, CompareMin comp_min, CompareMax comp_max) |
Computes the minimal and the maximal element of a range. More... | |
template<class RandomAccessIterator , class RandomGenerator > | |
void | CGAL::cpp98::random_shuffle (RandomAccessIterator begin, RandomAccessIterator end, RandomGenerator &random) |
Replacement for std::random_shuffle which was deprecated in C++14, and removed by C++17. More... | |
template<class RandomAccessIterator > | |
void | CGAL::cpp98::random_shuffle (RandomAccessIterator begin, RandomAccessIterator end) |
Replacement for std::random_shuffle which was deprecated in C++14, and removed by C++17. More... | |
std::pair<ForwardIterator, ForwardIterator > CGAL::min_max_element | ( | ForwardIterator | first, |
ForwardIterator | last | ||
) |
#include <CGAL/algorithm.h>
Computes the minimal and the maximal element of a range.
It is modeled after the STL functions std::min_element
and std::max_element
. The advantage of min_max_element()
compared to calling both STL functions is that one only iterates once over the sequence. This is more efficient especially for large and/or complex sequences.
Example
The following example program computes the minimal and maximal element of the sequence (3,\,6,\,5)
. Hence the output is min = 3, max = 6
.
File STL_Extension/min_max_element_example.cpp
first
, last
). The ordering is defined by operator<
on the value type of ForwardIterator
. std::pair< ForwardIterator, ForwardIterator > CGAL::min_max_element | ( | ForwardIterator | first, |
ForwardIterator | last, | ||
CompareMin | comp_min, | ||
CompareMax | comp_max | ||
) |
#include <CGAL/algorithm.h>
Computes the minimal and the maximal element of a range.
It is modeled after the STL functions std::min_element
and std::max_element
. The advantage of min_max_element()
compared to calling both STL functions is that one only iterates once over the sequence. This is more efficient especially for large and/or complex sequences.
first
, last
).CompareMin | is an adaptable binary function object: VT \( \times\) VT \( \rightarrow\) bool where VT is the value type of ForwardIterator . |
CompareMax | is an adaptable binary function object: VT \( \times\) VT \( \rightarrow\) bool where VT is the value type of ForwardIterator . |
void CGAL::cpp98::random_shuffle | ( | RandomAccessIterator | begin, |
RandomAccessIterator | end, | ||
RandomGenerator & | random | ||
) |
#include <CGAL/algorithm.h>
Replacement for std::random_shuffle
which was deprecated in C++14, and removed by C++17.
In the STL it was replaced by std::shuffle
.
void CGAL::cpp98::random_shuffle | ( | RandomAccessIterator | begin, |
RandomAccessIterator | end | ||
) |
#include <CGAL/algorithm.h>
Replacement for std::random_shuffle
which was deprecated in C++14, and removed by C++17.
In the STL it was replaced by std::shuffle
.