TiledArray::detail::ArrayImpl< Tile, Policy > Class Template Reference
Inheritance diagram for TiledArray::detail::ArrayImpl< Tile, Policy >:
Collaboration diagram for TiledArray::detail::ArrayImpl< Tile, Policy >:

Documentation

template<typename Tile, typename Policy>
class TiledArray::detail::ArrayImpl< Tile, Policy >

Tensor implementation and base for other tensor implementation objects.

This implementation object holds the data for tensor object, which includes tiled range, shape, and tiles. The tiles are held in a distributed container, stored according to a given process map.

Template Parameters
TileThe tile or value_type of this tensor
Note
The process map must be set before data elements can be set.
It is the users responsibility to ensure the process maps on all nodes are identical.

Definition at line 410 of file array_impl.h.

Public Types

typedef ArrayImpl< Tile, Policy > ArrayImpl_
 This object type. More...
 
typedef TensorImpl< Policy > TensorImpl_
 The base class of this object. More...
 
typedef TensorImpl_::index1_type index1_type
 1-index type More...
 
typedef TensorImpl_::ordinal_type ordinal_type
 Ordinal type. More...
 
typedef TensorImpl_::policy_type policy_type
 Policy type for this object. More...
 
typedef TensorImpl_::trange_type trange_type
 Tiled range type for this object. More...
 
typedef TensorImpl_::range_type range_type
 Elements/tiles range type. More...
 
typedef TensorImpl_::shape_type shape_type
 Shape type. More...
 
typedef TensorImpl_::pmap_interface pmap_interface
 process map interface type More...
 
typedef Tile value_type
 Tile or data type. More...
 
typedef eval_trait< Tile >::type eval_type
 The tile evaluation type. More...
 
typedef numeric_type< value_type >::type numeric_type
 the numeric type that supports Tile More...
 
typedef DistributedStorage< value_typestorage_type
 The data container type. More...
 
typedef storage_type::future future
 Future tile type. More...
 
typedef TileReference< ArrayImpl_reference
 Tile reference type. More...
 
typedef TileConstReference< ArrayImpl_const_reference
 Tile constant reference type. More...
 
typedef ArrayIterator< ArrayImpl_, referenceiterator
 Iterator type. More...
 
typedef ArrayIterator< const ArrayImpl_, const_referenceconst_iterator
 Constant iterator type. More...
 
- Public Types inherited from TiledArray::detail::TensorImpl< Policy >
typedef TensorImpl< Policy > TensorImpl_
 
typedef Policy policy_type
 Policy type. More...
 
typedef Policy::trange_type trange_type
 Tiled range type. More...
 
typedef Policy::range_type range_type
 Element/tile range type. More...
 
typedef Policy::index1_type index1_type
 1-index type More...
 
typedef Policy::ordinal_type ordinal_type
 Ordinal type. More...
 
typedef Policy::shape_type shape_type
 Tensor shape type. More...
 
typedef Policy::pmap_interface pmap_interface
 Process map interface type. More...
 

Public Member Functions

 ArrayImpl (World &world, const trange_type &trange, const shape_type &shape, const std::shared_ptr< pmap_interface > &pmap)
 Constructor. More...
 
virtual ~ArrayImpl ()
 Virtual destructor. More...
 
template<typename Index , typename = std::enable_if_t<std::is_integral_v<Index> || detail::is_integral_range_v<Index>>>
future get (const Index &i) const
 Tile future accessor. More...
 
template<typename Integer , typename = std::enable_if_t<std::is_integral_v<Integer>>>
future get (const std::initializer_list< Integer > &i) const
 Tile future accessor. More...
 
template<typename Index , typename = std::enable_if_t<std::is_integral_v<Index> || detail::is_integral_range_v<Index>>>
const futureget_local (const Index &i) const
 Local tile future accessor. More...
 
template<typename Integer , typename = std::enable_if_t<std::is_integral_v<Integer>>>
const futureget_local (const std::initializer_list< Integer > &i) const
 Local tile future accessor. More...
 
template<typename Index , typename = std::enable_if_t<std::is_integral_v<Index> || detail::is_integral_range_v<Index>>>
futureget_local (const Index &i)
 Local tile future accessor. More...
 
template<typename Integer , typename = std::enable_if_t<std::is_integral_v<Integer>>>
futureget_local (const std::initializer_list< Integer > &i)
 Local tile future accessor. More...
 
template<typename Index , typename Value , typename = std::enable_if_t<std::is_integral_v<Index> || detail::is_integral_range_v<Index>>>
void set (const Index &i, Value &&value)
 Set tile. More...
 
