TiledArray::TiledRange1 Class Reference

Documentation

TiledRange1 class defines a non-uniformly-tiled, contiguous, one-dimensional range. The tiling data is constructed with and stored in an array with the format {a0, a1, a2, ...}, where 0 <= a0 < a1 < a2 < ... Each tile is defined as [a0,a1), [a1,a2), ... The number of tiles in the range will be equal to one less than the number of elements in the array.

Definition at line 50 of file tiled_range1.h.

Public Types

typedef TA_1INDEX_TYPE index1_type
 
typedef std::pair< index1_type, index1_typerange_type
 
typedef std::vector< range_type >::const_iterator const_iterator
 

Public Member Functions

 TiledRange1 ()
 
template<typename RandIter , typename std::enable_if< detail::is_random_iterator< RandIter >::value >::type * = nullptr>
 TiledRange1 (RandIter first, RandIter last)
 
 TiledRange1 (const TiledRange1 &rng)=default
 Copy constructor. More...
 
 TiledRange1 (TiledRange1 &&rng)=default
 Move constructor. More...
 
template<typename... _sizes>
 TiledRange1 (const index1_type &t0, const _sizes &... t_rest)
 Construct a 1D tiled range. More...
 
template<typename Integer , typename = std::enable_if_t<std::is_integral_v<Integer>>>
 TiledRange1 (const std::initializer_list< Integer > &list)
 Construct a 1D tiled range. More...
 
TiledRange1operator= (const TiledRange1 &rng)=default
 Copy assignment operator. More...
 
TiledRange1operator= (TiledRange1 &&rng)=default
 Move assignment operator. More...
 
const_iterator begin () const
 Returns an iterator to the first tile in the range. More...
 
const_iterator end () const
 Returns an iterator to the end of the range. More...
 
bool empty () const
 Returns true if this range is empty (i.e. has no tiles) More...
 
const_iterator find (const index1_type &e) const
 Return tile iterator associated with ordinal_index. More...
 
const range_typetiles () const
 
const range_typetiles_range () const
 Tile range accessor. More...
 
const range_typeelements () const
 
const range_typeelements_range () const
 Elements range accessor. More...
 
index1_type tile_extent () const
 Tile range extent accessor. More...
 
index1_type extent () const
 Elements range extent accessor. More...
 
const range_typetile (const index1_type i) const
 Tile range accessor. More...
 
const index1_typeelement_to_tile (const index1_type &i) const
 Maps element index to tile index. More...
 
const index1_typeelement2tile (const index1_type &i) const
 
void swap (TiledRange1 &other)
 swapper More...
 
template<typename Archive , typename std::enable_if< madness::archive::is_input_archive< Archive >::value >::type * = nullptr>
void serialize (const Archive &ar)
 
template<typename Archive , typename std::enable_if< madness::archive::is_output_archive< Archive >::value >::type * = nullptr>
void serialize (const Archive &ar) const
 

Friends

std::ostream & operator<< (std::ostream &, const TiledRange1 &)
 TiledRange1 ostream operator. More...
 

Member Typedef Documentation

◆ const_iterator

Definition at line 57 of file tiled_range1.h.

◆ index1_type

typedef TA_1INDEX_TYPE TiledArray::TiledRange1::index1_type

Definition at line 55 of file tiled_range1.h.

◆ range_type

Definition at line 56 of file tiled_range1.h.

Constructor & Destructor Documentation

◆ TiledRange1() [1/6]

TiledArray::TiledRange1::TiledRange1 ( )
inline

Default constructor creates an empty range (tile and element ranges are both [0,0))

Postcondition
assert(tr.tiles_range() == (TiledRange1::range_type{0,0}));
assert(tr.elements_range() == (TiledRange1::range_type{0,0}));
assert(tr.begin() == tr.end());

Definition at line 66 of file tiled_range1.h.

◆ TiledRange1() [2/6]

template<typename RandIter , typename std::enable_if< detail::is_random_iterator< RandIter >::value >::type * = nullptr>
TiledArray::TiledRange1::TiledRange1 ( RandIter  first,
RandIter  last 
)
inlineexplicit

Constructs a range with the boundaries provided by the range [ first , last ).

Note
validity of the [ first , last ) range is checked using TA_ASSERT() only if preprocessor macro NDEBUG is not defined

Definition at line 76 of file tiled_range1.h.

◆ TiledRange1() [3/6]

TiledArray::TiledRange1::TiledRange1 ( const TiledRange1 rng)
default

Copy constructor.

◆ TiledRange1() [4/6]

TiledArray::TiledRange1::TiledRange1 ( TiledRange1 &&  rng)
default

Move constructor.

◆ TiledRange1() [5/6]

template<typename... _sizes>
TiledArray::TiledRange1::TiledRange1 ( const index1_type t0,
const _sizes &...  t_rest 
)
inlineexplicit

Construct a 1D tiled range.

This will construct a 1D tiled range with tile boundaries {t0 , t_rest... } The number of tile boundaries is n + 1, where n is the number of tiles. Tiles are defined as [t0, t1), [t1, t2), [t2, t3), ...

Parameters
t0The starting index of the first tile
t_restThe rest of tile boundaries
Note
validity of the {t0 , t_rest... } range is checked using TA_ASSERT() only if preprocessor macro NDEBUG is not defined

Definition at line 98 of file tiled_range1.h.

◆ TiledRange1() [6/6]

