TiledArray::DistArray< Tile, Policy > Class Template Reference

Documentation

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
class TiledArray::DistArray< Tile, Policy >

Forward declarations.

A (multidimensional) tiled array.

DistArray is the local representation of a global object. This means that the local array object will only contain a portion of the data. It may be used to construct distributed tensor algebraic operations.

Template Parameters
TThe element type of for array tiles
TileThe tile type [ Default = Tensor<T> ]

Definition at line 57 of file dist_array.h.

Public Types

typedef DistArray< Tile, Policy > DistArray_
 This object's type. More...
 
typedef TiledArray::detail::ArrayImpl< Tile, Policy > impl_type
 The type of the PIMPL. More...
 
typedef impl_type::policy_type policy_type
 Policy type. More...
 
typedef detail::numeric_type< Tile >::type numeric_type
 
typedef detail::scalar_type< Tile >::type scalar_type
 
typedef impl_type::trange_type trange_type
 Tile range type. More...
 
typedef impl_type::range_type range_type
 Elements/tiles range type. More...
 
typedef impl_type::shape_type shape_type
 Shape type for array tiling. More...
 
typedef impl_type::range_type::index1_type index1_type
 1-index type More...
 
typedef impl_type::range_type::index index
 Array coordinate index type. More...
 
typedef impl_type::ordinal_type ordinal_type
 Ordinal type. More...
 
typedef impl_type::value_type value_type
 Tile type. More...
 
typedef impl_type::eval_type eval_type
 The tile evaluation type. More...
 
typedef impl_type::reference future
 Future of value_type. More...
 
typedef impl_type::reference reference
 future type More...
 
typedef impl_type::const_reference const_reference
 future type More...
 
typedef impl_type::iterator iterator
 Local tile iterator. More...
 
typedef impl_type::const_iterator const_iterator
 Local tile const iterator. More...
 
typedef impl_type::pmap_interface pmap_interface
 Process map interface type. More...
 
typedef value_type::value_type element_type
 
template<typename OtherTile >
using is_my_type = std::is_same< DistArray_, DistArray< OtherTile, Policy > >
 
template<typename OtherTile >
using enable_if_not_my_type = std::enable_if_t< not is_my_type< OtherTile >::value >
 
template<typename Index >
using enable_if_is_integral_or_integral_range = std::enable_if_t< is_integral_or_integral_range_v< Index > >
 
template<typename Index >
using enable_if_is_integral = std::enable_if_t< std::is_integral_v< Index > >
 

Public Member Functions

 DistArray ()
 Default constructor. More...
 
 DistArray (const DistArray_ &other)
 Copy constructor. More...
 
 DistArray (World &world, const trange_type &trange, const std::shared_ptr< pmap_interface > &pmap=std::shared_ptr< pmap_interface >())
 Dense array constructor. More...
 
 DistArray (World &world, const trange_type &trange, const shape_type &shape, const std::shared_ptr< pmap_interface > &pmap=std::shared_ptr< pmap_interface >())
 Sparse array constructor. More...
 
template<typename OtherTile , typename = enable_if_not_my_type<OtherTile>>
 DistArray (const DistArray< OtherTile, Policy > &other)
 converting copy constructor More...
 
template<typename OtherTile , typename Op >
 DistArray (const DistArray< OtherTile, Policy > &other, Op &&op)
 Unary transform constructor. More...
 
 ~DistArray ()
 Destructor. More...
 
DistArray_ clone () const
 Create a deep copy of this array. More...
 
std::shared_ptr< const impl_typepimpl () const
 Accessor for the (shared_ptr to) implementation object. More...
 
std::shared_ptr< impl_typepimpl ()
 Accessor for the (shared_ptr to) implementation object. More...
 
std::weak_ptr< const impl_typeweak_pimpl () const
 Accessor for the (weak_ptr to) implementation object. More...
 
std::weak_ptr< impl_typeweak_pimpl ()
 Accessor for the (shared_ptr to) implementation object. More...
 
void wait_for_lazy_cleanup () const
 Wait for lazy tile cleanup. More...
 
DistArray_operator= (const DistArray_ &other)
 Copy assignment. More...
 
madness::uniqueidT id () const
 Global object id. More...
 
iterator begin ()
 Begin iterator factory function. More...
 
const_iterator begin () const
 Begin const iterator factory function. More...
 
iterator end ()
 End iterator factory function. More...
 
const_iterator end () const
 End const iterator factory function. More...
 
template<typename Index , typename = enable_if_is_integral_or_integral_range<Index>>
Future< value_typefind (const Index &i) const
 Find local or remote tile by index. More...
 
template<typename Integer , typename = enable_if_is_integral<Integer>>
Future< value_typefind (const std::initializer_list< Integer > &i) const
 Find local or remote tile. More...
 
template<typename Index , typename = std::enable_if_t<std::is_integral_v<Index> || detail::is_integral_range_v<Index>>>
const Future< value_type > & find_local (const Index &i) const
 Find local tile. More...
 
template<typename Integer , typename = std::enable_if_t<(std::is_integral_v<Integer>)>>
const Future< value_type > & find_local (const std::initializer_list< Integer > &i) const
 Find local tile. More...
 
template<typename Index , typename = std::enable_if_t<std::is_integral_v<Index> || detail::is_integral_range_v<Index>>>
Future< value_type > & find_local (const Index &i)
 Find local tile. More...
 
template<typename Integer , typename = std::enable_if_t<(std::is_integral_v<Integer>)>>
Future< value_type > & find_local (const std::initializer_list< Integer > &i)
 Find local tile. More...
 
template<typename Index , typename InIter , typename = std::enable_if_t<is_integral_or_integral_range_v<Index> && detail::is_input_iterator<InIter>::value>>
void set (const Index &i, InIter first)
 
template<typename Integer , typename InIter , typename = std::enable_if_t<(std::is_integral_v<Integer>)&&detail:: is_input_iterator<InIter>::value>>
std::enable_if< detail::is_input_iterator< InIter >::value >::type set (const std::initializer_list< Integer > &i, InIter first)
 
template<typename Index , typename = enable_if_is_integral_or_integral_range<Index>>
void set (const Index &i, const element_type &value=element_type())
 Set a tile and fill it using a value. More...
 
template<typename Integer , typename = enable_if_is_integral<Integer>>
void set (const std::initializer_list< Integer > &i, const element_type &value=element_type())
 Set every element of a tile to a specified value. More...
 
template<typename Index , typename Value , typename = std::enable_if_t<(is_integral_or_integral_range_v<Index> && is_value_or_future_to_value_v<Value>)>>
void set (const Index &i, Value &&v)
 Set a tile directly using a future to a tile. More...
 
template<typename Index , typename Value , typename = std::enable_if_t< (std::is_integral_v<Index>)&&is_value_or_future_to_value_v<Value>>>
void set (const std::initializer_list< Index > &i, Value &&v)
 Set a tile directly using a future to a tile. More...
 
void fill_local (const element_type &value=element_type(), bool skip_set=false)
 Fill all local tiles with the specified value. More...
 
void fill (const element_type &value=numeric_type(), bool skip_set=false)
 Fill all local tiles with the specified value. More...
 
template<typename T = element_type, typename = detail::enable_if_can_make_random_t<T>>
void fill_random (bool skip_set=false)
 
template<typename Op >
void init_tiles (Op &&op, bool skip_set=false)
 Initialize (local) tiles with a user provided functor. More...
 
template<typename Op >
void init_elements (Op &&op, bool skip_set=false)
 Initialize elements of local, non-zero tiles with a user provided functor. More...
 
const trange_typetrange () const
 Tiled range accessor. More...
 
const range_typerange () const
 Tile range accessor. More...
 
const range_typetiles_range () const
 Tile range accessor. More...
 
const trange_type::range_type & elements () const
 
const trange_type::range_type & elements_range () const
 Element range accessor. More...
 
auto size () const
 Returns the number of tiles in the tensor. More...
 
TiledArray::expressions::TsrExpr< const DistArray_, true > operator() (const std::string &vars) const
 Create a tensor expression. More...
 
TiledArray::expressions::TsrExpr< DistArray_, true > operator() (const std::string &vars)
 Create a tensor expression. More...
 
World & get_world () const
 
World & world () const
 World accessor. More...
 
const std::shared_ptr< pmap_interface > & get_pmap () const
 
const std::shared_ptr< pmap_interface > & pmap () const
 Process map accessor. More...
 
