TiledArray  0.7.0
TiledArray::Range Class Reference

A (hyperrectangular) interval on $ Z^n $, space of integer n-indices. More...

#include <range.h>

Inheritance diagram for TiledArray::Range:

Public Types

typedef Range Range_
 This object type. More...
 
typedef std::size_t size_type
 Size type. More...
 
typedef std::vector< size_typeindex
 Coordinate index type. More...
 
typedef index index_type
 Coordinate index type, to conform Tensor Working Group spec. More...
 
typedef detail::SizeArray< const size_typesize_array
 Size array type. More...
 
typedef size_array extent_type
 Range extent type, to conform Tensor Working Group spec. More...
 
typedef std::size_t ordinal_type
 Ordinal type, to conform Tensor Working Group spec. More...
 
typedef detail::RangeIterator< size_type, Range_const_iterator
 Coordinate iterator. More...
 

Public Member Functions

 Range ()
 Default constructor. More...
 
template<typename Index , typename std::enable_if<! std::is_integral< Index >::value >::type * = nullptr>
 Range (const Index &lower_bound, const Index &upper_bound)
 Construct range defined by upper and lower bound sequences. More...
 
template<typename Index1 , typename std::enable_if< std::is_integral< Index1 >::value >::type * = nullptr>
 Range (const std::initializer_list< Index1 > &lower_bound, const std::initializer_list< Index1 > &upper_bound)
 Construct range defined by the upper and lower bound sequences. More...
 
template<typename Index , typename std::enable_if<! std::is_integral< Index >::value &&std::is_integral< typename Index::value_type >::value >::type * = nullptr>
 Range (const Index &extent)
 Range constructor from a sequence of extents. More...
 
template<typename Index1 , typename std::enable_if< std::is_integral< Index1 >::value >::type * = nullptr>
 Range (const std::initializer_list< Index1 > &extent)
 Range constructor from an initializer list of extents. More...
 
template<typename Index , typename std::enable_if<! std::is_integral< Index >::value &&detail::is_pair< typename Index::value_type >::value >::type * = nullptr>
 Range (const Index &bounds)
 Construct range defined by a sequence of {lower,upper} bound pairs. More...
 
template<typename Index1 , typename Index2 >
 Range (const std::initializer_list< std::pair< Index1, Index2 >> &bounds)
 Construct range defined by an initializer_list of {lower,upper} bound pairs. More...
 
template<typename... Index, typename std::enable_if< detail::is_integral_list< Index... >::value >::type * = nullptr>
 Range (const Index... extents)
 Range constructor from a pack of extents for each dimension. More...
 
template<typename ... IndexPairs, typename std::enable_if< detail::is_integral_pair_list< IndexPairs... >::value >::type * = nullptr>
 Range (const IndexPairs... bounds)
 Range constructor from a pack of {lo,up} bounds for each dimension. More...
 
 Range (const Range_ &other)
 Copy Constructor. More...
 
 Range (Range_ &&other)
 Copy Constructor. More...
 
 Range (const Permutation &perm, const Range_ &other)
 Permuting copy constructor. More...
 
 ~Range ()
 Destructor. More...
 
Range_operator= (const Range_ &other)
 Copy assignment operator. More...
 
Range_operator= (Range_ &&other)
 Move assignment operator. More...
 
unsigned int rank () const
 Rank accessor. More...
 
const size_typelobound_data () const
 Range lower bound data accessor. More...
 
size_array lobound () const
 Range lower bound accessor. More...
 
size_type lobound (size_t dim) const
 Range lower bound element accessor. More...
 
const size_typeupbound_data () const
 Range upper bound data accessor. More...
 
size_array upbound () const
 Range upper bound accessor. More...
 
size_type upbound (size_t dim) const
 Range upped bound element accessor. More...
 
const size_typeextent_data () const
 Range extent data accessor. More...
 
extent_type extent () const
 Range extent accessor. More...
 