template<typename Integer , typename = std::enable_if_t<std::is_integral_v<Integer>>>
TiledArray::TiledRange1::TiledRange1 ( const std::initializer_list< Integer > &  list)
inlineexplicit

Construct a 1D tiled range.

This will construct a 1D tiled range with tile boundaries {t0 , t_rest... } The number of tile boundaries is n + 1, where n is the number of tiles. Tiles are defined as [t0 , t1), [t1, t2), [t2, t3), ... Tiles are indexed starting with 0.

Template Parameters
IntegerAn integral type
Parameters
listThe list of tile boundaries in order from smallest to largest
Note
validity of the {t0 , t_rest... } range is checked using TA_ASSERT() only if preprocessor macro NDEBUG is not defined

Definition at line 117 of file tiled_range1.h.

Member Function Documentation

◆ begin()

const_iterator TiledArray::TiledRange1::begin ( ) const
inline

Returns an iterator to the first tile in the range.

Definition at line 128 of file tiled_range1.h.

Here is the caller graph for this function:

◆ element2tile()

const index1_type& TiledArray::TiledRange1::element2tile ( const index1_type i) const
inline
Deprecated:
use TiledRange1::element_to_tile()

Definition at line 203 of file tiled_range1.h.

Here is the call graph for this function:

◆ element_to_tile()

const index1_type& TiledArray::TiledRange1::element_to_tile ( const index1_type i) const
inline

Maps element index to tile index.

Parameters
ielement index
Returns
tile index
Precondition
assert(i >= elements_range().first && i < elements_range().second);
Note
element->tile map is memoized, thus complexity of the first call is linear in the number of elements, complexity of subsequent calls is constant. Note that the memoization assumes infrequent (or serial) use as it is serialized across ALL TiledRange1 instances.

Definition at line 194 of file tiled_range1.h.

Here is the caller graph for this function:

◆ elements()

const range_type& TiledArray::TiledRange1::elements ( ) const
inline

◆ elements_range()

const range_type& TiledArray::TiledRange1::elements_range ( ) const
inline

Elements range accessor.

Returns
a reference to the element index range

Definition at line 158 of file tiled_range1.h.

Here is the caller graph for this function:

◆ empty()

bool TiledArray::TiledRange1::empty ( ) const
inline

Returns true if this range is empty (i.e. has no tiles)

Definition at line 134 of file tiled_range1.h.

Here is the caller graph for this function:

◆ end()

const_iterator TiledArray::TiledRange1::end ( ) const
inline

Returns an iterator to the end of the range.

Definition at line 131 of file tiled_range1.h.

Here is the caller graph for this function:

◆ extent()

index1_type TiledArray::TiledRange1::extent ( ) const
inline

Elements range extent accessor.

Definition at line 164 of file tiled_range1.h.

◆ find()

const_iterator TiledArray::TiledRange1::find ( const index1_type e) const
inline

Return tile iterator associated with ordinal_index.

Definition at line 137 of file tiled_range1.h.

Here is the call graph for this function:

◆ operator=() [1/2]

TiledRange1& TiledArray::TiledRange1::operator= ( const TiledRange1 rng)
default

Copy assignment operator.

◆ operator=() [2/2]

TiledRange1& TiledArray::TiledRange1::operator= ( TiledRange1 &&  rng)
default

Move assignment operator.

◆ serialize() [1/2]

template<typename Archive , typename std::enable_if< madness::archive::is_input_archive< Archive >::value >::type * = nullptr>
void TiledArray::TiledRange1::serialize ( const Archive &  ar)
inline

Definition at line 221 of file tiled_range1.h.

◆ serialize() [2/2]

template<typename Archive , typename std::enable_if< madness::archive::is_output_archive< Archive >::value >::type * = nullptr>
void TiledArray::TiledRange1::serialize ( const Archive &  ar) const
inline

Definition at line 228 of file tiled_range1.h.

◆ swap()

void TiledArray::TiledRange1::swap ( TiledRange1 other)
inline

swapper

Parameters
otherthe range with which the contents of this range will be swapped

Definition at line 211 of file tiled_range1.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tile()

const range_type& TiledArray::TiledRange1::tile ( const index1_type  i) const
inline

Tile range accessor.

Parameters
itile index
Returns
A const reference to the range of tile i
Precondition
assert(i >= tiles_range().first && i < tiles_range().second);

Definition at line 176 of file tiled_range1.h.

Here is the caller graph for this function:

◆ tile_extent()

index1_type TiledArray::TiledRange1::tile_extent ( ) const
inline

Tile range extent accessor.

Definition at line 161 of file tiled_range1.h.

Here is the caller graph for this function:

◆ tiles()

const range_type& TiledArray::TiledRange1::tiles ( ) const
inline
Deprecated:
use TiledRange1::tiles_range()

Definition at line 145 of file tiled_range1.h.

◆ tiles_range()

const range_type& TiledArray::TiledRange1::tiles_range ( ) const
inline

Tile range accessor.

Returns
a reference to the tile index range

Definition at line 150 of file tiled_range1.h.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const TiledRange1 rng 
)
friend

TiledRange1 ostream operator.

Definition at line 323 of file tiled_range1.h.


The documentation for this class was generated from the following file:
const range_type & elements_range() const
Elements range accessor.
Definition: tiled_range1.h:158
std::pair< index1_type, index1_type > range_type
Definition: tiled_range1.h:56
const range_type & tiles_range() const
Tile range accessor.
Definition: tiled_range1.h:150