xgboost

Public Types | Public Member Functions | List of all members
xgboost::common::IndexTransformIter< Fn > Class Template Reference

Transform iterator that takes an index and calls transform operator. More...

`#include <common.h>`

Collaboration diagram for xgboost::common::IndexTransformIter< Fn >:

## Public Types
using | iterator_category = std::random_access_iterator_tag
using | value_type = std::result_of_t< Fn(size_t)>
using | difference_type = detail::ptrdiff_t
using | reference = std::add_lvalue_reference_t< value_type >
using | pointer = std::add_pointer_t< value_type >

## Public Member Functions
| IndexTransformIter (Fn &&op)
| IndexTransformIter (IndexTransformIter const &)=default
IndexTransformIter & | operator= (IndexTransformIter &&)=default
IndexTransformIter & | operator= (IndexTransformIter const &that)
value_type | operator* () const
auto | operator- (IndexTransformIter const &that) const
bool | operator== (IndexTransformIter const &that) const
bool | operator!= (IndexTransformIter const &that) const
IndexTransformIter & | operator++ ()
IndexTransformIter | operator++ (int)
IndexTransformIter & | operator+= (difference_type n)
IndexTransformIter & | operator-= (difference_type n)
IndexTransformIter | operator+ (difference_type n) const
IndexTransformIter | operator- (difference_type n) const

## Detailed Description

### template<typename Fn>
class xgboost::common::IndexTransformIter< Fn >

Transform iterator that takes an index and calls transform operator.

This is CPU-only right now as taking host device function as operator complicates the code. For device side one can use `thrust::transform_iterator` instead.

## Member Typedef Documentation

## ◆ difference_type

template<typename Fn >

using xgboost::common::IndexTransformIter< Fn >::difference_type = detail::ptrdiff_t

## ◆ iterator_category

template<typename Fn >

using xgboost::common::IndexTransformIter< Fn >::iterator_category = std::random_access_iterator_tag

## ◆ pointer

template<typename Fn >

using xgboost::common::IndexTransformIter< Fn >::pointer = std::add_pointer_t<value_type>

## ◆ reference

template<typename Fn >

using xgboost::common::IndexTransformIter< Fn >::reference = std::add_lvalue_reference_t<value_type>

## ◆ value_type

template<typename Fn >

using xgboost::common::IndexTransformIter< Fn >::value_type = std::result_of_t<Fn(size_t)>

## Constructor & Destructor Documentation

## ◆ IndexTransformIter() [1/2]

template<typename Fn >

xgboost::common::IndexTransformIter< Fn >::IndexTransformIter | ( | Fn && | op | ) |
| inline explicit

Parameters

  op | Transform operator, takes a size_t index as input.

## ◆ IndexTransformIter() [2/2]

template<typename Fn >

xgboost::common::IndexTransformIter< Fn >::IndexTransformIter | ( | IndexTransformIter< Fn > const & |  | ) |
| default

## Member Function Documentation

## ◆ operator!=()

template<typename Fn >

bool xgboost::common::IndexTransformIter< Fn >::operator!= | ( | IndexTransformIter< Fn > const & | that | ) | const
| inline

## ◆ operator*()

template<typename Fn >

value_type xgboost::common::IndexTransformIter< Fn >::operator* | ( |  | ) | const
| inline

## ◆ operator+()

template<typename Fn >

IndexTransformIter xgboost::common::IndexTransformIter< Fn >::operator+ | ( | difference_type | n | ) | const
| inline

## ◆ operator++() [1/2]

template<typename Fn >

IndexTransformIter& xgboost::common::IndexTransformIter< Fn >::operator++ | ( |  | ) |
| inline

## ◆ operator++() [2/2]

template<typename Fn >

IndexTransformIter xgboost::common::IndexTransformIter< Fn >::operator++ | ( | int |  | ) |
| inline

## ◆ operator+=()

template<typename Fn >

IndexTransformIter& xgboost::common::IndexTransformIter< Fn >::operator+= | ( | difference_type | n | ) |
| inline

## ◆ operator-() [1/2]

template<typename Fn >

IndexTransformIter xgboost::common::IndexTransformIter< Fn >::operator- | ( | difference_type | n | ) | const
| inline

## ◆ operator-() [2/2]

template<typename Fn >

auto xgboost::common::IndexTransformIter< Fn >::operator- | ( | IndexTransformIter< Fn > const & | that | ) | const
| inline

## ◆ operator-=()

template<typename Fn >

IndexTransformIter& xgboost::common::IndexTransformIter< Fn >::operator-= | ( | difference_type | n | ) |
| inline

## ◆ operator=() [1/2]

template<typename Fn >

IndexTransformIter& xgboost::common::IndexTransformIter< Fn >::operator= | ( | IndexTransformIter< Fn > && |  | ) |
| default

## ◆ operator=() [2/2]

template<typename Fn >

IndexTransformIter& xgboost::common::IndexTransformIter< Fn >::operator= | ( | IndexTransformIter< Fn > const & | that | ) |
| inline

## ◆ operator==()

template<typename Fn >

bool xgboost::common::IndexTransformIter< Fn >::operator== | ( | IndexTransformIter< Fn > const & | that | ) | const
| inline

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

- /home/runner/work/xgboost/xgboost/src/common/common.h