bool is_dense () const
 Check dense/sparse. More...
 
const shape_typeget_shape () const
 
const shape_typeshape () const
 Shape accessor. More...
 
template<typename Index , typename = enable_if_is_integral_or_integral_range<Index>>
ProcessID owner (const Index &i) const
 Tile ownership. More...
 
template<typename Index , typename = enable_if_is_integral<Index>>
ProcessID owner (const std::initializer_list< Index > &i) const
 Tile ownership. More...
 
template<typename Index , typename = enable_if_is_integral_or_integral_range<Index>>
bool is_local (const Index &i) const
 Check if the tile at index i is stored locally. More...
 
template<typename Index , typename = enable_if_is_integral<Index>>
bool is_local (const std::initializer_list< Index > &i) const
 Check if the tile at index i is stored locally. More...
 
template<typename Index , typename = enable_if_is_integral_or_integral_range<Index>>
bool is_zero (const Index &i) const
 Check for zero tiles. More...
 
template<typename Index , typename = enable_if_is_integral<Index>>
bool is_zero (const std::initializer_list< Index > &i) const
 Check for zero tiles. More...
 
void swap (DistArray_ &other)
 Swap this array with other. More...
 
void make_replicated ()
 
void truncate (typename shape_type::value_type thresh=shape_type::threshold())
 
bool is_initialized () const
 Check if the array is initialized. More...
 
 operator bool () const
 Conversion to bool is equivalent to DistArray::is_initialized() More...
 
template<typename Archive , typename = std::enable_if_t< !Archive::is_parallel_archive && madness::archive::is_output_archive<Archive>::value>>
void serialize (const Archive &ar) const
 serialize local contents of a DistArray to an Archive object More...
 
template<typename Archive , typename = std::enable_if_t< !Archive::is_parallel_archive && madness::archive::is_input_archive<Archive>::value>>
void serialize (const Archive &ar)
 deserialize local contents of a DistArray from an Archive object More...
 
template<typename Archive >
void load (World &world, Archive &ar)
 
template<typename Archive >
void store (Archive &ar) const
 Stores this array to an Archive object. More...
 
Initializer list constructors

Creates a new tensor containing the elements in the provided std::initializer_list.

template<typename T >
 DistArray (World &world, detail::vector_il< T > il)
 
template<typename T >
 DistArray (World &world, detail::matrix_il< T > il)
 
template<typename T >
 DistArray (World &world, detail::tensor3_il< T > il)
 
template<typename T >
 DistArray (World &world, detail::tensor4_il< T > il)
 
template<typename T >
 DistArray (World &world, detail::tensor5_il< T > il)
 
template<typename T >
 DistArray (World &world, detail::tensor6_il< T > il)
 
Tiling initializer list constructors

Constructs a new tensor containing the elements in the provided std::initializer_list.

template<typename T >
 DistArray (World &world, const trange_type &trange, detail::vector_il< T > il)
 
template<typename T >
 DistArray (World &world, const trange_type &trange, detail::matrix_il< T > il)
 
template<typename T >
 DistArray (World &world, const trange_type &trange, detail::tensor3_il< T > il)
 
template<typename T >
 DistArray (World &world, const trange_type &trange, detail::tensor4_il< T > il)
 
template<typename T >
 DistArray (World &world, const trange_type &trange, detail::tensor5_il< T > il)
 
template<typename T >
 DistArray (World &world, const trange_type &trange, detail::tensor6_il< T > il)
 

Static Public Member Functions

static void wait_for_lazy_cleanup (World &world, const double=60.0)
 Wait for lazy tile cleanup. More...
 
static void register_set_notifier (std::function< void(const impl_type &, int64_t)> notifier={})
 Debugging/tracing instrumentation. More...
 

Static Public Attributes

template<typename Index >
static constexpr bool is_integral_or_integral_range_v
 
template<typename Value >
static constexpr bool is_value_or_future_to_value_v
 

Member Typedef Documentation

◆ const_iterator

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
typedef impl_type::const_iterator TiledArray::DistArray< Tile, Policy >::const_iterator

Local tile const iterator.

Definition at line 95 of file dist_array.h.

◆ const_reference

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
typedef impl_type::const_reference TiledArray::DistArray< Tile, Policy >::const_reference

future type

Definition at line 92 of file dist_array.h.

◆ DistArray_

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
typedef DistArray<Tile, Policy> TiledArray::DistArray< Tile, Policy >::DistArray_

This object's type.

Definition at line 59 of file dist_array.h.

◆ element_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
typedef value_type::value_type TiledArray::DistArray< Tile, Policy >::element_type

The type of the elements in the tile. For a tile of type Tensor<T> this is T. Note that if the tile type is Tensor<Tensor<double>> this typedef will be Tensor<double> and NOT double like numeric_type.

Definition at line 102 of file dist_array.h.

◆ enable_if_is_integral

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Index >
using TiledArray::DistArray< Tile, Policy >::enable_if_is_integral = std::enable_if_t<std::is_integral_v<Index> >

Definition at line 125 of file dist_array.h.

◆ enable_if_is_integral_or_integral_range

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Index >
using TiledArray::DistArray< Tile, Policy >::enable_if_is_integral_or_integral_range = std::enable_if_t<is_integral_or_integral_range_v<Index> >

Definition at line 121 of file dist_array.h.

◆ enable_if_not_my_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename OtherTile >
using TiledArray::DistArray< Tile, Policy >::enable_if_not_my_type = std::enable_if_t<not is_my_type<OtherTile>::value>

Definition at line 113 of file dist_array.h.

◆ eval_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
typedef impl_type::eval_type TiledArray::DistArray< Tile, Policy >::eval_type

The tile evaluation type.

Definition at line 88 of file dist_array.h.

◆ future

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
typedef impl_type::reference TiledArray::DistArray< Tile, Policy >::future

Future of value_type.

Definition at line 89 of file dist_array.h.

◆ impl_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
typedef TiledArray::detail::ArrayImpl<Tile, Policy> TiledArray::DistArray< Tile, Policy >::impl_type

The type of the PIMPL.

Definition at line 61 of file dist_array.h.

◆ index

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
typedef impl_type::range_type::index TiledArray::DistArray< Tile, Policy >::index

Array coordinate index type.

Definition at line 84 of file dist_array.h.

◆ index1_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
typedef impl_type::range_type::index1_type TiledArray::DistArray< Tile, Policy >::index1_type

1-index type

Definition at line 82 of file dist_array.h.

◆ is_my_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename OtherTile >
using TiledArray::DistArray< Tile, Policy >::is_my_type = std::is_same<DistArray_, DistArray<OtherTile, Policy> >

These are some of the types and compile-time values needed for SFINAE. They probably should be factored out into a header file so they can be used elsewhere too.

Definition at line 110 of file dist_array.h.

◆ iterator

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
typedef impl_type::iterator TiledArray::DistArray< Tile, Policy >::iterator

Local tile iterator.

Definition at line 93 of file dist_array.h.

◆ numeric_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
typedef detail::numeric_type<Tile>::type TiledArray::DistArray< Tile, Policy >::numeric_type

Type used to hold the components of the tensors in the array. For DistArray<Tensor<double>> this will be double. Similarly for DistArray<Tensor<Tensor<double>> this will also be double. Notably for complex elements of type std::complex<T> numeric_type will be std::complex<T> and scalar_type will be T.

Definition at line 69 of file dist_array.h.

◆ ordinal_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
typedef impl_type::ordinal_type TiledArray::DistArray< Tile, Policy >::ordinal_type

Ordinal type.

Definition at line 85 of file dist_array.h.

◆ pmap_interface

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
typedef impl_type::pmap_interface TiledArray::DistArray< Tile, Policy >::pmap_interface

Process map interface type.

Definition at line 97 of file dist_array.h.

◆ policy_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
typedef impl_type::policy_type TiledArray::DistArray< Tile, Policy >::policy_type

Policy type.

Definition at line 62 of file dist_array.h.

◆ range_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
typedef impl_type::range_type TiledArray::DistArray< Tile, Policy >::range_type

Elements/tiles range type.

Definition at line 78 of file dist_array.h.

◆ reference

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
typedef impl_type::reference TiledArray::DistArray< Tile, Policy >::reference

future type

Definition at line 90 of file dist_array.h.

◆ scalar_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
typedef detail::scalar_type<Tile>::type TiledArray::DistArray< Tile, Policy >::scalar_type

Type used to hold the scalar components of numeric_type. For real-valued arrays scalar_type will be the same as numeric_type; however, for arrays with elements of type std::complex<T> scalar_type will be T.

Definition at line 74 of file dist_array.h.

◆ shape_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
typedef impl_type::shape_type TiledArray::DistArray< Tile, Policy >::shape_type

Shape type for array tiling.

Definition at line 80 of file dist_array.h.

◆ trange_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
typedef impl_type::trange_type TiledArray::DistArray< Tile, Policy >::trange_type

Tile range type.

Definition at line 76 of file dist_array.h.

◆ value_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
typedef impl_type::value_type TiledArray::DistArray< Tile, Policy >::value_type

Tile type.

Definition at line 86 of file dist_array.h.

Constructor & Destructor Documentation

◆ DistArray() [1/18]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
TiledArray::DistArray< Tile, Policy >::DistArray ( )
inline

Default constructor.

Constructs an uninitialized array object. Uninitialized arrays contain no tile or meta data. Most of the functions are not available when the array is uninitialized, but these arrays may be assign via a tensor expression assignment or the copy construction.

Definition at line 242 of file dist_array.h.

◆ DistArray() [2/18]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
TiledArray::DistArray< Tile, Policy >::DistArray ( const DistArray_ other)
inline

Copy constructor.

This is a shallow copy, that is no data is copied.

Parameters
otherThe array to be copied

Definition at line 248 of file dist_array.h.

◆ DistArray() [3/18]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
TiledArray::DistArray< Tile, Policy >::DistArray ( World &  world,
const trange_type trange,
const std::shared_ptr< pmap_interface > &  pmap = std::shared_ptr<pmap_interface>() 
)
inline

Dense array constructor.

Constructs an array with the given meta data. This constructor only initializes the array meta data; the array tiles are empty and must be assigned by the user.

Parameters
worldThe world where the array will live.
trangeThe tiled range object that will be used to set the array tiling.
pmapThe tile index -> process map

Definition at line 258 of file dist_array.h.

◆ DistArray() [4/18]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
TiledArray::DistArray< Tile, Policy >::DistArray ( World &  world,
const trange_type trange,
const shape_type shape,
const std::shared_ptr< pmap_interface > &  pmap = std::shared_ptr<pmap_interface>() 
)
inline

Sparse array constructor.

Constructs an array with the given meta data. This constructor only initializes the array meta data; the array tiles are empty and must be assigned by the user.

Parameters
worldThe world where the array will live.
trangeThe tiled range object that will be used to set the array tiling.
shapeThe array shape that defines zero and non-zero tiles
pmapThe tile index -> process map

Definition at line 272 of file dist_array.h.

◆ DistArray() [5/18]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename T >
TiledArray::DistArray< Tile, Policy >::DistArray ( World &  world,
detail::vector_il< T >  il 
)
inline

This ctor will create an array comprised of a single tile. The array will have a rank equal to the nesting of il and the elements will be those in the provided std::initializer_list. This ctor can not be used to create an empty tensor (attempts to do so will raise an error).

Template Parameters
TThe types of the elements in the std::initializer_list. Must be implicitly convertible to numeric_type.
Parameters
[in]worldThe world where the resulting array will live.
[in]ilThe initial values for the elements in the array. The elements are assumed to be listed in row-major order.
Exceptions
TiledArray::Exceptionif il contains no elements. If an exception is raised world and il are unchanged (strong throw guarantee).
TiledArray::ExceptionIf the provided std::initializer_list is not rectangular (e.g., attempting to initialize a matrix with the value {{1, 2}, {3, 4, 5}}). If an exception is raised world and il are unchanged.

Definition at line 303 of file dist_array.h.

◆ DistArray() [6/18]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename T >
TiledArray::DistArray< Tile, Policy >::DistArray ( World &  world,
detail::matrix_il< T >  il 
)
inline

This ctor will create an array comprised of a single tile. The array will have a rank equal to the nesting of il and the elements will be those in the provided std::initializer_list. This ctor can not be used to create an empty tensor (attempts to do so will raise an error).

Template Parameters
TThe types of the elements in the std::initializer_list. Must be implicitly convertible to numeric_type.
Parameters
[in]worldThe world where the resulting array will live.
[in]ilThe initial values for the elements in the array. The elements are assumed to be listed in row-major order.
Exceptions
TiledArray::Exceptionif il contains no elements. If an exception is raised world and il are unchanged (strong throw guarantee).
TiledArray::ExceptionIf the provided std::initializer_list is not rectangular (e.g., attempting to initialize a matrix with the value {{1, 2}, {3, 4, 5}}). If an exception is raised world and il are unchanged.

Definition at line 307 of file dist_array.h.

◆ DistArray() [7/18]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename T >
TiledArray::DistArray< Tile, Policy >::DistArray ( World &  world,
detail::tensor3_il< T >  il 
)
inline

This ctor will create an array comprised of a single tile. The array will have a rank equal to the nesting of il and the elements will be those in the provided std::initializer_list. This ctor can not be used to create an empty tensor (attempts to do so will raise an error).

Template Parameters
TThe types of the elements in the std::initializer_list. Must be implicitly convertible to numeric_type.
Parameters
[in]worldThe world where the resulting array will live.
[in]ilThe initial values for the elements in the array. The elements are assumed to be listed in row-major order.
Exceptions
TiledArray::Exceptionif il contains no elements. If an exception is raised world and il are unchanged (strong throw guarantee).
TiledArray::ExceptionIf the provided std::initializer_list is not rectangular (e.g., attempting to initialize a matrix with the value {{1, 2}, {3, 4, 5}}). If an exception is raised world and il are unchanged.

Definition at line 311 of file dist_array.h.

◆ DistArray() [8/18]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename T >
TiledArray::DistArray< Tile, Policy >::DistArray ( World &  world,
detail::tensor4_il< T >  il 
)
inline

This ctor will create an array comprised of a single tile. The array will have a rank equal to the nesting of il and the elements will be those in the provided std::initializer_list. This ctor can not be used to create an empty tensor (attempts to do so will raise an error).

Template Parameters
TThe types of the elements in the std::initializer_list. Must be implicitly convertible to numeric_type.
Parameters
[in]worldThe world where the resulting array will live.
[in]ilThe initial values for the elements in the array. The elements are assumed to be listed in row-major order.
Exceptions
TiledArray::Exceptionif il contains no elements. If an exception is raised world and il are unchanged (strong throw guarantee).
TiledArray::ExceptionIf the provided std::initializer_list is not rectangular (e.g., attempting to initialize a matrix with the value {{1, 2}, {3, 4, 5}}). If an exception is raised world and il are unchanged.

Definition at line 315 of file dist_array.h.

◆ DistArray() [9/18]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename T >
TiledArray::DistArray< Tile, Policy >::DistArray ( World &  world,
detail::tensor5_il< T >  il 
)
inline

This ctor will create an array comprised of a single tile. The array will have a rank equal to the nesting of il and the elements will be those in the provided std::initializer_list. This ctor can not be used to create an empty tensor (attempts to do so will raise an error).

Template Parameters
TThe types of the elements in the std::initializer_list. Must be implicitly convertible to numeric_type.
Parameters
[in]worldThe world where the resulting array will live.
[in]ilThe initial values for the elements in the array. The elements are assumed to be listed in row-major order.
Exceptions
TiledArray::Exceptionif il contains no elements. If an exception is raised world and il are unchanged (strong throw guarantee).
TiledArray::ExceptionIf the provided std::initializer_list is not rectangular (e.g., attempting to initialize a matrix with the value {{1, 2}, {3, 4, 5}}). If an exception is raised world and il are unchanged.

Definition at line 319 of file dist_array.h.

◆ DistArray() [10/18]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename T >
TiledArray::DistArray< Tile, Policy >::DistArray ( World &  world,
detail::tensor6_il< T >  il 
)
inline

This ctor will create an array comprised of a single tile. The array will have a rank equal to the nesting of il and the elements will be those in the provided std::initializer_list. This ctor can not be used to create an empty tensor (attempts to do so will raise an error).

Template Parameters
TThe types of the elements in the std::initializer_list. Must be implicitly convertible to numeric_type.
Parameters
[in]worldThe world where the resulting array will live.
[in]ilThe initial values for the elements in the array. The elements are assumed to be listed in row-major order.
Exceptions
TiledArray::Exceptionif il contains no elements. If an exception is raised world and il are unchanged (strong throw guarantee).
TiledArray::ExceptionIf the provided std::initializer_list is not rectangular (e.g., attempting to initialize a matrix with the value {{1, 2}, {3, 4, 5}}). If an exception is raised world and il are unchanged.

