mpqc::utility::TupleGenerator< R, HostRange, Container, ConstHostRangePtr > Class Template Reference
Collaboration diagram for mpqc::utility::TupleGenerator< R, HostRange, Container, ConstHostRangePtr >:

Documentation

template<size_t R, typename HostRange, typename Container, typename ConstHostRangePtr = const HostRange*>
class mpqc::utility::TupleGenerator< R, HostRange, Container, ConstHostRangePtr >

Generates ordered rank-R tuples of elements from a host range of size >= R. E.g., TupleGenerator<2> over {0,1,2,3} produces sequence {{0,1},{0,2},{0,3},{1,2},{1,3},{2,3}}.

Template Parameters
Rtuple rank; R=0 is supported
HostRangea range type
Valuethe type of values produced; should be a container type that can hold elements of HostRange
ConstHostRangePtra pointer type to const HostRange used to refer to the HostRange object; defaults to const HostRange*, can accept std::shared_ptr<const HostRange>, std::unique_ptr<const HostRange>, and std::optional<HostRange>
Note
For R=0 the range size is 1.

Public Types

using base_type = utility::GeneratorRangeFacade< TupleGenerator< R, HostRange, Container, ConstHostRangePtr >, Container >
 
using value_type = Container
 
using Index = std::array< std::int64_t, std::max(size_t{1}, R)>
 
- Public Types inherited from mpqc::utility::GeneratorRangeFacade< TupleGenerator< R, HostRange, Container, const HostRange * >, Container >
typedef GeneratorIterator< TupleGenerator< R, HostRange, Container, const HostRange * >, TupleGenerator< R, HostRange, Container, const HostRange * > *, Container > iterator
 
typedef GeneratorIterator< TupleGenerator< R, HostRange, Container, const HostRange * >, TupleGenerator< R, HostRange, Container, const HostRange * > *, const Container > const_iterator
 

Public Member Functions

 TupleGenerator (ConstHostRangePtr hostptr, Index idx)
 
 TupleGenerator (ConstHostRangePtr hostptr)
 
 TupleGenerator (const TupleGenerator &)=default
 
 TupleGenerator (TupleGenerator &&)=default
 
TupleGeneratoroperator= (const TupleGenerator &)=default
 
TupleGeneratoroperator= (TupleGenerator &&)=default
 
const ConstHostRangePtr & host_range_ptr () const
 
 operator bool () const
 
TupleGeneratoroperator++ ()
 
const value_typeoperator* () const
 
bool operator== (const TupleGenerator &other) const
 
const_iterator begin ()
 
const_iterator end () const
 
- Public Member Functions inherited from mpqc::utility::GeneratorRangeFacade< TupleGenerator< R, HostRange, Container, const HostRange * >, Container >
const_iterator begin ()
 
const_iterator end () const
 

Static Public Member Functions

static TupleGenerator make_end (ConstHostRangePtr hostptr)
 

Member Typedef Documentation

◆ base_type

template<size_t R, typename HostRange , typename Container , typename ConstHostRangePtr = const HostRange*>
using mpqc::utility::TupleGenerator< R, HostRange, Container, ConstHostRangePtr >::base_type = utility::GeneratorRangeFacade< TupleGenerator<R, HostRange, Container, ConstHostRangePtr>, Container>

◆ Index

template<size_t R, typename HostRange , typename Container , typename ConstHostRangePtr = const HostRange*>
using mpqc::utility::TupleGenerator< R, HostRange, Container, ConstHostRangePtr >::Index = std::array<std::int64_t, std::max(size_t{1}, R)>

for rank-0 need 1 element to be able to distinguish first and last elements

◆ value_type

template<size_t R, typename HostRange , typename Container , typename ConstHostRangePtr = const HostRange*>
using mpqc::utility::TupleGenerator< R, HostRange, Container, ConstHostRangePtr >::value_type = Container

Constructor & Destructor Documentation

◆ TupleGenerator() [1/4]

template<size_t R, typename HostRange , typename Container , typename ConstHostRangePtr = const HostRange*>
mpqc::utility::TupleGenerator< R, HostRange, Container, ConstHostRangePtr >::TupleGenerator ( ConstHostRangePtr  hostptr,
Index  idx 
)
inline

constructs a generator that will start from the given index idx

