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

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

Public Member Functions

 row_lexicographic_comparator (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...
 
__device__ 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<bool has_nulls = true>
class cudf::row_lexicographic_comparator< has_nulls >

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
has_nullsIndicates the potential for null values in either row.

Definition at line 320 of file row_operators.cuh.

Constructor & Destructor Documentation

◆ row_lexicographic_comparator()

template<bool has_nulls = true>
cudf::row_lexicographic_comparator< has_nulls >::row_lexicographic_comparator ( 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.

Exceptions
cudf::logic_errorif lhs.num_columns() != rhs.num_columns()
Parameters
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 338 of file row_operators.cuh.

Member Function Documentation

◆ operator()()

template<bool has_nulls = true>
__device__ bool cudf::row_lexicographic_comparator< has_nulls >::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 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 357 of file row_operators.cuh.


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