size_type extent (size_t dim) const
 Range extent element accessor. More...
 
const size_typestride_data () const
 Range stride data accessor. More...
 
size_array stride () const
 Range stride accessor. More...
 
size_type stride (size_t dim) const
 Range stride element accessor. More...
 
ordinal_type volume () const
 Range volume accessor. More...
 
ordinal_type area () const
 
ordinal_type offset () const
 Range offset. More...
 
const_iterator begin () const
 Index iterator factory. More...
 
const_iterator end () const
 Index iterator factory. More...
 
template<typename Index , typename std::enable_if<! std::is_integral< Index >::value, bool >::type * = nullptr>
bool includes (const Index &index) const
 Check the coordinate to make sure it is within the range. More...
 
template<typename Integer >
bool includes (const std::initializer_list< Integer > &index) const
 Check the coordinate to make sure it is within the range. More...
 
template<typename Ordinal >
std::enable_if< std::is_integral< Ordinal >::value, bool >::type includes (Ordinal i) const
 Check the ordinal index to make sure it is within the range. More...
 
template<typename... Index>
std::enable_if<(sizeof...(Index) > 1ul), size_type >::type includes (const Index &... index) const
 
Range_operator*= (const Permutation &perm)
 Permute this range. More...
 
template<typename Index >
Range_resize (const Index &lower_bound, const Index &upper_bound)
 Resize range to a new upper and lower bound. More...
 
template<typename Index >
Range_inplace_shift (const Index &bound_shift)
 Shift the lower and upper bound of this range. More...
 
template<typename Index >
Range_ shift (const Index &bound_shift)
 Shift the lower and upper bound of this range. More...
 
ordinal_type ordinal (const ordinal_type index) const
 calculate the ordinal index of i More...
 
template<typename Index , typename std::enable_if<! std::is_integral< Index >::value >::type * = nullptr>
ordinal_type ordinal (const Index &index) const
 calculate the ordinal index of index More...
 