Parameters
[in]hostptrpointer to the host range
[in]idxindices of the elements of the host range that constitute the current tuple value
Precondition
hostptr != nullptr && size(*hostptr) > 0

◆ TupleGenerator() [2/4]

template<size_t R, typename HostRange , typename Container , typename ConstHostRangePtr = const HostRange*>
mpqc::utility::TupleGenerator< R, HostRange, Container, ConstHostRangePtr >::TupleGenerator ( ConstHostRangePtr  hostptr)
inline

constructs a generator that will start from the beginning

Parameters
[in]hostptrpointer to the host range

◆ TupleGenerator() [3/4]

template<size_t R, typename HostRange , typename Container , typename ConstHostRangePtr = const HostRange*>
mpqc::utility::TupleGenerator< R, HostRange, Container, ConstHostRangePtr >::TupleGenerator ( const TupleGenerator< R, HostRange, Container, ConstHostRangePtr > &  )
default

◆ TupleGenerator() [4/4]

template<size_t R, typename HostRange , typename Container , typename ConstHostRangePtr = const HostRange*>
mpqc::utility::TupleGenerator< R, HostRange, Container, ConstHostRangePtr >::TupleGenerator ( TupleGenerator< R, HostRange, Container, ConstHostRangePtr > &&  )
default

Member Function Documentation

◆ begin()

template<size_t R, typename HostRange , typename Container , typename ConstHostRangePtr = const HostRange*>
const_iterator mpqc::utility::GeneratorRangeFacade< Generator, Value >::begin
inline

◆ end()

template<size_t R, typename HostRange , typename Container , typename ConstHostRangePtr = const HostRange*>
const_iterator mpqc::utility::GeneratorRangeFacade< Generator, Value >::end
inline

◆ host_range_ptr()

template<size_t R, typename HostRange , typename Container , typename ConstHostRangePtr = const HostRange*>
const ConstHostRangePtr& mpqc::utility::TupleGenerator< R, HostRange, Container, ConstHostRangePtr >::host_range_ptr ( ) const
inline
Returns
const reference to the host range pointer

◆ make_end()

template<size_t R, typename HostRange , typename Container , typename ConstHostRangePtr = const HostRange*>
static TupleGenerator mpqc::utility::TupleGenerator< R, HostRange, Container, ConstHostRangePtr >::make_end ( ConstHostRangePtr  hostptr)
inlinestatic

constructs a generator that will point to the end

Parameters
[in]hostptrpointer to the host range

◆ operator bool()

template<size_t R, typename HostRange , typename Container , typename ConstHostRangePtr = const HostRange*>
mpqc::utility::TupleGenerator< R, HostRange, Container, ConstHostRangePtr >::operator bool ( ) const
inlineexplicit
Returns
true if not at the end

◆ operator*()

template<size_t R, typename HostRange , typename Container , typename ConstHostRangePtr = const HostRange*>
const value_type& mpqc::utility::TupleGenerator< R, HostRange, Container, ConstHostRangePtr >::operator* ( ) const
inline

◆ operator++()

template<size_t R, typename HostRange , typename Container , typename ConstHostRangePtr = const HostRange*>
TupleGenerator& mpqc::utility::TupleGenerator< R, HostRange, Container, ConstHostRangePtr >::operator++ ( )
inline

◆ operator=() [1/2]

template<size_t R, typename HostRange , typename Container , typename ConstHostRangePtr = const HostRange*>
TupleGenerator& mpqc::utility::TupleGenerator< R, HostRange, Container, ConstHostRangePtr >::operator= ( const TupleGenerator< R, HostRange, Container, ConstHostRangePtr > &  )
default

◆ operator=() [2/2]

template<size_t R, typename HostRange , typename Container , typename ConstHostRangePtr = const HostRange*>
TupleGenerator& mpqc::utility::TupleGenerator< R, HostRange, Container, ConstHostRangePtr >::operator= ( TupleGenerator< R, HostRange, Container, ConstHostRangePtr > &&  )
default

◆ operator==()

template<size_t R, typename HostRange , typename Container , typename ConstHostRangePtr = const HostRange*>
bool mpqc::utility::TupleGenerator< R, HostRange, Container, ConstHostRangePtr >::operator== ( const TupleGenerator< R, HostRange, Container, ConstHostRangePtr > &  other) const
inline

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