template<typename Index , typename Value , typename = std::enable_if_t<std::is_integral_v<Index>>>
void set (const std::initializer_list< Index > &i, Value &&value)
 Set tile. More...
 
iterator begin ()
 Array begin iterator. More...
 
const_iterator cbegin () const
 Array begin iterator. More...
 
iterator end ()
 Array end iterator. More...
 
const_iterator cend () const
 Array end iterator. More...
 
const madness::uniqueidT & id () const
 Unique object id accessor. More...
 
- Public Member Functions inherited from TiledArray::detail::TensorImpl< Policy >
 TensorImpl (World &world, const trange_type &trange, const shape_type &shape, const std::shared_ptr< pmap_interface > &pmap)
 Constructor. More...
 
virtual ~TensorImpl ()
 Virtual destructor. More...
 
const std::shared_ptr< pmap_interface > & pmap () const
 Tensor process map accessor. More...
 
const range_typetiles_range () const
 Tiles range accessor. More...
 
ordinal_type size () const
 Tensor tile volume accessor. More...
 
ordinal_type local_size () const
 Local element count. More...
 
template<typename Index >
ProcessID owner (const Index &i) const
 Query a tile owner. More...
 
template<typename Index >
bool is_local (const Index &i) const
 Query for a locally owned tile. More...
 
template<typename Index >
bool is_zero (const Index &i) const
 Query for a zero tile. More...
 
bool is_dense () const
 Query the density of the tensor. More...
 
const shape_typeshape () const
 Tensor shape accessor. More...
 
const trange_typetrange () const
 Tiled range accessor. More...
 
World & get_world () const
 
World & world () const
 World accessor. More...
 

Static Public Member Functions

static std::function< void(const ArrayImpl_ &, int64_t)> & set_notifier_accessor ()
 

Member Typedef Documentation

◆ ArrayImpl_

template<typename Tile , typename Policy >
typedef ArrayImpl<Tile, Policy> TiledArray::detail::ArrayImpl< Tile, Policy >::ArrayImpl_

This object type.

Definition at line 412 of file array_impl.h.

◆ const_iterator

template<typename Tile , typename Policy >
typedef ArrayIterator<const ArrayImpl_, const_reference> TiledArray::detail::ArrayImpl< Tile, Policy >::const_iterator

Constant iterator type.

Definition at line 438 of file array_impl.h.

◆ const_reference

template<typename Tile , typename Policy >
typedef TileConstReference<ArrayImpl_> TiledArray::detail::ArrayImpl< Tile, Policy >::const_reference

Tile constant reference type.

Definition at line 435 of file array_impl.h.

◆ eval_type

template<typename Tile , typename Policy >
typedef eval_trait<Tile>::type TiledArray::detail::ArrayImpl< Tile, Policy >::eval_type

The tile evaluation type.

Definition at line 427 of file array_impl.h.

◆ future

template<typename Tile , typename Policy >
typedef storage_type::future TiledArray::detail::ArrayImpl< Tile, Policy >::future

Future tile type.

Definition at line 432 of file array_impl.h.

◆ index1_type

template<typename Tile , typename Policy >
typedef TensorImpl_::index1_type TiledArray::detail::ArrayImpl< Tile, Policy >::index1_type

1-index type

Definition at line 414 of file array_impl.h.

◆ iterator

template<typename Tile , typename Policy >
typedef ArrayIterator<ArrayImpl_, reference> TiledArray::detail::ArrayImpl< Tile, Policy >::iterator

Iterator type.

Definition at line 436 of file array_impl.h.

◆ numeric_type

template<typename Tile , typename Policy >
typedef numeric_type<value_type>::type TiledArray::detail::ArrayImpl< Tile, Policy >::numeric_type

the numeric type that supports Tile

Definition at line 429 of file array_impl.h.

◆ ordinal_type

template<typename Tile , typename Policy >
typedef TensorImpl_::ordinal_type TiledArray::detail::ArrayImpl< Tile, Policy >::ordinal_type

Ordinal type.

Definition at line 415 of file array_impl.h.

◆ pmap_interface

template<typename Tile , typename Policy >
typedef TensorImpl_::pmap_interface TiledArray::detail::ArrayImpl< Tile, Policy >::pmap_interface

process map interface type

Definition at line 424 of file array_impl.h.

◆ policy_type

template<typename Tile , typename Policy >
typedef TensorImpl_::policy_type TiledArray::detail::ArrayImpl< Tile, Policy >::policy_type

Policy type for this object.

Definition at line 417 of file array_impl.h.

◆ range_type

