TiledArray  0.7.0
TiledArray::TiledRange1 Class Reference

#include <tiled_range1.h>

Public Types

typedef std::size_t size_type
 
typedef std::pair< size_type, size_typerange_type
 
typedef std::vector< range_type >::const_iterator const_iterator
 

Public Member Functions

 TiledRange1 ()
 Default constructor, range of 0 tiles and elements. More...
 
template<typename RandIter , typename std::enable_if< detail::is_random_iterator< RandIter >::value >::type * = nullptr>
 TiledRange1 (RandIter first, RandIter last)
 
 TiledRange1 (const TiledRange1 &rng)
 Copy constructor. More...
 
template<typename... _sizes>
 TiledRange1 (const size_type &t0, const _sizes &... t_rest)
 Construct a 1D tiled range. More...
 
 TiledRange1 (const std::initializer_list< size_type > &list)
 Construct a 1D tiled range. More...
 
TiledRange1operator= (const TiledRange1 &rng)
 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...
 
const_iterator find (const size_type &e) const
 Return tile iterator associated with ordinal_index. More...
 
DEPRECATED 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...
 
size_type tile_extent () const
 Tile range extent accessor. More...
 
size_type extent () const
 Elements range extent accessor. More...
 
const range_typetile (const size_type i) const
 Tile range accessor. More...
 
const size_typeelement_to_tile (const size_type &i) const
 
DEPRECATED const size_typeelement2tile (const size_type &i) const
 
void swap (TiledRange1 &other)
 

Friends

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

Detailed Description

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 35 of file tiled_range1.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 41 of file tiled_range1.h.

◆ range_type

Definition at line 40 of file tiled_range1.h.

◆ size_type

Definition at line 39 of file tiled_range1.h.

Constructor & Destructor Documentation

◆ TiledRange1() [1/5]

TiledArray::TiledRange1::TiledRange1 ( )
inline

Default constructor, range of 0 tiles and elements.

Definition at line 44 of file tiled_range1.h.

Here is the caller graph for this function:

◆ TiledRange1() [2/5]

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

Constructs a range with the boundaries provided by [first, last). Start_tile_index is the index of the first tile.

Definition at line 55 of file tiled_range1.h.

◆ TiledRange1() [3/5]

TiledArray::TiledRange1::TiledRange1 ( const TiledRange1 rng)
inline

Copy constructor.

Definition at line 63 of file tiled_range1.h.

◆ TiledRange1() [4/5]

template<typename... _sizes>
TiledArray::TiledRange1::TiledRange1 ( const size_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

Definition at line 76 of file tiled_range1.h.

◆ TiledRange1() [5/5]

TiledArray::TiledRange1::TiledRange1 ( const std::initializer_list< size_type > &  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), ...

Parameters
listThe list of tile boundaries in order from smallest to largest

Definition at line 90 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 103 of file tiled_range1.h.

Here is the caller graph for this function:

◆ element2tile()

DEPRECATED const size_type& TiledArray::TiledRange1::element2tile ( const size_type i) const
inline

Definition at line 154 of file tiled_range1.h.

Here is the call graph for this function:

◆ element_to_tile()

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

Definition at line 149 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 131 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 106 of file tiled_range1.h.

Here is the caller graph for this function:

◆ extent()

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

Elements range extent accessor.

Definition at line 137 of file tiled_range1.h.

◆ find()

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

Return tile iterator associated with ordinal_index.

Definition at line 109 of file tiled_range1.h.

Here is the call graph for this function:

◆ operator=()

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

Assignment operator.

Definition at line 97 of file tiled_range1.h.

Here is the call graph for this function:

◆ swap()

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

Definition at line 158 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 size_type  i) const
inline

Tile range accessor.

Parameters
iThe coordinate index for the tile range to be returned
Returns
A const reference to a the tile range for tile i
Exceptions
std::out_of_rangeWhen i >= tiles().size()

Definition at line 144 of file tiled_range1.h.

◆ tile_extent()

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

Tile range extent accessor.

Definition at line 134 of file tiled_range1.h.

◆ tiles()

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

Definition at line 118 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 123 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 236 of file tiled_range1.h.


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