mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-08-29 14:50:52 +00:00
add doc: is_increasing, is_decreasing
This commit is contained in:
parent
15397fdd71
commit
958e2cb7a4
17 changed files with 1012 additions and 8 deletions
42
source/libs/sprout/algorithm/is_decreasing.rst
Normal file
42
source/libs/sprout/algorithm/is_decreasing.rst
Normal file
|
@ -0,0 +1,42 @@
|
|||
.. _sprout-algorithm-is_decreasing:
|
||||
###############################################################################
|
||||
is_decreasing
|
||||
###############################################################################
|
||||
|
||||
Interface
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
template<typename ForwardIterator>
|
||||
inline SPROUT_CONSTEXPR bool
|
||||
is_decreasing(ForwardIterator first, ForwardIterator last);
|
||||
|
||||
Returns
|
||||
========================================
|
||||
|
||||
| Same as ``is_sorted(first, last, greater<>())``.
|
||||
|
||||
Examples
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
#include <sprout/algorithm/is_decreasing.hpp>
|
||||
#include <sprout/array.hpp>
|
||||
#include <sprout/container.hpp>
|
||||
using namespace sprout;
|
||||
|
||||
SPROUT_STATIC_CONSTEXPR auto input = array<int, 10>{{5, 5, 4, 4, 3, 3, 2, 2, 1, 1}};
|
||||
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_decreasing(begin(input), end(input));
|
||||
static_assert(result, "input is decreasing.");
|
||||
|
||||
Complexity
|
||||
========================================
|
||||
|
||||
| Recursive function invocations in *O(logN)* (logarithmic) depth.
|
||||
|
||||
Header
|
||||
========================================
|
||||
|
||||
| ``sprout/algorithm/is_decreasing.hpp``
|
||||
| Convenience header: ``sprout/algorithm.hpp``
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue