tables::column::gt,ge

1)

template<is_primitive_type P>
inline
column<bool_t>
column<P>::gt(const column<P>& rhs) const

2)

template<is_primitive_type P>
inline
column<bool_t>
column<P>::gt(const P cte) const

3)

template<is_primitive_type P>
inline
column<bool_t>
column<P>::ge(const column<P>& rhs) const

4)

template<is_primitive_type P>
inline
column<bool_t>
column<P>::ge(const P cte) const

1 and 2) Returns column-of-bools containing column-wise greater-than comparison between this and rhs columns or between this and cte value.

3 and 4) Returns column-of-bools containing column-wise greater-or-equal comparison between this and rhs columns or between this and cte value.

Complexity

O(n)

Example

Code

#include <cpptables/table.hh>

using namespace tables;
using namespace std;

void column_gt_ge()
{
  const column<unsigned> c0({ 1, 2, 3, 4 ,5});
  const column<unsigned> c1({ 1, 2, 10, 20, 30});

  {
    const column<bool> r0 = c0.gt(c1); // same as c0 > c1
    cout << r0 << "\n";
    const column<bool> r1 = c0.ge(c1); // same as c0 >= c1
    cout << r1 << "\n";
  }

  {
    const column<bool> r0 = c0.gt(3); // same as c0 > 3
    cout << r0 << "\n";
    const column<bool> r1 = c0.ge(3); // same as c0 >= 3
    cout << r1 << "\n";
  }
}

Output

False False False False False
True True False False False
False False False True True
False False True True True