TiledArray  0.7.0
TiledArray::BlockRange Class Reference

Range that references a subblock of another range. More...

#include <block_range.h>

Inheritance diagram for TiledArray::BlockRange:
Collaboration diagram for TiledArray::BlockRange:

Public Member Functions

 BlockRange ()=default
 
 BlockRange (const BlockRange &)=default
 
 BlockRange (BlockRange &&)=default
 
 ~BlockRange ()=default
 
BlockRangeoperator= (const BlockRange &)=default
 
BlockRangeoperator= (BlockRange &&)=default
 
template<typename Index >
 BlockRange (const Range &range, const Index &lower_bound, const Index &upper_bound)
 
 BlockRange (const Range &range, const std::initializer_list< size_type > &lower_bound, const std::initializer_list< size_type > &upper_bound)
 
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 i More...
 
template<typename... Index, typename std::enable_if<(sizeof...(Index) > 1ul>
ordinal_type ordinal (const Index &... index) const
 
ordinal_type ordinal (ordinal_type index) const
 calculate the coordinate index of the ordinal index, index. More...
 
template<typename Index >
BlockRangeresize (const Index &, const Index &)
 Resize of block range is not supported. More...
 
template<typename Index >
Range_inplace_shift (const Index &)
 Shift the lower and upper bound of this range. More...
 
template<typename Index >
Range_ shift (const Index &)
 Shift the lower and upper bound of this range. More...
 
void swap (BlockRange &other)
 
template<typename Archive >
void serialize (const Archive &ar) const
 Serialization Block range. More...
 
- Public Member Functions inherited from TiledArray::Range
 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)
 

Additional Inherited Members

- Public Types inherited from TiledArray::Range
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...
 
- Protected Attributes inherited from TiledArray::Range
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...
 

Detailed Description

Range that references a subblock of another range.

Definition at line 34 of file block_range.h.

Constructor & Destructor Documentation

◆ BlockRange() [1/5]

TiledArray::BlockRange::BlockRange ( )
default

◆ BlockRange() [2/5]

TiledArray::BlockRange::BlockRange ( const BlockRange )
default

◆ BlockRange() [3/5]

TiledArray::BlockRange::BlockRange ( BlockRange &&  )
default

◆ ~BlockRange()

TiledArray::BlockRange::~BlockRange ( )
default

◆ BlockRange() [4/5]

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

Definition at line 105 of file block_range.h.

◆ BlockRange() [5/5]

TiledArray::BlockRange::BlockRange ( const Range range,
const std::initializer_list< size_type > &  lower_bound,
const std::initializer_list< size_type > &  upper_bound 
)
inline

Definition at line 113 of file block_range.h.

Member Function Documentation

◆ inplace_shift()

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

Shift the lower and upper bound of this range.

Warning
This function is here to shadow the base class inplace_shift function, and disable it.

Definition at line 185 of file block_range.h.

◆ operator=() [1/2]

BlockRange& TiledArray::BlockRange::operator= ( const BlockRange )
default

◆ operator=() [2/2]

BlockRange& TiledArray::BlockRange::operator= ( BlockRange &&  )
default

◆ ordinal() [1/3]

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

calculate the ordinal index of i

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 130 of file block_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<(sizeof...(Index) > 1ul>
ordinal_type TiledArray::BlockRange::ordinal ( const Index &...  index) const
inline

Definition at line 136 of file block_range.h.

Here is the call graph for this function:

◆ ordinal() [3/3]

ordinal_type TiledArray::BlockRange::ordinal ( ordinal_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 147 of file block_range.h.

Here is the call graph for this function:

◆ resize()

template<typename Index >
BlockRange& TiledArray::BlockRange::resize ( const Index &  ,
const Index &   
)
inline

Resize of block range is not supported.

Definition at line 173 of file block_range.h.

◆ serialize()

template<typename Archive >
void TiledArray::BlockRange::serialize ( const Archive &  ar) const
inline

Serialization Block range.

Definition at line 207 of file block_range.h.

Here is the call graph for this function:

◆ shift()

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

Shift the lower and upper bound of this range.

Warning
This function is here to shadow the base class shift function, and disable it.

Definition at line 195 of file block_range.h.

◆ swap()

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

Definition at line 200 of file block_range.h.

Here is the call graph for this function:

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