Public Member Functions | List of all members
cudf::test::fixed_point_column_wrapper< Rep > Class Template Reference

A wrapper for a column of fixed-width elements. More...

#include <column_wrapper.hpp>

Inheritance diagram for cudf::test::fixed_point_column_wrapper< Rep >:
cudf::test::detail::column_wrapper

Public Member Functions

template<typename FixedPointRepIterator >
 fixed_point_column_wrapper (FixedPointRepIterator begin, FixedPointRepIterator end, numeric::scale_type scale)
 Construct a non-nullable column of the decimal elements in the range [begin,end). More...
 
 fixed_point_column_wrapper (std::initializer_list< Rep > values, numeric::scale_type scale)
 Construct a non-nullable column of decimal elements from an initializer list. More...
 
template<typename FixedPointRepIterator , typename ValidityIterator >
 fixed_point_column_wrapper (FixedPointRepIterator begin, FixedPointRepIterator end, ValidityIterator v, numeric::scale_type scale)
 Construct a nullable column of the fixed-point elements from a range. More...
 
 fixed_point_column_wrapper (std::initializer_list< Rep > elements, std::initializer_list< bool > validity, numeric::scale_type scale)
 Construct a nullable column from an initializer list of decimal elements using another list to indicate the validity of each element. More...
 
template<typename ValidityIterator >
 fixed_point_column_wrapper (std::initializer_list< Rep > element_list, ValidityIterator v, numeric::scale_type scale)
 Construct a nullable column from an initializer list of decimal elements and the range [v, v + element_list.size()) interpreted as booleans to indicate the validity of each element. More...
 
template<typename FixedPointRepIterator >
 fixed_point_column_wrapper (FixedPointRepIterator begin, FixedPointRepIterator end, std::initializer_list< bool > const &validity, numeric::scale_type scale)
 Construct a nullable column of the decimal elements in the range [begin,end) using a validity initializer list to indicate the validity of each element. More...
 
- Public Member Functions inherited from cudf::test::detail::column_wrapper
 operator column_view () const
 Implicit conversion operator to column_view. More...
 
 operator mutable_column_view ()
 Implicit conversion operator to mutable_column_view. More...
 
std::unique_ptr< cudf::columnrelease ()
 Releases internal unique_ptr to wrapped column. More...
 

Additional Inherited Members

- Protected Attributes inherited from cudf::test::detail::column_wrapper
std::unique_ptr< cudf::columnwrapped {}
 The wrapped column.
 

Detailed Description

template<typename Rep>
class cudf::test::fixed_point_column_wrapper< Rep >

A wrapper for a column of fixed-width elements.

Template Parameters
RepThe type of the column

Definition at line 547 of file column_wrapper.hpp.

Constructor & Destructor Documentation

◆ fixed_point_column_wrapper() [1/6]

template<typename Rep >
template<typename FixedPointRepIterator >
cudf::test::fixed_point_column_wrapper< Rep >::fixed_point_column_wrapper ( FixedPointRepIterator  begin,
FixedPointRepIterator  end,
numeric::scale_type  scale 
)
inline

Construct a non-nullable column of the decimal elements in the range [begin,end).

Example:

// Creates a non-nullable column of DECIMAL32 elements with 5 elements: {0, 2, 4, 6, 8}
auto elements = make_counting_transform_iterator(0, [](auto i) { return i * 2;});
auto w = fixed_point_column_wrapper<int32_t>(elements, elements + 5, scale_type{0});
scale_type
The scale type for fixed_point.
Definition: fixed_point.hpp:43
Template Parameters
FixedPointRepIteratorIterator for fixed_point::rep
Parameters
beginThe beginning of the sequence of elements
endThe end of the sequence of elements
scaleThe scale of the elements in the column

Definition at line 566 of file column_wrapper.hpp.

◆ fixed_point_column_wrapper() [2/6]

template<typename Rep >
cudf::test::fixed_point_column_wrapper< Rep >::fixed_point_column_wrapper ( std::initializer_list< Rep >  values,
numeric::scale_type  scale 
)
inline

Construct a non-nullable column of decimal elements from an initializer list.

Example:

// Creates a non-nullable `decimal32` column with 4 elements: {42.0, 4.2, 0.4}
auto const col = fixed_point_column_wrapper<int32_t>{{420, 42, 4}, scale_type{-1}};
Parameters
valuesThe initializer list of already shifted values
scaleThe scale of the elements in the column

Definition at line 598 of file column_wrapper.hpp.