template<typename... Index, typename std::enable_if<(sizeof...(Index) > 1ul>
size_type ordinal (const Index &... index) const
 calculate the ordinal index of index More...
 
index idx (size_type index) const
 calculate the coordinate index of the ordinal index, index. More...
 
template<typename Index , typename std::enable_if<! std::is_integral< Index >::value >::type * = nullptr>
const Index & idx (const Index &i) const
 calculate the index of i 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
 
void swap (Range_ &other)
 

Protected Attributes

size_typedata_ = nullptr
 
size_type offset_ = 0ul
 Ordinal index offset correction. More...
 
size_type volume_ = 0ul
 Total number of elements. More...
 
unsigned int rank_ = 0u
 The rank (or number of dimensions) in the range. More...
 

Friends

class detail::RangeIterator< size_type, Range_ >
 

Detailed Description

A (hyperrectangular) interval on $ Z^n $, space of integer n-indices.

This object represents an n-dimensional, hyperrectangular array of integers. It provides information on the rank (number of dimensions), (nonnegative) lower bound, upper bound, extent (size), and stride of each dimension. It can also be used to test if an element is included in the range with a coordinate index or ordinal offset. Finally, it can be used to convert coordinate indices to ordinal offsets and vice versa. TODO add Range support for negative indices

Definition at line 39 of file range.h.

Member Typedef Documentation

◆ const_iterator

Coordinate iterator.

Definition at line 48 of file range.h.

◆ extent_type

Range extent type, to conform Tensor Working Group spec.

Definition at line 46 of file range.h.

◆ index

typedef std::vector<size_type> TiledArray::Range::index

Coordinate index type.

Definition at line 43 of file range.h.

◆ index_type

Coordinate index type, to conform Tensor Working Group spec.

Definition at line 44 of file range.h.

◆ ordinal_type

typedef std::size_t TiledArray::Range::ordinal_type

Ordinal type, to conform Tensor Working Group spec.

Definition at line 47 of file range.h.

◆ Range_

This object type.

Definition at line 41 of file range.h.

◆ size_array

Size array type.

Definition at line 45 of file range.h.

◆ size_type

typedef std::size_t TiledArray::Range::size_type

Size type.

Definition at line 42 of file range.h.

Constructor & Destructor Documentation

◆ Range() [1/12]

TiledArray::Range::Range ( )
inline

Default constructor.

Construct a range that has zero rank, volume, and size.

Definition at line 293 of file range.h.

◆ Range() [2/12]

template<typename Index , typename std::enable_if<! std::is_integral< Index >::value >::type * = nullptr>
TiledArray::Range::Range ( const Index &  lower_bound,
const Index &  upper_bound 
)
inline

Construct range defined by upper and lower bound sequences.

Construct a range defined by lower_bound and upper_bound.

Template Parameters
IndexAn array type
Parameters
lower_boundA sequence of lower bounds for each dimension
upper_boundA sequence of upper bounds for each dimension
Exceptions
TiledArray::ExceptionWhen the size of lower_bound is not equal to that of upper_bound.
TiledArray::ExceptionWhen lower_bound[i] >= upper_bound[i]
std::bad_allocWhen memory allocation fails.

Definition at line 307 of file range.h.

Here is the call graph for this function:

◆ Range() [3/12]

template<typename Index1 , typename std::enable_if< std::is_integral< Index1 >::value >::type * = nullptr>
TiledArray::Range::Range ( const std::initializer_list< Index1 > &  lower_bound,
const std::initializer_list< Index1 > &  upper_bound 
)
inline

Construct range defined by the upper and lower bound sequences.

Construct a range defined by lower_bound and upper_bound.

Parameters
lower_boundAn initializer list of lower bounds for each dimension
upper_boundAn initializer list of upper bounds for each dimension
Exceptions
TiledArray::ExceptionWhen the size of lower_bound is not equal to that of upper_bound.
TiledArray::ExceptionWhen lower_bound[i] >= upper_bound[i]
std::bad_allocWhen memory allocation fails.

Definition at line 329 of file range.h.

Here is the call graph for this function:

◆ Range() [4/12]

template<typename Index , typename std::enable_if<! std::is_integral< Index >::value &&std::is_integral< typename Index::value_type >::value >::type * = nullptr>
TiledArray::Range::Range ( const Index &  extent)
inlineexplicit

Range constructor from a sequence of extents.

Construct a range with a lower bound of zero and an upper bound equal to extents.

Template Parameters
IndexA vector type
Parameters
extentA vector that defines the size of each dimension
Exceptions
std::bad_allocWhen memory allocation fails.

Definition at line 352 of file range.h.

Here is the call graph for this function:

◆ Range() [5/12]

template<typename Index1 , typename std::enable_if< std::is_integral< Index1 >::value >::type * = nullptr>
TiledArray::Range::Range ( const std::initializer_list< Index1 > &  extent)
inlineexplicit

Range constructor from an initializer list of extents.

Construct a range with a lower bound of zero and an upper bound equal to extent.

Parameters
extentAn initializer list that defines the size of each dimension
Exceptions
std::bad_allocWhen memory allocation fails.

Definition at line 370 of file range.h.

Here is the call graph for this function:

◆ Range() [6/12]

template<typename Index , typename std::enable_if<! std::is_integral< Index >::value &&detail::is_pair< typename Index::value_type >::value >::type * = nullptr>
TiledArray::Range::Range ( const Index &  bounds)
inline

Construct range defined by a sequence of {lower,upper} bound pairs.

Template Parameters
IndexAn array (contiguous sequence) type
Parameters
lower_boundA sequence of lower bounds for each dimension
upper_boundA sequence of upper bounds for each dimension
Exceptions
TiledArray::ExceptionWhen the size of lower_bound is not equal to that of upper_bound.
TiledArray::ExceptionWhen lower_bound[i] >= upper_bound[i]
std::bad_allocWhen memory allocation fails.

Definition at line 392 of file range.h.

Here is the call graph for this function:

◆ Range() [7/12]

template<typename Index1 , typename Index2 >
TiledArray::Range::Range ( const std::initializer_list< std::pair< Index1, Index2 >> &  bounds)
inline

Construct range defined by an initializer_list of {lower,upper} bound pairs.

Template Parameters
IndexAn initializer list type
Parameters
lower_boundA sequence of lower bounds for each dimension
upper_boundA sequence of upper bounds for each dimension
Exceptions
TiledArray::ExceptionWhen the size of lower_bound is not equal to that of upper_bound.
TiledArray::ExceptionWhen lower_bound[i] >= upper_bound[i]
std::bad_allocWhen memory allocation fails.

Definition at line 412 of file range.h.

Here is the call graph for this function:

◆ Range() [8/12]

template<typename... Index, typename std::enable_if< detail::is_integral_list< Index... >::value >::type * = nullptr>
TiledArray::Range::Range ( const Index...  extents)
inlineexplicit

Range constructor from a pack of extents for each dimension.

Template Parameters
IndexPack of integer types
Parameters
extentsA pack of extents for each dimension
Postcondition
Range has a lower bound of 0, and an upper bound of (extents...).
Exceptions
std::bad_allocWhen memory allocation fails.

Definition at line 430 of file range.h.

◆ Range() [9/12]

template<typename ... IndexPairs, typename std::enable_if< detail::is_integral_pair_list< IndexPairs... >::value >::type * = nullptr>
TiledArray::Range::Range ( const IndexPairs...  bounds)
inlineexplicit

Range constructor from a pack of {lo,up} bounds for each dimension.

Template Parameters
IndexPairsPack of std::pair's of integer types
Parameters
extentsA pack of pairs of lobound and upbound for each dimension
Exceptions
std::bad_allocWhen memory allocation fails.

Definition at line 442 of file range.h.

◆ Range() [10/12]

TiledArray::Range::Range ( const Range_ other)
inline

Copy Constructor.

Parameters
otherThe range to be copied
Exceptions
std::bad_allocWhen memory allocation fails.

Definition at line 451 of file range.h.

◆ Range() [11/12]

TiledArray::Range::Range ( Range_ &&  other)
inline

Copy Constructor.

Parameters
otherThe range to be copied
Exceptions
std::bad_allocWhen memory allocation fails.

Definition at line 465 of file range.h.

◆ Range() [12/12]

TiledArray::Range::Range ( const Permutation perm,
const Range_ other 
)
inline

Permuting copy constructor.

Parameters
permThe permutation applied to other
otherThe range to be permuted and copied
Exceptions
std::bad_allocWhen memory allocation fails.

Definition at line 480 of file range.h.

Here is the call graph for this function:

◆ ~Range()

TiledArray::Range::~Range ( )
inline

Destructor.

Definition at line 499 of file range.h.

Member Function Documentation

◆ area()

ordinal_type TiledArray::Range::area ( ) const
inline

alias to volume() to conform to the Tensor Working Group specification

Returns
The total number of elements in the range.
Exceptions
nothing

Definition at line 647 of file range.h.

◆ begin()

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

Index iterator factory.

The iterator dereferences to an index. The order of iteration matches the data layout of a dense tensor.

Returns
An iterator that holds the lower bound index of a tensor
Exceptions
nothing

Definition at line 662 of file range.h.

◆ end()

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

Index iterator factory.

The iterator dereferences to an index. The order of iteration matches the data layout of a dense tensor.

Returns
An iterator that holds the lower bound element index of a tensor
Exceptions
nothing

Definition at line 670 of file range.h.

◆ extent() [1/2]

extent_type TiledArray::Range::extent ( ) const
inline

Range extent accessor.

Returns
A extent_type that contains the extent for each dimension of the block range.
Exceptions
nothing

Definition at line 601 of file range.h.

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

◆ extent() [2/2]

size_type TiledArray::Range::extent ( size_t  dim) const
inline

Range extent element accessor.

Returns
The extent of dimension dim.
Exceptions
nothing

Definition at line 609 of file range.h.

Here is the call graph for this function:

◆ extent_data()

const size_type* TiledArray::Range::extent_data ( ) const
inline

Range extent data accessor.

Returns
A pointer to the extent data (see extent())
Exceptions
nothing

Definition at line 594 of file range.h.

Here is the caller graph for this function:

◆ idx() [1/2]

index TiledArray::Range::idx ( size_type  index) const
inline

calculate the coordinate index of the ordinal index, index.

Convert an ordinal index to a coordinate index.

Parameters
indexOrdinal index
Returns
The index of the ordinal index
Exceptions
TiledArray::ExceptionWhen index is not included in this range
std::bad_allocWhen memory allocation fails

Definition at line 877 of file range.h.

Here is the call graph for this function:

◆ idx() [2/2]

template<typename Index , typename std::enable_if<! std::is_integral< Index >::value >::type * = nullptr>
const Index& TiledArray::Range::idx ( const Index &  i) const
inline

calculate the index of i

This function is just a pass-through so the user can call idx() on a template parameter that can be an index or an ordinal_type.

Parameters
iThe index
Returns
i (unchanged)

Definition at line 913 of file range.h.

Here is the call graph for this function:

◆ includes() [1/4]

template<typename Index , typename std::enable_if<! std::is_integral< Index >::value, bool >::type * = nullptr>
bool TiledArray::Range::includes ( const Index &  index) const
inline

Check the coordinate to make sure it is within the range.

Template Parameters
IndexThe coordinate index array type
Parameters
indexThe coordinate index to check for inclusion in the range
Returns
true when i >= lobound and i < upbound, otherwise false
Exceptions
TiledArray::ExceptionWhen the rank of this range is not equal to the size of the index.

Definition at line 682 of file range.h.

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

◆ includes() [2/4]

template<typename Integer >
bool TiledArray::Range::includes ( const std::initializer_list< Integer > &  index) const
inline

Check the coordinate to make sure it is within the range.

Template Parameters
IntegerAn integer type
Parameters
indexThe element index to check for inclusion in the range, as an std::initializer_list<Integer>
Returns
true when i >= lobound and i < upbound, otherwise false
Exceptions
TiledArray::ExceptionWhen the rank of this range is not equal to the size of the index.

Definition at line 709 of file range.h.

◆ includes() [3/4]

template<typename Ordinal >
std::enable_if<std::is_integral<Ordinal>::value, bool>::type TiledArray::Range::includes ( Ordinal  i) const
inline

Check the ordinal index to make sure it is within the range.

Parameters
iThe ordinal index to check for inclusion in the range
Returns
true when i >= 0 and i < volume
Exceptions
nothing

Definition at line 721 of file range.h.

◆ includes() [4/4]

template<typename... Index>
std::enable_if<(sizeof...(Index) > 1ul), size_type>::type TiledArray::Range::includes ( const Index &...  index) const
inline

Definition at line 727 of file range.h.

Here is the call graph for this function:

◆ inplace_shift()

template<typename Index >
Range_& TiledArray::Range::inplace_shift ( const Index &  bound_shift)
inline

Shift the lower and upper bound of this range.

Template Parameters
IndexThe shift array type
Parameters
bound_shiftThe shift to be applied to the range
Returns
A reference to this range

Definition at line 778 of file range.h.

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

◆ lobound() [1/2]

size_array TiledArray::Range::lobound ( ) const
inline

Range lower bound accessor.

Returns
A size_array that contains the lower bounds for each dimension of the block range.
Exceptions
nothing

Definition at line 555 of file range.h.

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

◆ lobound() [2/2]

size_type TiledArray::Range::lobound ( size_t  dim) const
inline

Range lower bound element accessor.

Returns
The lower bound of dimension dim.
Exceptions
nothing

Definition at line 561 of file range.h.

Here is the call graph for this function:

◆ lobound_data()

const size_type* TiledArray::Range::lobound_data ( ) const
inline

Range lower bound data accessor.

Returns
A pointer to the lower bound data (see lobound())
Exceptions
nothing

Definition at line 548 of file range.h.

Here is the caller graph for this function:

◆ offset()

ordinal_type TiledArray::Range::offset ( ) const
inline

Range offset.

The range ordinal offset is equal to the dot product of the lower bound and stride vector. It is used internally to compute ordinal offsets.

Returns
The ordinal index offset

Definition at line 654 of file range.h.

◆ operator*=()

Range & TiledArray::Range::operator*= ( const Permutation perm)
inline

Permute this range.

Parameters
permThe permutation to be applied to this range
Returns
A reference to this range
Exceptions
TiledArray::ExceptionWhen the rank of this range is not equal to the rank of the permutation.
std::bad_allocWhen memory allocation fails.

Definition at line 1031 of file range.h.

Here is the call graph for this function:

◆ operator=() [1/2]

Range_& TiledArray::Range::operator= ( const Range_ other)
inline

Copy assignment operator.

Parameters
otherThe range to be copied
Returns
A reference to this object
Exceptions
std::bad_allocWhen memory allocation fails.

Definition at line 506 of file range.h.

◆ operator=() [2/2]

Range_& TiledArray::Range::operator= ( Range_ &&  other)
inline

Move assignment operator.

Parameters
otherThe range to be copied
Returns
A reference to this object
Exceptions
nothing

Definition at line 524 of file range.h.

◆ ordinal() [1/3]

ordinal_type TiledArray::Range::ordinal ( const ordinal_type  index) const
inline

calculate the ordinal index of i

This function is just a pass-through so the user can call ordinal() on a template parameter that can be a coordinate index or an integral.

Parameters
indexOrdinal index
Returns
index (unchanged)
Exceptions
Whenindex is not included in this range

Definition at line 826 of file range.h.

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

◆ ordinal() [2/3]

template<typename Index , typename std::enable_if<! std::is_integral< Index >::value >::type * = nullptr>
ordinal_type TiledArray::Range::ordinal ( const Index &  index) const
inline

calculate the ordinal index of index

Convert a coordinate index to an ordinal index.

Template Parameters
IndexA coordinate index type (array type)
Parameters
indexThe index to be converted to an ordinal index
Returns
The ordinal index of index
Exceptions
Whenindex is not included in this range.

Definition at line 840 of file range.h.

Here is the call graph for this function:

◆ ordinal() [3/3]

template<typename... Index, typename std::enable_if<(sizeof...(Index) > 1ul>
size_type TiledArray::Range::ordinal ( const Index &...  index) const
inline

calculate the ordinal index of index

Convert a coordinate index to an ordinal index.

Template Parameters
IndexA coordinate index type (array type)
Parameters
indexThe index to be converted to an ordinal index
Returns
The ordinal index of index
Exceptions
Whenindex is not included in this range.

Definition at line 865 of file range.h.

Here is the call graph for this function:

◆ rank()

unsigned int TiledArray::Range::rank ( ) const
inline

Rank accessor.

Returns
The rank (number of dimensions) of this range
Exceptions
nothing

Definition at line 542 of file range.h.

Here is the caller graph for this function:

◆ resize()

template<typename Index >
Range_& TiledArray::Range::resize ( const Index &  lower_bound,
const Index &  upper_bound 
)
inline

Resize range to a new upper and lower bound.

Template Parameters
IndexAn array type
Parameters
lower_boundThe lower bounds of the N-dimensional range
upper_boundThe upper bound of the N-dimensional range
Returns
A reference to this range
Exceptions
TiledArray::ExceptionWhen the size of lower_bound is not equal to that of upper_bound.
TiledArray::ExceptionWhen lower_bound[i] >= upper_bound[i]
std::bad_allocWhen memory allocation fails.

Definition at line 754 of file range.h.

Here is the call graph for this function:

◆ serialize() [1/2]

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

Definition at line 920 of file range.h.

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

◆ serialize() [2/2]

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

Definition at line 939 of file range.h.

◆ shift()

template<typename Index >
Range_ TiledArray::Range::shift ( const Index &  bound_shift)
inline

Shift the lower and upper bound of this range.

Template Parameters
IndexThe shift array type
Parameters
bound_shiftThe shift to be applied to the range
Returns
A shifted copy of this range

Definition at line 813 of file range.h.

Here is the call graph for this function:

◆ stride() [1/2]

size_array TiledArray::Range::stride ( ) const
inline

Range stride accessor.

Returns
A size_array that contains the stride for each dimension of the block range.
Exceptions
nothing

Definition at line 625 of file range.h.

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

◆ stride() [2/2]

size_type TiledArray::Range::stride ( size_t  dim) const
inline

Range stride element accessor.

Returns
The stride of dimension dim.
Exceptions
nothing

Definition at line 633 of file range.h.

Here is the call graph for this function:

◆ stride_data()

const size_type* TiledArray::Range::stride_data ( ) const
inline

Range stride data accessor.

Returns
A pointer to the stride data (see stride())
Exceptions
nothing

Definition at line 618 of file range.h.

Here is the caller graph for this function:

◆ swap()

void TiledArray::Range::swap ( Range_ other)
inline

Definition at line 943 of file range.h.

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

◆ upbound() [1/2]

size_array TiledArray::Range::upbound ( ) const
inline

Range upper bound accessor.

Returns
A size_array that contains the upper bounds for each dimension of the block range.
Exceptions
nothing

Definition at line 577 of file range.h.

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

◆ upbound() [2/2]

size_type TiledArray::Range::upbound ( size_t  dim) const
inline

Range upped bound element accessor.

Returns
The upper bound of dimension dim.
Exceptions
nothing

Definition at line 585 of file range.h.

Here is the call graph for this function:

◆ upbound_data()

const size_type* TiledArray::Range::upbound_data ( ) const
inline

Range upper bound data accessor.

Returns
A pointer to the upper bound data (see upbound())
Exceptions
nothing

Definition at line 570 of file range.h.

Here is the caller graph for this function:

◆ volume()

ordinal_type TiledArray::Range::volume ( ) const
inline

Range volume accessor.

Returns
The total number of elements in the range.
Exceptions
nothing

Definition at line 642 of file range.h.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ detail::RangeIterator< size_type, Range_ >

friend class detail::RangeIterator< size_type, Range_ >
friend

Definition at line 49 of file range.h.

Member Data Documentation

◆ data_

size_type* TiledArray::Range::data_ = nullptr
protected

An array that holds the dimension information of the range. The layout of the array is:

< { lobound[0], ..., lobound[rank_ - 1],
< upbound[0], ..., upbound[rank_ - 1],
< extent[0], ..., extent[rank_ - 1],
< stride[0], ..., stride[rank_ - 1] }
<

Definition at line 53 of file range.h.

◆ offset_

size_type TiledArray::Range::offset_ = 0ul
protected

Ordinal index offset correction.

Definition at line 62 of file range.h.

◆ rank_

unsigned int TiledArray::Range::rank_ = 0u
protected

The rank (or number of dimensions) in the range.

Definition at line 64 of file range.h.

◆ volume_

size_type TiledArray::Range::volume_ = 0ul
protected

Total number of elements.

Definition at line 63 of file range.h.


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