Medial Code Documentation
Loading...
Searching...
No Matches
Public Types | Public Member Functions
xgboost::common::IndexTransformIter< Fn > Class Template Reference

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

#include <transform_iterator.h>

Public Types

using iterator_category = std::random_access_iterator_tag
 
using reference = std::result_of_t< Fn(std::size_t)>
 
using value_type = std::remove_cv_t< std::remove_reference_t< reference > >
 
using difference_type = detail::ptrdiff_t
 
using pointer = std::add_pointer_t< value_type >
 

Public Member Functions

 IndexTransformIter (Fn &&op)
 
 IndexTransformIter (IndexTransformIter const &)=default
 
IndexTransformIteroperator= (IndexTransformIter &&)=default
 
IndexTransformIteroperator= (IndexTransformIter const &that)
 
reference operator* () const
 
reference operator[] (std::size_t i) const
 
auto operator- (IndexTransformIter const &that) const
 
bool operator== (IndexTransformIter const &that) const
 
bool operator!= (IndexTransformIter const &that) const
 
IndexTransformIteroperator++ ()
 
IndexTransformIter operator++ (int)
 
IndexTransformIteroperator+= (difference_type n)
 
IndexTransformIteroperator-= (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.

Constructor & Destructor Documentation

◆ IndexTransformIter()

template<typename Fn >
xgboost::common::IndexTransformIter< Fn >::IndexTransformIter ( Fn &&  op)
inlineexplicit
Parameters
opTransform operator, takes a size_t index as input.

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