tables::column::mmin, mmax

1)

template <is_primitive_type P>
column<P> column<P>::mmin(const std::size_t m) const

2)

template <is_primitive_type P>
column<P> column<P>::mmax(const std::size_t m) const

  1. Returns the moving minimum.

  2. Returns the moving maximum.

Complexity

Linear

Example

Code

#include <cpptables/table.hh>

using namespace tables;
using namespace std;

void column_mmin_mmax()
{
  const column<unsigned> xs({ 10, 2, 1, 8, 20, 7, 15, 0});

  cout << xs.mmin(2) << "\n";
  cout << xs.mmax(2) << "\n";
}

Output

10 2 1 1 8 7 7 0

10 10 2 8 20 20 15 15