Definition at line 323 of file dist_array.h.

◆ DistArray() [11/18]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename T >
TiledArray::DistArray< Tile, Policy >::DistArray ( World &  world,
const trange_type trange,
detail::vector_il< T >  il 
)
inline

This ctor will create an array using the provided TiledRange instance whose values will be initialized from the provided std::initializer_list il. This ctor can not be used to create an empty tensor (attempts to do so will raise an error).

Template Parameters
TThe types of the elements in the std::initializer_list. Must be implicitly convertible to numeric_type.
Parameters
[in]worldThe world where the resulting array will live.
[in]trangeThe tiling to use for the resulting array.
[in]ilThe initial values for the elements in the array. The elements are assumed to be listed in row-major order.
Exceptions
TiledArray::Exceptionif il contains no elements. If an exception is raised world and il are unchanged (strong throw guarantee).
TiledArray::ExceptionIf the provided std::initializer_list is not rectangular (e.g., attempting to initialize a matrix with the value {{1, 2}, {3, 4, 5}}). If an exception is raised world and il are unchanged.

Definition at line 354 of file dist_array.h.

◆ DistArray() [12/18]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename T >
TiledArray::DistArray< Tile, Policy >::DistArray ( World &  world,
const trange_type trange,
detail::matrix_il< T >  il 
)
inline

This ctor will create an array using the provided TiledRange instance whose values will be initialized from the provided std::initializer_list il. This ctor can not be used to create an empty tensor (attempts to do so will raise an error).

Template Parameters
TThe types of the elements in the std::initializer_list. Must be implicitly convertible to numeric_type.
Parameters
[in]worldThe world where the resulting array will live.
[in]trangeThe tiling to use for the resulting array.
[in]ilThe initial values for the elements in the array. The elements are assumed to be listed in row-major order.
Exceptions
TiledArray::Exceptionif il contains no elements. If an exception is raised world and il are unchanged (strong throw guarantee).
TiledArray::ExceptionIf the provided std::initializer_list is not rectangular (e.g., attempting to initialize a matrix with the value {{1, 2}, {3, 4, 5}}). If an exception is raised world and il are unchanged.

Definition at line 358 of file dist_array.h.

◆ DistArray() [13/18]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename T >
TiledArray::DistArray< Tile, Policy >::DistArray ( World &  world,
const trange_type trange,
detail::tensor3_il< T >  il 
)
inline

This ctor will create an array using the provided TiledRange instance whose values will be initialized from the provided std::initializer_list il. This ctor can not be used to create an empty tensor (attempts to do so will raise an error).

Template Parameters
TThe types of the elements in the std::initializer_list. Must be implicitly convertible to numeric_type.
Parameters
[in]worldThe world where the resulting array will live.
[in]trangeThe tiling to use for the resulting array.
[in]ilThe initial values for the elements in the array. The elements are assumed to be listed in row-major order.
Exceptions
TiledArray::Exceptionif il contains no elements. If an exception is raised world and il are unchanged (strong throw guarantee).
TiledArray::ExceptionIf the provided std::initializer_list is not rectangular (e.g., attempting to initialize a matrix with the value {{1, 2}, {3, 4, 5}}). If an exception is raised world and il are unchanged.

Definition at line 362 of file dist_array.h.

◆ DistArray() [14/18]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename T >
TiledArray::DistArray< Tile, Policy >::DistArray ( World &  world,
const trange_type trange,
detail::tensor4_il< T >  il 
)
inline

This ctor will create an array using the provided TiledRange instance whose values will be initialized from the provided std::initializer_list il. This ctor can not be used to create an empty tensor (attempts to do so will raise an error).

Template Parameters
TThe types of the elements in the std::initializer_list. Must be implicitly convertible to numeric_type.
Parameters
[in]worldThe world where the resulting array will live.
[in]trangeThe tiling to use for the resulting array.
[in]ilThe initial values for the elements in the array. The elements are assumed to be listed in row-major order.
Exceptions
TiledArray::Exceptionif il contains no elements. If an exception is raised world and il are unchanged (strong throw guarantee).
TiledArray::ExceptionIf the provided std::initializer_list is not rectangular (e.g., attempting to initialize a matrix with the value {{1, 2}, {3, 4, 5}}). If an exception is raised world and il are unchanged.

Definition at line 366 of file dist_array.h.

◆ DistArray() [15/18]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename T >
TiledArray::DistArray< Tile, Policy >::DistArray ( World &  world,
const trange_type trange,
detail::tensor5_il< T >  il 
)
inline

This ctor will create an array using the provided TiledRange instance whose values will be initialized from the provided std::initializer_list il. This ctor can not be used to create an empty tensor (attempts to do so will raise an error).

Template Parameters
TThe types of the elements in the std::initializer_list. Must be implicitly convertible to numeric_type.
Parameters
[in]worldThe world where the resulting array will live.
[in]trangeThe tiling to use for the resulting array.
[in]ilThe initial values for the elements in the array. The elements are assumed to be listed in row-major order.
Exceptions
TiledArray::Exceptionif il contains no elements. If an exception is raised world and il are unchanged (strong throw guarantee).
TiledArray::ExceptionIf the provided std::initializer_list is not rectangular (e.g., attempting to initialize a matrix with the value {{1, 2}, {3, 4, 5}}). If an exception is raised world and il are unchanged.

Definition at line 370 of file dist_array.h.

◆ DistArray() [16/18]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename T >
TiledArray::DistArray< Tile, Policy >::DistArray ( World &  world,
const trange_type trange,
detail::tensor6_il< T >  il 
)
inline

This ctor will create an array using the provided TiledRange instance whose values will be initialized from the provided std::initializer_list il. This ctor can not be used to create an empty tensor (attempts to do so will raise an error).

Template Parameters
TThe types of the elements in the std::initializer_list. Must be implicitly convertible to numeric_type.
Parameters
[in]worldThe world where the resulting array will live.
[in]trangeThe tiling to use for the resulting array.
[in]ilThe initial values for the elements in the array. The elements are assumed to be listed in row-major order.
Exceptions
TiledArray::Exceptionif il contains no elements. If an exception is raised world and il are unchanged (strong throw guarantee).
TiledArray::ExceptionIf the provided std::initializer_list is not rectangular (e.g., attempting to initialize a matrix with the value {{1, 2}, {3, 4, 5}}). If an exception is raised world and il are unchanged.

Definition at line 374 of file dist_array.h.

◆ DistArray() [17/18]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename OtherTile , typename = enable_if_not_my_type<OtherTile>>
TiledArray::DistArray< Tile, Policy >::DistArray ( const DistArray< OtherTile, Policy > &  other)
inlineexplicit

converting copy constructor

This constructor uses the meta data of other to initialize the meta data of the new array. In addition, the tiles of the new array are also initialized using TiledArray::Cast<Tile,OtherTile>

Parameters
otherThe array to be copied

Definition at line 385 of file dist_array.h.

◆ DistArray() [18/18]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename OtherTile , typename Op >
TiledArray::DistArray< Tile, Policy >::DistArray ( const DistArray< OtherTile, Policy > &  other,
Op &&  op 
)
inline

Unary transform constructor.

This constructor uses the meta data of other to initialize the meta data of the new array. In addition, the tiles of the new array are also initialized using the op function/functor, which transforms each tile in other using op

Parameters
otherThe array to be copied

Definition at line 399 of file dist_array.h.

◆ ~DistArray()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
TiledArray::DistArray< Tile, Policy >::~DistArray ( )
inline

Destructor.

This is a distributed lazy destructor. The object will only be deleted after the last reference to the world object on all nodes has been destroyed.

Definition at line 408 of file dist_array.h.

Member Function Documentation

◆ begin() [1/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
iterator TiledArray::DistArray< Tile, Policy >::begin ( )
inline

Begin iterator factory function.

Returns
An iterator to the first local tile.
Exceptions
TiledArray::Exceptionif the PIMPL has not been initialized. Strong throw guarantee.

Definition at line 484 of file dist_array.h.

Here is the caller graph for this function:

◆ begin() [2/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
const_iterator TiledArray::DistArray< Tile, Policy >::begin ( ) const
inline

Begin const iterator factory function.

Returns
A const iterator to the first local tile.
Exceptions
Tiledarray::Exceptionif the PIMPL has not been initialized. Strong throw guarantee.

Definition at line 491 of file dist_array.h.

◆ clone()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
DistArray_ TiledArray::DistArray< Tile, Policy >::clone ( ) const
inline

Create a deep copy of this array.

Returns
An array that is equal to this array

Definition at line 413 of file dist_array.h.

Here is the call graph for this function:

◆ elements()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
const trange_type:: range_type& TiledArray::DistArray< Tile, Policy >::elements ( ) const
inline
Deprecated:
use DistArray::elements_range()

Definition at line 942 of file dist_array.h.

Here is the call graph for this function:

◆ elements_range()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
const trange_type::range_type& TiledArray::DistArray< Tile, Policy >::elements_range ( ) const
inline

Element range accessor.

This function returns a Range object which can be used to iterate over the indices of the tiles' elements. This should not be confused with trange() which returns an object containing the tiling information (e.g., where the tile boundaries are, or which element is in which tile) or range() which returns an object for iterating over the indices of the tiles.

Returns
A const reference to the range object for the array's elements
Exceptions
TiledArray::Exceptionif the PIMPL is not initialized. Strong throw guarantee.

Definition at line 958 of file dist_array.h.

Here is the caller graph for this function:

◆ end() [1/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
iterator TiledArray::DistArray< Tile, Policy >::end ( )
inline

End iterator factory function.

Returns
An iterator to one past the last local tile.
Exceptions
TiledArray::Exceptionif the PIMPL has not been initialized. Strong throw guarantee.

Definition at line 498 of file dist_array.h.

Here is the caller graph for this function:

◆ end() [2/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
const_iterator TiledArray::DistArray< Tile, Policy >::end ( ) const
inline

End const iterator factory function.

Returns
A const iterator to one past the last local tile.
Exceptions
TiledArray::Exceptionif the PIMPL has not been initialized. Strong throw guarantee.

Definition at line 505 of file dist_array.h.

◆ fill()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
void TiledArray::DistArray< Tile, Policy >::fill ( const element_type value = numeric_type(),
bool  skip_set = false 
)
inline

Fill all local tiles with the specified value.

Parameters
[in]valueWhat each local tile should be filled with.
[in]skip_setIf false, will throw if any tiles are already set
Exceptions
TiledArray::Exceptionif the PIMPL is uninitialized. Strong throw guarantee.
TiledArray::Exceptionif skip_set is false and a local tile is already set. Weak throw guarantee.

Definition at line 765 of file dist_array.h.

Here is the call graph for this function:

◆ fill_local()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
void TiledArray::DistArray< Tile, Policy >::fill_local ( const element_type value = element_type(),
bool  skip_set = false 
)
inline

Fill all local tiles with the specified value.

Parameters
[in]valueWhat each local tile should be filled with.
[in]skip_setIf false, will throw if any tiles are already set
Exceptions
TiledArray::Exceptionif the PIMPL is uninitialized. Strong throw guarantee.
TiledArray::Exceptionif skip_set is false and a local tile is already set. Weak throw guarantee.

Definition at line 750 of file dist_array.h.

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

◆ fill_random()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename T = element_type, typename = detail::enable_if_can_make_random_t<T>>
void TiledArray::DistArray< Tile, Policy >::fill_random ( bool  skip_set = false)
inline

Fill all local tiles with random values

This function will fill all local tiles with random values. The random values are generated by calling TiledArray::detail::MakeRandom, which can be specialized to determine how the random values for a given type are generated. It should be noted that if MakeRandom does not know how to generate random values of type T this function will be disabled via SFINAE and attempting to use it will lead to a compile-time error.

Template Parameters
TThe type of random value to generate. Defaults to element_type.
<anonymous>A template type parameter which will be deduced as void only if MakeRandom knows how to generate random values of type T. If MakeRandom does not know how to generate random values of type T, SFINAE will disable this function.
Parameters
[in]skip_setIf false, will throw if any tiles are already set
Exceptions
TiledArray::Exceptionif the PIMPL is not initialized. Strong throw guarantee.
TiledArray::Exceptionif skip_set is false and a local tile is already initialized. Weak throw guarantee.

Definition at line 792 of file dist_array.h.

Here is the call graph for this function:

◆ find() [1/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Index , typename = enable_if_is_integral_or_integral_range<Index>>
Future<value_type> TiledArray::DistArray< Tile, Policy >::find ( const Index &  i) const
inline

Find local or remote tile by index.

Template Parameters
IndexThe type of the index. Should be an integral type for an ordinal index, a type satisfying container of integral instances for a coordinate index, or an integral range type.
Parameters
[in]iThe ordinal or coordinate index of the desired tile or a range or indices.
Returns
A future to tile i
Exceptions
TiledArray::ExceptionWhen tile i is zero
TiledArray::ExceptionIf PIMPL is not initialized. Strong throw guarantee.
TiledArray::Exceptionif index i is out of bounds. Strong throw guarantee.
TiledArray::Exceptionif index i is a coordinate index with the wrong rank. Strong throw guarantee.

Definition at line 524 of file dist_array.h.

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

◆ find() [2/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Integer , typename = enable_if_is_integral<Integer>>
Future<value_type> TiledArray::DistArray< Tile, Policy >::find ( const std::initializer_list< Integer > &  i) const
inline

Find local or remote tile.

Template Parameters
IntegerAn integer type
Parameters
iAn std::initializer_list<Integer> indicating the coordinate index of the requested tile.
Returns
A future to tile i
Exceptions
TiledArray::ExceptionWhen tile i is zero
TiledArray::ExceptionIf PIMPL is not initialized. Strong throw guarantee.
TiledArray::Exceptionif index i is out of bounds. Strong throw guarantee.
TiledArray::Exceptionif index i is a coordinate index with the wrong rank. Strong throw guarantee.

Definition at line 543 of file dist_array.h.

◆ find_local() [1/4]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Index , typename = std::enable_if_t<std::is_integral_v<Index> || detail::is_integral_range_v<Index>>>
Future<value_type>& TiledArray::DistArray< Tile, Policy >::find_local ( const Index &  i)
inline

Find local tile.

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

Definition at line 583 of file dist_array.h.

Here is the call graph for this function:

◆ find_local() [2/4]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Index , typename = std::enable_if_t<std::is_integral_v<Index> || detail::is_integral_range_v<Index>>>
const Future<value_type>& TiledArray::DistArray< Tile, Policy >::find_local ( const Index &  i) const
inline

Find local tile.

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

Definition at line 556 of file dist_array.h.

Here is the call graph for this function:

◆ find_local() [3/4]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Integer , typename = std::enable_if_t<(std::is_integral_v<Integer>)>>
Future<value_type>& TiledArray::DistArray< Tile, Policy >::find_local ( const std::initializer_list< Integer > &  i)
inline

Find local tile.

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 596 of file dist_array.h.

◆ find_local() [4/4]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Integer , typename = std::enable_if_t<(std::is_integral_v<Integer>)>>
const Future<value_type>& TiledArray::DistArray< Tile, Policy >::find_local ( const std::initializer_list< Integer > &  i) const
inline

Find local tile.

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 569 of file dist_array.h.

◆ get_pmap()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
const std::shared_ptr<pmap_interface>& TiledArray::DistArray< Tile, Policy >::get_pmap ( ) const
inline
Deprecated:
use DistArray::pmap()

Definition at line 1010 of file dist_array.h.

Here is the call graph for this function:

◆ get_shape()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
const shape_type& TiledArray::DistArray< Tile, Policy >::get_shape ( ) const
inline
Deprecated:
use DistArray::shape()

Definition at line 1031 of file dist_array.h.

Here is the call graph for this function:

◆ get_world()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
World& TiledArray::DistArray< Tile, Policy >::get_world ( ) const
inline
Deprecated:
use DistArray::world()

Definition at line 1000 of file dist_array.h.

Here is the call graph for this function:

◆ id()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
madness::uniqueidT TiledArray::DistArray< Tile, Policy >::id ( ) const
inline

Global object id.

Returns
A globally unique identifier.
Exceptions
TiledArray::Exceptionif the PIMPL has not been initialized.
Note
This function is primarily used for debugging purposes. Users should not rely on this function.

Definition at line 477 of file dist_array.h.

◆ init_elements()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Op >
void TiledArray::DistArray< Tile, Policy >::init_elements ( Op &&  op,
bool  skip_set = false 
)
inline

Initialize elements of local, non-zero tiles with a user provided functor.

This function is used to initialize the elements of the local, non-zero tiles via a function (or functor). The work is done in parallel, therefore op must be a thread safe function/functor. The signature of the functor should be:

element_type op(const index&)

For example, in the following code, the array elements are initialized with random numbers from 0 to 1:

array.init_elements([] (const auto&) {
return (double)std::rand() / RAND_MAX;
});
Template Parameters
OpType of the function/functor which will generate the elements.
Parameters
[in]opThe operation used to generate elements
[in]skip_setIf false, will throw if any tiles are already set
Exceptions
TiledArray::Exceptionif the PIMPL is not initialized. Strong throw guarnatee.
TiledArray::Exceptionif skip_set is false and a local, non-zero tile is already initialized. Weak throw guarantee.

Definition at line 890 of file dist_array.h.

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

◆ init_tiles()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Op >
void TiledArray::DistArray< Tile, Policy >::init_tiles ( Op &&  op,
bool  skip_set = false 
)
inline

Initialize (local) tiles with a user provided functor.

This function is used to initialize the local, non-zero tiles of the array via a function (or functor). The work is done in parallel, therefore op must be a thread safe function/functor. The signature of the functor should be:

For example, in the following code, the array tiles are initialized with random numbers from 0 to 1:

array.init_tiles([] (const TiledArray::Range& range) ->
{
// Initialize the tile with the given range object
// Initialize the random number generator
std::default_random_engine generator;
std::uniform_real_distribution<double> distribution(0.0,1.0);
// Fill the tile with random numbers
for(auto& value : tile)
value = distribution(generator);
return tile;
});
Template Parameters
OpThe type of the functor/function
Parameters
[in]opThe operation used to generate tiles
[in]skip_setIf false, will throw if any tiles are already set
Exceptions
TiledArray::Exceptionif the PIMPL is not set. Strong throw guarantee.
TiledArray::Exceptionif a tile is already set and skip_set is false. Weak throw guarantee.

Definition at line 834 of file dist_array.h.

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

◆ is_dense()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
bool TiledArray::DistArray< Tile, Policy >::is_dense ( ) const
inline

Check dense/sparse.

Returns
true when Array is dense, false otherwise.
Exceptions
TiledArray::Exceptionif the PIMPL is not initialized. Strong throw guarantee.

Definition at line 1028 of file dist_array.h.

◆ is_initialized()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
bool TiledArray::DistArray< Tile, Policy >::is_initialized ( ) const
inline

Check if the array is initialized.

Returns
false if the array has been default initialized, otherwise true.
Exceptions
NoneNo throw guarantee.

Definition at line 1206 of file dist_array.h.

Here is the caller graph for this function:

◆ is_local() [1/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Index , typename = enable_if_is_integral_or_integral_range<Index>>
bool TiledArray::DistArray< Tile, Policy >::is_local ( const Index &  i) const
inline

Check if the tile at index i is stored locally.

Template Parameters
IndexAn integral type, a type satisfying container of integral types, or an integral range type.
Parameters
[in]iThe index of the tile whose locality is being questioned. The index may be either a coordinate or ordinal index.
Returns
true if owner(i) is equal to the MPI process rank, otherwise false.
Exceptions
TiledArray::Exceptionif the PIMPL is not initialized. Strong throw guarantee.
TiledArray::Exceptionif the index is out of bounds. Strong throw guarantee.
TiledArray::Exceptionif i is a coordinate index with the wrong rank. Strong throw guarantee.

Definition at line 1098 of file dist_array.h.

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

◆ is_local() [2/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Index , typename = enable_if_is_integral<Index>>
bool TiledArray::DistArray< Tile, Policy >::is_local ( const std::initializer_list< Index > &  i) const
inline

Check if the tile at index i is stored locally.

Template Parameters
IndexAn integral type
Parameters
[in]iThe coordinate index of the tile whose locality is being questioned.
Returns
true if owner(i) is equal to the MPI process rank, otherwise false.
Exceptions
TiledArray::Exceptionif the PIMPL is not initialized. Strong throw guarantee.
TiledArray::Exceptionif the index is out of bounds. Strong throw guarantee.
TiledArray::Exceptionif i has the wrong rank. Strong throw guarantee.

Definition at line 1117 of file dist_array.h.

◆ is_zero() [1/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Index , typename = enable_if_is_integral_or_integral_range<Index>>
bool TiledArray::DistArray< Tile, Policy >::is_zero ( const Index &  i) const
inline

Check for zero tiles.

Template Parameters
IndexAn integral type, a type satisfying container of integral types, or an integral range type.
Parameters
[in]iThe index of the tile whose nothingness is being contemplated. Can be either an ordinal or coordinate index.
Returns
true if tile at index i is zero, false if the tile is non-zero or remote existence data is not available.
Exceptions
TiledArray::Exceptionif the PIMPL is not initialized. Strong throw guarantee.
TiledArray::Exceptionif i is not in the range of valid tile indices. Strong throw guarantee.
TiledArray::Exceptionif i is a coordinate index with the wrong rank. Strong throw guarantee.

Definition at line 1137 of file dist_array.h.

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

◆ is_zero() [2/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Index , typename = enable_if_is_integral<Index>>
bool TiledArray::DistArray< Tile, Policy >::is_zero ( const std::initializer_list< Index > &  i) const
inline

Check for zero tiles.

Template Parameters
IndexAn integral type
Parameters
[in]iThe coordinate index of the tile whose nothingness is being contemplated.
Returns
true if tile at index i is zero, false if the tile is non-zero or remote existence data is not available.
Exceptions
TiledArray::Exceptionif the PIMPL is not initialized. Strong throw guarantee.
TiledArray::Exceptionif i is not in the range of valid tile indices. Strong throw guarantee.
TiledArray::Exceptionif i has the wrong rank. Strong throw guarantee.

Definition at line 1156 of file dist_array.h.

◆ load()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Archive >
void TiledArray::DistArray< Tile, Policy >::load ( World &  world,
Archive &  ar 
)
inline

Replaces this array with one loaded from an Archive object using the default processor map

Template Parameters
Archivea parallel MADWorld Archive type
Parameters
worlda World object with which this object will be associated
aran Archive object from which this object's data will be read
Note
The & operator for serializing will only work with parallel MADWorld archives.
This is a collective operation that fences before and after completion, if ar.dofence() is true

Definition at line 1300 of file dist_array.h.

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

◆ make_replicated()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
void TiledArray::DistArray< Tile, Policy >::make_replicated ( )
inline

Convert a distributed array into a replicated array

Exceptions
TiledArray::Exceptionif the PIMPL is not initialized. Strong throw guarantee.

Definition at line 1169 of file dist_array.h.

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

◆ operator bool()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
TiledArray::DistArray< Tile, Policy >::operator bool ( ) const
inlineexplicit

Conversion to bool is equivalent to DistArray::is_initialized()

Returns
false if the array has been default initialized, otherwise true.
Exceptions
NoneNo throw guarantee.

Definition at line 1213 of file dist_array.h.

Here is the call graph for this function:

◆ operator()() [1/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
TiledArray::expressions::TsrExpr<DistArray_, true> TiledArray::DistArray< Tile, Policy >::operator() ( const std::string &  vars)
inline

Create a tensor expression.

Parameters
varsA string with a comma-separated list of variables
Returns
A non-const tensor expression object
Note
size and contents of vars are validated using DistArray::check_str_index()

Definition at line 993 of file dist_array.h.

◆ operator()() [2/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
TiledArray::expressions::TsrExpr<const DistArray_, true> TiledArray::DistArray< Tile, Policy >::operator() ( const std::string &  vars) const
inline

Create a tensor expression.

Parameters
varsA string with a comma-separated list of variables
Returns
A const tensor expression object
Note
size and contents of vars are validated using DistArray::check_str_index()

Definition at line 980 of file dist_array.h.

◆ operator=()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
DistArray_& TiledArray::DistArray< Tile, Policy >::operator= ( const DistArray_ other)
inline

Copy assignment.

This is a shallow copy, that is no data is copied.

Parameters
otherThe array to be copied

Definition at line 465 of file dist_array.h.

Here is the caller graph for this function:

◆ owner() [1/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Index , typename = enable_if_is_integral_or_integral_range<Index>>
ProcessID TiledArray::DistArray< Tile, Policy >::owner ( const Index &  i) const
inline

Tile ownership.

Template Parameters
IndexAn integral type, a type satisfying container of integral types, or an integral range type.
Parameters
[in]iThe coordinate or ordinal index of the tile or a range of tiles whose ownership is in question.
Returns
The process ID of the owner of a tile.
Note
This does not indicate whether a tile exists or not. Only, the rank of the process that would own it if it does exist.
Exceptions
TiledArray::Exceptionif the PIMPL is not initialized. Strong throw guarantee.
TiledArray::Exceptionif the index is out of bounds. Strong throw guarantee.
TiledArray::Exceptionif i is a coordinate index with the wrong rank. Strong throw guarantee.

Definition at line 1058 of file dist_array.h.

Here is the call graph for this function:

◆ owner() [2/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Index , typename = enable_if_is_integral<Index>>
ProcessID TiledArray::DistArray< Tile, Policy >::owner ( const std::initializer_list< Index > &  i) const
inline

Tile ownership.

Template Parameters
IndexAn integral type
Parameters
[in]iThe coordinate index of the tile whose ownership is in question.
Returns
The process ID of the owner of a tile.
Note
This does not indicate whether a tile exists or not. Only, the rank of the process that would own it if it does exist.
Exceptions
TiledArray::Exceptionif the PIMPL is not initialized. Strong throw guarantee.
TiledArray::Exceptionif the index is out of bounds. Strong throw guarantee.
TiledArray::Exceptionif i has the wrong rank. Strong throw guarantee.

Definition at line 1078 of file dist_array.h.

◆ pimpl() [1/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
std::shared_ptr<impl_type> TiledArray::DistArray< Tile, Policy >::pimpl ( )
inline

Accessor for the (shared_ptr to) implementation object.

Returns
std::shared_ptr to the nonconst implementation object

Definition at line 423 of file dist_array.h.

◆ pimpl() [2/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
std::shared_ptr<const impl_type> TiledArray::DistArray< Tile, Policy >::pimpl ( ) const
inline

Accessor for the (shared_ptr to) implementation object.

Returns
std::shared_ptr to the const implementation object

Definition at line 418 of file dist_array.h.

Here is the caller graph for this function:

◆ pmap()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
const std::shared_ptr<pmap_interface>& TiledArray::DistArray< Tile, Policy >::pmap ( ) const
inline

Process map accessor.

Returns
A reference to the process map that owns this array.
Exceptions
TiledArray::Exceptionif the PIMPL is not initialized. Strong throw guarantee.

Definition at line 1019 of file dist_array.h.

Here is the caller graph for this function:

◆ range()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
const range_type& TiledArray::DistArray< Tile, Policy >::range ( ) const
inline

Tile range accessor.

This function returns a range object which can be used to iterate over the indices of the tiles. This should be contrasted with trange() which gives an object holding the tiling information (number of tiles, which elements belong to which tiles, etc.) and elements_range() which returns a range object that can be used to iterate over element indices.

Returns
A const reference to the range object for the array's tiles
Exceptions
TiledArray::Exceptionif the PIMPL is not initialized. Strong throw guarantee.
Deprecated:
use DistArray::tiles_range()

Definition at line 932 of file dist_array.h.

Here is the caller graph for this function:

◆ register_set_notifier()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
static void TiledArray::DistArray< Tile, Policy >::register_set_notifier ( std::function< void(const impl_type &, int64_t)>  notifier = {})
inlinestatic

Debugging/tracing instrumentation.

registers notifier for set() calls

Parameters
notifierthe notifier callable that accepts ref to the implementation object that received set call and the corresponding ordinal index

Definition at line 1432 of file dist_array.h.

◆ serialize() [1/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Archive , typename = std::enable_if_t< !Archive::is_parallel_archive && madness::archive::is_input_archive<Archive>::value>>
void TiledArray::DistArray< Tile, Policy >::serialize ( const Archive &  ar)
inline

deserialize local contents of a DistArray from an Archive object

Note
use Parallel{Input,Output}Archive for parallel serialization
Template Parameters
Archivean Archive type
Warning
this does not fence; it is user's responsibility to do that

Definition at line 1244 of file dist_array.h.

Here is the call graph for this function:

◆ serialize() [2/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Archive , typename = std::enable_if_t< !Archive::is_parallel_archive && madness::archive::is_output_archive<Archive>::value>>
void TiledArray::DistArray< Tile, Policy >::serialize ( const Archive &  ar) const
inline

serialize local contents of a DistArray to an Archive object

Note
use Parallel{Input,Output}Archive for parallel serialization
Template Parameters
Archivean Archive type
Warning
this does not fence; it is user's responsibility to do that

Definition at line 1224 of file dist_array.h.

Here is the call graph for this function:

◆ set() [1/6]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Index , typename = enable_if_is_integral_or_integral_range<Index>>
void TiledArray::DistArray< Tile, Policy >::set ( const Index &  i,
const element_type value = element_type() 
)
inline

Set a tile and fill it using a value.

This function sets each element of a tile to the specified value. For normal, non-nested, tiles this amounts to setting each scalar component of the tile to the provided value. For nested tile types this function sets the elements of the outer most tile (so the input value would be of type Tensor<T>, assuming a tile type of Tensor<Tensor<T>>).

Template Parameters
IndexAn integral type, a type satisfying the concept of a container of integral types, or an integral range type.
Parameters
[in]iEither the ordinal or coordinate index of the tile to be set.
[in]valueWhat each element of the tile will be set to.
Exceptions
TiledArray::ExceptionIf PIMPL is not initialized. Strong throw guarantee.
TiledArray::Exceptionif index i is out of bounds. Strong throw guarantee.
TiledArray::Exceptionif index i is a coordinate index with the wrong rank. Strong throw guarantee.
TiledArray::Exceptionif tile i is already set.

Definition at line 668 of file dist_array.h.

Here is the call graph for this function:

◆ set() [2/6]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Index , typename InIter , typename = std::enable_if_t<is_integral_or_integral_range_v<Index> && detail::is_input_iterator<InIter>::value>>
void TiledArray::DistArray< Tile, Policy >::set ( const Index &  i,
InIter  first 
)
inline

Set a tile and fill it using a sequence

This function will set an uninitialized tile to the provided value. The tile may be specified either by ordinal or coordinate index.

Template Parameters
IndexEither an integral type, a container type with integral objects, or an integral range type.
InIterType satisfying input iterator
Parameters
[in]iThe index or the ordinal of the tile to be set. i may be either an ordinal or coordinate index.
[in]firstThe iterator that points to the start of the input sequence. It is assumed that the container pointed to by first minimally contains the same number of elements as the tile.
Exceptions
TiledArray::Exceptionif the tile is already initialized.

Definition at line 619 of file dist_array.h.

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

◆ set() [3/6]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Index , typename Value , typename = std::enable_if_t<(is_integral_or_integral_range_v<Index> && is_value_or_future_to_value_v<Value>)>>
void TiledArray::DistArray< Tile, Policy >::set ( const Index &  i,
Value &&  v 
)
inline

Set a tile directly using a future to a tile.

Template Parameters
IndexFor an ordinal index should be an integral type and for a coordinate index should be a type satisfying container of integral types. Can also be a range type.
Parameters
[in]iThe ordinal or coordinate index of the tile to set
[in]vThe tile's new value
Exceptions
TiledArray::ExceptionIf PIMPL is not initialized. Strong throw guarantee.
TiledArray::Exceptionif index i is out of bounds. Strong throw guarantee.
TiledArray::Exceptionif index i is a coordinate index with the wrong rank. Strong throw guarantee.
TiledArray::Exceptionif tile i is already set.

Definition at line 716 of file dist_array.h.

Here is the call graph for this function:

◆ set() [4/6]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Index , typename Value , typename = std::enable_if_t< (std::is_integral_v<Index>)&&is_value_or_future_to_value_v<Value>>>
void TiledArray::DistArray< Tile, Policy >::set ( const std::initializer_list< Index > &  i,
Value &&  v 
)
inline

Set a tile directly using a future to a tile.

Template Parameters
IntegerAn integral type
Parameters
[in]iThe coordinate index of the tile to set, as an std::initializer_list<Integer>
[in]fA future to the tile's new value
Exceptions
TiledArray::ExceptionIf PIMPL is not initialized. Strong throw guarantee.
TiledArray::Exceptionif index i is out of bounds. Strong throw guarantee.
TiledArray::Exceptionif index i has the wrong rank. Strong throw guarantee.
TiledArray::Exceptionif tile i is already set.

Definition at line 738 of file dist_array.h.

◆ set() [5/6]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Integer , typename = enable_if_is_integral<Integer>>
void TiledArray::DistArray< Tile, Policy >::set ( const std::initializer_list< Integer > &  i,
const element_type value = element_type() 
)
inline

Set every element of a tile to a specified value.

This function sets each element of a tile to the specified value. For normal, non-nested, tiles this amounts to setting each scalar component of the tile to the provided value. For nested tile types this function sets the elements of the outer most tile (so the input value would be of type Tensor<T>, assuming a tile type of Tensor<Tensor<T>>).

Template Parameters
IntegerAn integral type
Parameters
[in]iThe coordinate index, as an std::initializer_list<Integer> for the tile.
[in]valueWhat the tile elements should be set to.
Exceptions
TiledArray::ExceptionIf PIMPL is not initialized. Strong throw guarantee.
TiledArray::Exceptionif index i is out of bounds. Strong throw guarantee.
TiledArray::Exceptionif index i has the wrong rank. Strong throw guarantee.
TiledArray::Exceptionif tile i is already set.

Definition at line 693 of file dist_array.h.

◆ set() [6/6]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Integer , typename InIter , typename = std::enable_if_t<(std::is_integral_v<Integer>)&&detail:: is_input_iterator<InIter>::value>>
std::enable_if<detail::is_input_iterator<InIter>::value>::type TiledArray::DistArray< Tile, Policy >::set ( const std::initializer_list< Integer > &  i,
InIter  first 
)
inline

Set a tile and fill it using a sequence

This function will set an uninitialized tile to the provided value. This overload allows the user to specify the coordinate index with an initializer list.

Template Parameters
IntegerAn integral type
InIterType satisfying input iterator
Parameters
[in]iThe tile's coordinate index, as an std::initializer_list<Integer>
[in]firstThe iterator that points to the start of the input sequence. It is assumed that the container pointed to by first minimally contains the same number of elements as the tile.
Exceptions
TiledArray::Exceptionif the tile is already initialized.

Definition at line 642 of file dist_array.h.

◆ shape()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
const shape_type& TiledArray::DistArray< Tile, Policy >::shape ( ) const
inline

Shape accessor.

Returns shape object. No communication is required.

Returns
reference to the shape object.
Exceptions
TiledArray::Exceptionif the PIMPL is not initialized. Strong throw guarantee.

Definition at line 1039 of file dist_array.h.

Here is the caller graph for this function:

◆ size()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
auto TiledArray::DistArray< Tile, Policy >::size ( ) const
inline

Returns the number of tiles in the tensor.

This function returns the number of tiles in the tensor. This is usually not the same as the volume of the tensor (i.e., the number of elements in the tensor; they are the same only if each tile contains a single element).

Returns
The number of tiles in the tensor.
Exceptions
TiledArray::Exceptionif the PIMPL has not been set. Strong throw guarantee.

Definition at line 972 of file dist_array.h.

Here is the caller graph for this function:

◆ store()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Archive >
void TiledArray::DistArray< Tile, Policy >::store ( Archive &  ar) const
inline

Stores this array to an Archive object.

Template Parameters
Archivea parallel MADWorld Archive type
Parameters
aran Archive object that will contain this object's data
Note
The & operator for serializing will only work with parallel MADWorld archives.
this is a collective operation that fences before and after completion if ar.dofence() is true

Definition at line 1392 of file dist_array.h.

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

◆ swap()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
void TiledArray::DistArray< Tile, Policy >::swap ( DistArray_ other)
inline

Swap this array with other.

Parameters
otherThe array to be swapped with this array.
Exceptions
Noneno throw guarantee.

Definition at line 1164 of file dist_array.h.

Here is the call graph for this function:

◆ tiles_range()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
const range_type& TiledArray::DistArray< Tile, Policy >::tiles_range ( ) const
inline

Tile range accessor.

Returns
A const reference to the range object for the array tiles

Definition at line 937 of file dist_array.h.

◆ trange()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
const trange_type& TiledArray::DistArray< Tile, Policy >::trange ( ) const
inline

Tiled range accessor.

This function returns an object containing the tiling information of the array (e.g., the tile boundaries, or which elements go to which tile). This should not be confused with range which returns a Range object for iterating over the tile indices or elements_range which returns a Range object for iterating over the elements.

Returns
A const reference to the tiled range object for the array
Exceptions
TiledArray::Exceptionif the PIMPL is not initialized. Strong throw guarantee.

Definition at line 917 of file dist_array.h.

Here is the caller graph for this function:

◆ truncate()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
void TiledArray::DistArray< Tile, Policy >::truncate ( typename shape_type::value_type  thresh = shape_type::threshold())
inline

Update shape data and remove tiles that are below the zero threshold

Parameters
[in]threshthe threshold below which the tiles are considered to be zero (only for sparse arrays will such tiles be discarded)
See also
SparseShape::is_zero
Note
This is a collective operation
This function is a no-op for dense arrays.

Definition at line 1196 of file dist_array.h.

Here is the call graph for this function:

◆ wait_for_lazy_cleanup() [1/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
void TiledArray::DistArray< Tile, Policy >::wait_for_lazy_cleanup ( ) const
inline

Wait for lazy tile cleanup.

The member version of the static DistArray::wait_for_lazy_cleanup

Definition at line 457 of file dist_array.h.

Here is the call graph for this function:

◆ wait_for_lazy_cleanup() [2/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
static void TiledArray::DistArray< Tile, Policy >::wait_for_lazy_cleanup ( World &  world,
const double  = 60.0 
)
inlinestatic

Wait for lazy tile cleanup.

This function will wait for cleanup of tile data that has been scheduled for lazy deletion. Ready tasks will be executed by this function while waiting for cleanup. This function will timeout if the wait time exceeds the timeout specified in the MAD_WAIT_TIMEOUT environment variable. The default timeout is 900 seconds.

Parameters
worldThe world that to be used to execute ready tasks.
Exceptions
madness::MadnessExceptionWhen timeout has been exceeded.

Definition at line 444 of file dist_array.h.

Here is the call graph for this function:

◆ weak_pimpl() [1/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
std::weak_ptr<impl_type> TiledArray::DistArray< Tile, Policy >::weak_pimpl ( )
inline

Accessor for the (shared_ptr to) implementation object.

Returns
std::weak_ptr to the nonconst implementation object

Definition at line 433 of file dist_array.h.

◆ weak_pimpl() [2/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
std::weak_ptr<const impl_type> TiledArray::DistArray< Tile, Policy >::weak_pimpl ( ) const
inline

Accessor for the (weak_ptr to) implementation object.

Returns
std::weak_ptr to the const implementation object

Definition at line 428 of file dist_array.h.

Here is the caller graph for this function:

◆ world()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
World& TiledArray::DistArray< Tile, Policy >::world ( ) const
inline

World accessor.

Returns
A reference to the world that owns this array.
Exceptions
TiledArray::Exceptionif the PIMPL is not initialized. Strong throw guarantee.

Definition at line 1007 of file dist_array.h.

Here is the caller graph for this function:

Member Data Documentation

◆ is_integral_or_integral_range_v

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Index >
constexpr bool TiledArray::DistArray< Tile, Policy >::is_integral_or_integral_range_v
staticconstexpr
Initial value:
=
std::is_integral_v<Index> || detail::is_integral_range_v<Index>

Definition at line 117 of file dist_array.h.

◆ is_value_or_future_to_value_v

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double>>, typename Policy = DensePolicy>
template<typename Value >
constexpr bool TiledArray::DistArray< Tile, Policy >::is_value_or_future_to_value_v
staticconstexpr
Initial value:
=
std::is_same_v<std::decay_t<Value>, Future<value_type>> ||
std::is_same_v<std::decay_t<Value>, value_type>

Definition at line 128 of file dist_array.h.


The documentation for this class was generated from the following files:
impl_type::value_type value_type
Tile type.
Definition: dist_array.h:86
impl_type::range_type range_type
Elements/tiles range type.
Definition: dist_array.h:78
const range_type & range() const
Tile range accessor.
Definition: dist_array.h:932
value_type::value_type element_type
Definition: dist_array.h:102
impl_type::range_type::index index
Array coordinate index type.
Definition: dist_array.h:84
An N-dimensional tensor object.
Definition: tensor.h:50
A (hyperrectangular) interval on , space of integer -indices.
Definition: range.h:46