template<typename Tile , typename Policy >
typedef TensorImpl_::range_type TiledArray::detail::ArrayImpl< Tile, Policy >::range_type

Elements/tiles range type.

Definition at line 421 of file array_impl.h.

◆ reference

template<typename Tile , typename Policy >
typedef TileReference<ArrayImpl_> TiledArray::detail::ArrayImpl< Tile, Policy >::reference

Tile reference type.

Definition at line 433 of file array_impl.h.

◆ shape_type

template<typename Tile , typename Policy >
typedef TensorImpl_::shape_type TiledArray::detail::ArrayImpl< Tile, Policy >::shape_type

Shape type.

Definition at line 422 of file array_impl.h.

◆ storage_type

template<typename Tile , typename Policy >
typedef DistributedStorage<value_type> TiledArray::detail::ArrayImpl< Tile, Policy >::storage_type

The data container type.

Definition at line 431 of file array_impl.h.

◆ TensorImpl_

template<typename Tile , typename Policy >
typedef TensorImpl<Policy> TiledArray::detail::ArrayImpl< Tile, Policy >::TensorImpl_

The base class of this object.

Definition at line 413 of file array_impl.h.

◆ trange_type

template<typename Tile , typename Policy >
typedef TensorImpl_::trange_type TiledArray::detail::ArrayImpl< Tile, Policy >::trange_type

Tiled range type for this object.

Definition at line 419 of file array_impl.h.

◆ value_type

template<typename Tile , typename Policy >
typedef Tile TiledArray::detail::ArrayImpl< Tile, Policy >::value_type

Tile or data type.

Definition at line 425 of file array_impl.h.

Constructor & Destructor Documentation

◆ ArrayImpl()

template<typename Tile , typename Policy >
TiledArray::detail::ArrayImpl< Tile, Policy >::ArrayImpl ( World &  world,
const trange_type trange,
const shape_type shape,
const std::shared_ptr< pmap_interface > &  pmap 
)
inline

Constructor.

The size of shape must be equal to the volume of the tiled range tiles.

Parameters
worldThe world where this tensor will live
trangeThe tiled range for this tensor
shapeThe shape of this tensor
pmapThe tile-process map
Exceptions
TiledArray::ExceptionWhen the size of shape is not equal to zero

Definition at line 453 of file array_impl.h.

◆ ~ArrayImpl()

template<typename Tile , typename Policy >
virtual TiledArray::detail::ArrayImpl< Tile, Policy >::~ArrayImpl ( )
inlinevirtual

Virtual destructor.

Definition at line 459 of file array_impl.h.

Member Function Documentation

◆ begin()

template<typename Tile , typename Policy >
iterator TiledArray::detail::ArrayImpl< Tile, Policy >::begin ( )
inline

Array begin iterator.

Returns
A const iterator to the first local element of the array.

Definition at line 583 of file array_impl.h.

Here is the call graph for this function:

◆ cbegin()

template<typename Tile , typename Policy >
const_iterator TiledArray::detail::ArrayImpl< Tile, Policy >::cbegin ( ) const
inline

Array begin iterator.

Returns
A const iterator to the first local element of the array.

Definition at line 599 of file array_impl.h.

Here is the call graph for this function:

◆ cend()

template<typename Tile , typename Policy >
const_iterator TiledArray::detail::ArrayImpl< Tile, Policy >::cend ( ) const
inline

Array end iterator.

Returns
A const iterator to one past the last local element of the array.

Definition at line 620 of file array_impl.h.

Here is the call graph for this function:

◆ end()

template<typename Tile , typename Policy >
iterator TiledArray::detail::ArrayImpl< Tile, Policy >::end ( )
inline

Array end iterator.

Returns
A const iterator to one past the last local element of the array.

Definition at line 615 of file array_impl.h.

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

◆ get() [1/2]

template<typename Tile , typename Policy >
template<typename Index , typename = std::enable_if_t<std::is_integral_v<Index> || detail::is_integral_range_v<Index>>>
future TiledArray::detail::ArrayImpl< Tile, Policy >::get ( const Index &  i) const
inline

Tile future accessor.

Template Parameters
IndexAn integral or integral range type
Parameters
iThe tile index or ordinal
Returns
A future to tile i
Exceptions
TiledArray::ExceptionWhen tile i is zero

Definition at line 470 of file array_impl.h.

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

◆ get() [2/2]

template<typename Tile , typename Policy >
template<typename Integer , typename = std::enable_if_t<std::is_integral_v<Integer>>>
future TiledArray::detail::ArrayImpl< Tile, Policy >::get ( const std::initializer_list< Integer > &  i) const
inline

