Public Member Functions | List of all members
cudf::row_lexicographic_comparator< Nullate > Class Template Reference

Computes whether one row is lexicographically less than another row. More...

Public Member Functions

 row_lexicographic_comparator (Nullate has_nulls, table_device_view lhs, table_device_view rhs, order const *column_order=nullptr, null_order const *null_precedence=nullptr)
 Construct a function object for performing a lexicographic comparison between the rows of two tables. More...
 
bool operator() (size_type lhs_index, size_type rhs_index) const noexcept
 Checks whether the row at lhs_index in the lhs table compares lexicographically less than the row at rhs_index in the rhs table. More...
 

Detailed Description

template<typename Nullate>
class cudf::row_lexicographic_comparator< Nullate >

Computes whether one row is lexicographically less than another row.

Lexicographic ordering is determined by:

Lexicographic ordering is exactly equivalent to doing an alphabetical sort of two words, for example, aac would be less than (or precede) abb. The second letter in both words is the first non-equal letter, and a < b, thus aac < abb.

Template Parameters
NullateA cudf::nullate type describing how to check for nulls.

Definition at line 377 of file row_operators.cuh.

Constructor & Destructor Documentation

◆ row_lexicographic_comparator()

template<typename Nullate >
cudf::row_lexicographic_comparator< Nullate >::row_lexicographic_comparator ( Nullate  has_nulls,
table_device_view  lhs,
table_device_view  rhs,
order const *  column_order = nullptr,
null_order const *  null_precedence = nullptr 
)
inline

Construct a function object for performing a lexicographic comparison between the rows of two tables.

Behavior is undefined if called with incomparable column types.

Exceptions
cudf::logic_errorif lhs.num_columns() != rhs.num_columns()
Parameters
has_nullsIndicates if either input table contains columns with nulls.
lhsThe first table
rhsThe second table (may be the same table as lhs)
column_orderOptional, device array the same length as a row that indicates the desired ascending/descending order of each column in a row. If nullptr, it is assumed all columns are sorted in ascending order.
null_precedenceOptional, device array the same length as a row and indicates how null values compare to all other for every column. If it is nullptr, then null precedence would be null_order::BEFORE for all columns.

Definition at line 398 of file row_operators.cuh.

Member Function Documentation

◆ operator()()

template<typename Nullate >
bool cudf::row_lexicographic_comparator< Nullate >::operator() ( size_type  lhs_index,
size_type  rhs_index 
) const
inlinenoexcept

Checks whether the row at lhs_index in the lhs table compares lexicographically less than the row at rhs_index in the rhs table.

Parameters
lhs_indexThe index of the row in the lhs table to examine
rhs_indexThe index of the row in the rhs table to examine
Returns
true if row from the lhs table compares less than row in the rhs table

Definition at line 421 of file row_operators.cuh.


The documentation for this class was generated from the following file: