Public Member Functions | List of all members
cudf::experimental::row::lexicographic::self_comparator Class Reference

An owning object that can be used to lexicographically compare two rows of the same table. More...

Public Member Functions

 self_comparator (table_view const &t, host_span< order const > column_order={}, host_span< null_order const > null_precedence={}, rmm::cuda_stream_view stream=cudf::get_default_stream())
 Construct an owning object for performing a lexicographic comparison between two rows of the same table. More...
 
 self_comparator (std::shared_ptr< preprocessed_table > t)
 Construct an owning object for performing a lexicographic comparison between two rows of the same preprocessed table. More...
 
template<bool has_nested_columns, typename Nullate , typename PhysicalElementComparator = sorting_physical_element_comparator>
auto less (Nullate nullate={}, PhysicalElementComparator comparator={}) const
 Return the binary operator for comparing rows in the table. More...
 
template<bool has_nested_columns, typename Nullate , typename PhysicalElementComparator = sorting_physical_element_comparator>
auto less_equivalent (Nullate nullate={}, PhysicalElementComparator comparator={}) const
 Return the binary operator for comparing rows in the table. More...
 

Detailed Description

An owning object that can be used to lexicographically compare two rows of the same table.

This class can take a table_view and preprocess certain columns to allow for lexicographical comparison. The preprocessed table and temporary data required for the comparison are created and owned by this class.

Alternatively, self_comparator can be constructed from an existing shared_ptr<preprocessed_table> when sharing the same table among multiple comparators.

This class can then provide a functor object that can used on the device. The object of this class must outlive the usage of the device functor.

Definition at line 968 of file experimental/row_operators.cuh.

Constructor & Destructor Documentation

◆ self_comparator() [1/2]

cudf::experimental::row::lexicographic::self_comparator::self_comparator ( table_view const &  t,
host_span< order const >  column_order = {},
host_span< null_order const >  null_precedence = {},
rmm::cuda_stream_view  stream = cudf::get_default_stream() 
)
inline

Construct an owning object for performing a lexicographic comparison between two rows of the same table.

Parameters
tThe table to compare
column_orderOptional, host array the same length as a row that indicates the desired ascending/descending order of each column in a row. If empty, 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 empty, then null precedence would be null_order::BEFORE for all columns.
streamThe stream to construct this object on. Not the stream that will be used for comparisons using this object.

Definition at line 984 of file experimental/row_operators.cuh.

◆ self_comparator() [2/2]

cudf::experimental::row::lexicographic::self_comparator::self_comparator ( std::shared_ptr< preprocessed_table t)
inline

Construct an owning object for performing a lexicographic comparison between two rows of the same preprocessed table.

This constructor allows independently constructing a preprocessed_table and sharing it among multiple comparators.

Parameters
tA table preprocessed for lexicographic comparison

Definition at line 1001 of file experimental/row_operators.cuh.

Member Function Documentation

◆ less()

template<bool has_nested_columns, typename Nullate , typename PhysicalElementComparator = sorting_physical_element_comparator>
auto cudf::experimental::row::lexicographic::self_comparator::less ( Nullate  nullate = {},
PhysicalElementComparator  comparator = {} 
) const
inline

Return the binary operator for comparing rows in the table.

Returns a binary callable, F, with signature bool F(size_type, size_type).

F(i,j) returns true if and only if row i compares lexicographically less than row j.

Note
The operator overloads in sub-class element_comparator are templated via the type_dispatcher to help select an overload instance for each column in a table. So, cudf::is_nested<Element> will return true if the table has nested-type columns, but it will be a runtime error if template parameter has_nested_columns != true.
Template Parameters
has_nested_columnscompile-time optimization for primitive types. This template parameter is to be used by the developer by querying cudf::has_nested_columns(input). true compiles operator overloads for nested types, while false only compiles operator overloads for primitive types.
NullateA cudf::nullate type describing whether to check for nulls.
PhysicalElementComparatorA relational comparator functor that compares individual values rather than logical elements, defaults to NaN aware relational comparator that evaluates NaN as greater than all other values.
Exceptions
cudf::logic_errorif the input table was preprocessed to transform any nested children columns into integer columns but PhysicalElementComparator is not sorting_physical_element_comparator.
Parameters
nullateIndicates if any input column contains nulls.
comparatorPhysical element relational comparison functor.
Returns
A binary callable object.

Definition at line 1034 of file experimental/row_operators.cuh.

◆ less_equivalent()

template<bool has_nested_columns, typename Nullate , typename PhysicalElementComparator = sorting_physical_element_comparator>
auto cudf::experimental::row::lexicographic::self_comparator::less_equivalent ( Nullate  nullate = {},
PhysicalElementComparator  comparator = {} 
) const
inline

Return the binary operator for comparing rows in the table.

Returns a binary callable, F, with signature bool F(size_type, size_type).

F(i,j) returns true if and only if row i compares lexicographically less than row j.

Note
The operator overloads in sub-class element_comparator are templated via the type_dispatcher to help select an overload instance for each column in a table. So, cudf::is_nested<Element> will return true if the table has nested-type columns, but it will be a runtime error if template parameter has_nested_columns != true.
Template Parameters
has_nested_columnscompile-time optimization for primitive types. This template parameter is to be used by the developer by querying cudf::has_nested_columns(input). true compiles operator overloads for nested types, while false only compiles operator overloads for primitive types.
NullateA cudf::nullate type describing whether to check for nulls.
PhysicalElementComparatorA relational comparator functor that compares individual values rather than logical elements, defaults to NaN aware relational comparator that evaluates NaN as greater than all other values.
Exceptions
cudf::logic_errorif the input table was preprocessed to transform any nested children columns into integer columns but PhysicalElementComparator is not sorting_physical_element_comparator.
Parameters
nullateIndicates if any input column contains nulls.
comparatorPhysical element relational comparison functor.
Returns
A binary callable object.

Definition at line 1055 of file experimental/row_operators.cuh.


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