Tile future accessor.

Template Parameters
IntegerAn integral type
Parameters
iThe tile index, as an std::initializer_list<Integer>
Returns
A future to tile i
Exceptions
TiledArray::ExceptionWhen tile i is zero

Definition at line 483 of file array_impl.h.

◆ get_local() [1/4]

template<typename Tile , typename Policy >
template<typename Index , typename = std::enable_if_t<std::is_integral_v<Index> || detail::is_integral_range_v<Index>>>
future& TiledArray::detail::ArrayImpl< Tile, Policy >::get_local ( const Index &  i)
inline

Local tile future accessor.

Template Parameters
IndexAn integral or integral range type
Parameters
iThe tile index or ordinal
Returns
A future to tile i
Exceptions
TiledArray::ExceptionWhen tile i is zero or not local

Definition at line 522 of file array_impl.h.

Here is the call graph for this function:

◆ get_local() [2/4]

template<typename Tile , typename Policy >
template<typename Index , typename = std::enable_if_t<std::is_integral_v<Index> || detail::is_integral_range_v<Index>>>
const future& TiledArray::detail::ArrayImpl< Tile, Policy >::get_local ( const Index &  i) const
inline

Local tile future accessor.

Template Parameters
IndexAn integral or integral range type
Parameters
iThe tile index or ordinal
Returns
A future to tile i
Exceptions
TiledArray::ExceptionWhen tile i is zero or not local

Definition at line 496 of file array_impl.h.

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

◆ get_local() [3/4]

template<typename Tile , typename Policy >
template<typename Integer , typename = std::enable_if_t<std::is_integral_v<Integer>>>
future& TiledArray::detail::ArrayImpl< Tile, Policy >::get_local ( const std::initializer_list< Integer > &  i)
inline

Local tile future accessor.

Template Parameters
IntegerAn integral type
Parameters
iThe tile index, as an std::initializer_list<Integer>
Returns
A future to tile i
Exceptions
TiledArray::ExceptionWhen tile i is zero or not local

Definition at line 535 of file array_impl.h.

◆ get_local() [4/4]

template<typename Tile , typename Policy >
template<typename Integer , typename = std::enable_if_t<std::is_integral_v<Integer>>>
const future& TiledArray::detail::ArrayImpl< Tile, Policy >::get_local ( const std::initializer_list< Integer > &  i) const
inline

Local tile future accessor.

Template Parameters
IntegerAn integral type
Parameters
iThe tile index, as an std::initializer_list<Integer>
Returns
A future to tile i
Exceptions
TiledArray::ExceptionWhen tile i is zero or not local

Definition at line 509 of file array_impl.h.

◆ id()

template<typename Tile , typename Policy >
const madness::uniqueidT& TiledArray::detail::ArrayImpl< Tile, Policy >::id ( ) const
inline

Unique object id accessor.

Returns
A const reference to this object unique id

Definition at line 627 of file array_impl.h.

◆ set() [1/2]

template<typename Tile , typename Policy >
template<typename Index , typename Value , typename = std::enable_if_t<std::is_integral_v<Index> || detail::is_integral_range_v<Index>>>
void TiledArray::detail::ArrayImpl< Tile, Policy >::set ( const Index &  i,
Value &&  value 
)
inline

Set tile.

Set the tile at i with value . Value type may be value_type , Future<value_type> , or madness::detail::MoveWrapper<value_type> .

Template Parameters
IndexAn integral or integral range type
ValueThe value type
Parameters
iThe index of the tile to be set
valueThe object tat contains the tile value

Definition at line 551 of file array_impl.h.

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

◆ set() [2/2]

template<typename Tile , typename Policy >
template<typename Index , typename Value , typename = std::enable_if_t<std::is_integral_v<Index>>>
void TiledArray::detail::ArrayImpl< Tile, Policy >::set ( const std::initializer_list< Index > &  i,
Value &&  value 
)
inline

Set tile.

Set the tile at i with value . Value type may be value_type , Future<value_type> , or madness::detail::MoveWrapper<value_type> .

Template Parameters
IndexAn integral type
ValueThe value type
Parameters
iThe index of the tile to be set
valueThe object tat contains the tile value

Definition at line 571 of file array_impl.h.

Here is the call graph for this function:

◆ set_notifier_accessor()

template<typename Tile , typename Policy >
static std::function<void(const ArrayImpl_&, int64_t)>& TiledArray::detail::ArrayImpl< Tile, Policy >::set_notifier_accessor ( )
inlinestatic

Definition at line 630 of file array_impl.h.

Here is the caller graph for this function:

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