◆ fixed_point_column_wrapper() [3/6]

template<typename Rep >
template<typename FixedPointRepIterator , typename ValidityIterator >
cudf::test::fixed_point_column_wrapper< Rep >::fixed_point_column_wrapper ( FixedPointRepIterator  begin,
FixedPointRepIterator  end,
ValidityIterator  v,
numeric::scale_type  scale 
)
inline

Construct a nullable column of the fixed-point elements from a range.

Constructs a nullable column of the fixed-point elements in the range [begin,end) using the range [v, v + distance(begin,end)) interpreted as Booleans to indicate the validity of each element.

If v[i] == true, element i is valid, else it is null.

Example:

// Creates a nullable column of DECIMAL32 elements with 5 elements: {null, 100, null, 300,
null}
auto elements = make_counting_transform_iterator(0, [](auto i){ return i; });
auto validity = make_counting_transform_iterator(0, [](auto i){ return i % 2; });
fixed_point_column_wrapper<int32_t> w(elements, elements + 5, validity, scale_type{2});

Note: similar to std::vector, this "range" constructor should be used with parentheses () and not braces {}. The latter should only be used for the initializer_list constructors

Parameters
beginThe beginning of the sequence of elements
endThe end of the sequence of elements
vThe beginning of the sequence of validity indicators
scaleThe scale of the elements in the column

Definition at line 631 of file column_wrapper.hpp.

◆ fixed_point_column_wrapper() [4/6]

template<typename Rep >
cudf::test::fixed_point_column_wrapper< Rep >::fixed_point_column_wrapper ( std::initializer_list< Rep >  elements,
std::initializer_list< bool >  validity,
numeric::scale_type  scale 
)
inline

Construct a nullable column from an initializer list of decimal elements using another list to indicate the validity of each element.

The validity of each element is determined by an initializer_list of booleans where true indicates the element is valid, and false indicates the element is null.

Example:

// Creates a nullable INT32 column with 4 elements: {1, null, 3, null}
fixed_width_column_wrapper<int32_t> w{ {1,2,3,4}, {1, 0, 1, 0}, scale_type{0}};
Parameters
elementsThe initializer list of elements
validityThe initializer list of validity indicator booleans
scaleThe scale of the elements in the column

Definition at line 669 of file column_wrapper.hpp.

◆ fixed_point_column_wrapper() [5/6]

template<typename Rep >
template<typename ValidityIterator >
cudf::test::fixed_point_column_wrapper< Rep >::fixed_point_column_wrapper ( std::initializer_list< Rep >  element_list,
ValidityIterator  v,
numeric::scale_type  scale 
)
inline

Construct a nullable column from an initializer list of decimal elements and the range [v, v + element_list.size()) interpreted as booleans to indicate the validity of each element.

Example:

// Creates a nullable INT32 column with 4 elements: {null, 1, null, 3}
auto validity = make_counting_transform_iterator(0, [](auto i) { return i % 2; });
auto w = fixed_width_column_wrapper<int32_t>{ {1,2,3,4}, validity, scale_type{0}};
Template Parameters
ValidityIteratorDereferencing a ValidityIterator must be convertible to bool
Parameters
element_listThe initializer list of elements
vThe beginning of the sequence of validity indicators
scaleThe scale of the elements in the column

Definition at line 696 of file column_wrapper.hpp.

◆ fixed_point_column_wrapper() [6/6]

template<typename Rep >
template<typename FixedPointRepIterator >
cudf::test::fixed_point_column_wrapper< Rep >::fixed_point_column_wrapper ( FixedPointRepIterator  begin,
FixedPointRepIterator  end,
std::initializer_list< bool > const &  validity,
numeric::scale_type  scale 
)
inline

Construct a nullable column of the decimal elements in the range [begin,end) using a validity initializer list to indicate the validity of each element.

The validity of each element is determined by an initializer_list of booleans where true indicates the element is valid, and false indicates the element is null.

Example:

// Creates a nullable column of DECIMAL32 elements with 5 elements: {null, 1, null, 3, null}
fixed_point_column_wrapper<int32_t> w(elements, elements + 5, {0, 1, 0, 1, 0}, scale_type{0});
Template Parameters
FixedPointRepIteratorIterator for fixed_point::rep
Parameters
beginThe beginning of the sequence of elements
endThe end of the sequence of elements
validityThe initializer list of validity indicator booleans
scaleThe scale of the elements in the column

Definition at line 724 of file column_wrapper.hpp.


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