TiledArray::detail::ValArray< T > Class Template Reference
Inheritance diagram for TiledArray::detail::ValArray< T >:
Collaboration diagram for TiledArray::detail::ValArray< T >:

Documentation

template<typename T>
class TiledArray::detail::ValArray< T >

Value array.

This is minimal wrapper around a dynamically allocated array. The array may be shared and includes a reference counter.

Template Parameters
TThe element type of the array

Definition at line 44 of file val_array.h.

Public Types

typedef ValArray< T > ValArray_
 This object type. More...
 
typedef SizeArray< T >::size_type size_type
 size type More...
 
typedef SizeArray< T >::value_type value_type
 Element type. More...
 
typedef SizeArray< T >::reference reference
 Reference type. More...
 
typedef SizeArray< T >::const_reference const_reference
 Const reference type. More...
 
typedef SizeArray< T >::pointer pointer
 Data pointer type. More...
 
typedef SizeArray< T >::const_pointer const_pointer
 Const data pointer type. More...
 
typedef SizeArray< T >::difference_type difference_type
 Difference type. More...
 
typedef SizeArray< T >::iterator iterator
 Iterator type. More...
 
typedef SizeArray< T >::const_iterator const_iterator
 Const iterator type. More...
 

Public Member Functions

 ValArray ()=default
 
 ValArray (const size_type n)
 
template<typename Value , typename std::enable_if< std::is_convertible< value_type, Value >::value >::type * = nullptr>
 ValArray (const size_type n, const Value &value)
 
template<typename Arg >
 ValArray (const size_type n, const Arg *const arg)
 
template<typename Arg , typename Op >
 ValArray (const size_type n, const Arg *MADNESS_RESTRICT const arg, const Op &op)
 
template<typename U , typename Op >
 ValArray (const ValArray< U > &arg, const Op &op)
 
template<typename Left , typename Right , typename Op >
 ValArray (const size_type n, const Left *MADNESS_RESTRICT const left, const Right *MADNESS_RESTRICT const right, const Op &op)
 
template<typename U , typename V , typename Op >
 ValArray (const ValArray< U > &left, const ValArray< V > &right, const Op &op)
 
 ValArray (const ValArray_ &other)
 
ValArray_operator= (const ValArray_ &other)
 
 ~ValArray ()
 
template<typename U , typename Op >
void binary (const ValArray< U > &arg, const Op &op)
 Binary vector operation. More...
 
template<typename U , typename V , typename Op >
void binary (const ValArray< U > &left, const ValArray< V > &right, const Op &op)
 Binary vector operation. More...
 
template<typename U , typename Op >
void unary (const ValArray< U > &arg, const Op &op)
 Unary vector operation. More...
 
template<typename U , typename Result , typename Op >
Result reduce (const ValArray< U > &arg, Result &result, const Op &op)
 Binary reduce operation. More...
 
template<typename U , typename V , typename Op >
void row_reduce (const ValArray< U > &left, const ValArray< V > &right, const Op &op)
 Reduce row operation. More...
 
template<typename U , typename Op >
void row_reduce (const ValArray< U > &arg, const Op &op)
 Reduce row operation. More...
 
template<typename U , typename V , typename Op >
void col_reduce (const ValArray< U > &left, const ValArray< V > &right, const Op &op)
 Reduce column operation. More...
 
template<typename U , typename Op >
void col_reduce (const ValArray< U > &arg, const Op &op)
 Reduce column operation. More...
 
template<typename U , typename V , typename Op >
void outer (const ValArray< U > &left, const ValArray< V > &right, const Op &op)
 Outer operation. More...
 
template<typename U , typename V , typename Op >
void outer_fill (const ValArray< U > &left, const ValArray< V > &right, const Op &op)
 Outer fill operation. More...
 
template<typename U , typename V , typename A , typename Op >
void outer_fill (const ValArray< U > &left, const ValArray< V > &right, const ValArray< A > &a, const Op &op)
 Outer operation. More...
 
void swap (ValArray_ &other)
 
template<typename U >
bool operator== (const ValArray< U > &other) const
 
template<typename U >
bool operator!= (const ValArray< U > &other) const
 
template<typename Archive , typename = std::enable_if_t< madness::archive::is_output_archive<Archive>::value>>
void serialize (Archive &ar) const
 Serialization. More...
 
template<typename Archive , typename = std::enable_if_t< madness::archive::is_input_archive<Archive>::value>>
void serialize (Archive &ar)
 (De)serialization More...
 

Static Public Attributes

static const std::size_t alignment = TILEDARRAY_DEFAULT_ALIGNMENT
 

Member Typedef Documentation

◆ const_iterator

template<typename T >
typedef SizeArray<T>::const_iterator TiledArray::detail::ValArray< T >::const_iterator

Const iterator type.

Definition at line 59 of file val_array.h.

◆ const_pointer

template<typename T >
typedef SizeArray<T>::const_pointer TiledArray::detail::ValArray< T >::const_pointer

Const data pointer type.

Definition at line 54 of file val_array.h.

◆ const_reference

template<typename T >
typedef SizeArray<T>::const_reference TiledArray::detail::ValArray< T >::const_reference

Const reference type.

Definition at line 51 of file val_array.h.

◆ difference_type

template<typename T >
typedef SizeArray<T>::difference_type TiledArray::detail::ValArray< T >::difference_type

Difference type.

Definition at line 56 of file val_array.h.

◆ iterator

template<typename T >
typedef SizeArray<T>::iterator TiledArray::detail::ValArray< T >::iterator

Iterator type.

Definition at line 57 of file val_array.h.

◆ pointer

template<typename T >
typedef SizeArray<T>::pointer TiledArray::detail::ValArray< T >::pointer

Data pointer type.

Definition at line 52 of file val_array.h.

◆ reference

template<typename T >
typedef SizeArray<T>::reference TiledArray::detail::ValArray< T >::reference

Reference type.

Definition at line 49 of file val_array.h.

◆ size_type

template<typename T >
typedef SizeArray<T>::size_type TiledArray::detail::ValArray< T >::size_type

size type

Definition at line 47 of file val_array.h.

◆ ValArray_

template<typename T >
typedef ValArray<T> TiledArray::detail::ValArray< T >::ValArray_

This object type.

Definition at line 46 of file val_array.h.

◆ value_type

template<typename T >
typedef SizeArray<T>::value_type TiledArray::detail::ValArray< T >::value_type

Element type.

Definition at line 48 of file val_array.h.

Constructor & Destructor Documentation

◆ ValArray() [1/9]

template<typename T >
TiledArray::detail::ValArray< T >::ValArray ( )
default

◆ ValArray() [2/9]

template<typename T >
TiledArray::detail::ValArray< T >::ValArray ( const size_type  n)
inlineexplicit

Definition at line 122 of file val_array.h.

◆ ValArray() [3/9]

template<typename T >
template<typename Value , typename std::enable_if< std::is_convertible< value_type, Value >::value >::type * = nullptr>
TiledArray::detail::ValArray< T >::ValArray ( const size_type  n,
const Value &  value 
)
inline

Definition at line 129 of file val_array.h.

Here is the call graph for this function:

◆ ValArray() [4/9]

template<typename T >
template<typename Arg >
TiledArray::detail::ValArray< T >::ValArray ( const size_type  n,
const Arg *const  arg 
)
inline

Definition at line 135 of file val_array.h.

Here is the call graph for this function:

◆ ValArray() [5/9]

template<typename T >
template<typename Arg , typename Op >
TiledArray::detail::ValArray< T >::ValArray ( const size_type  n,
const Arg *MADNESS_RESTRICT const  arg,
const Op &  op 
)
inline

Definition at line 141 of file val_array.h.

Here is the call graph for this function:

◆ ValArray() [6/9]

template<typename T >
template<typename U , typename Op >
TiledArray::detail::ValArray< T >::ValArray ( const ValArray< U > &  arg,
const Op &  op 
)
inline

Definition at line 148 of file val_array.h.

Here is the call graph for this function:

◆ ValArray() [7/9]

template<typename T >
template<typename Left , typename Right , typename Op >
TiledArray::detail::ValArray< T >::ValArray ( const size_type  n,
const Left *MADNESS_RESTRICT const  left,
const Right *MADNESS_RESTRICT const  right,
const Op &  op 
)
inline

Definition at line 155 of file val_array.h.

Here is the call graph for this function:

◆ ValArray() [8/9]

template<typename T >
template<typename U , typename V , typename Op >
TiledArray::detail::ValArray< T >::ValArray ( const ValArray< U > &  left,
const ValArray< V > &  right,
const Op &  op 
)
inline

Definition at line 163 of file val_array.h.

Here is the call graph for this function:

◆ ValArray() [9/9]

template<typename T >
TiledArray::detail::ValArray< T >::ValArray ( const ValArray_ other)
inline

Definition at line 170 of file val_array.h.

◆ ~ValArray()

template<typename T >
TiledArray::detail::ValArray< T >::~ValArray ( )
inline

Definition at line 198 of file val_array.h.

Member Function Documentation

◆ binary() [1/2]

template<typename T >
template<typename U , typename Op >
void TiledArray::detail::ValArray< T >::binary ( const ValArray< U > &  arg,
const Op &  op 
)
inline

Binary vector operation.

Perform a binary vector operation where this array is the left-hand argument and arg is the right-hand argument. The data elements are modified by: op(*this[i], arg[i]).

Template Parameters
UThe element type of arg
OpThe binary operation
Parameters
argThe right-hand argument
opThe binary operation
Exceptions
TiledArray::ExceptionWhen the size of arg is not equal to the size of this array.

Definition at line 237 of file val_array.h.

Here is the call graph for this function:

◆ binary() [2/2]

template<typename T >
template<typename U , typename V , typename Op >
void TiledArray::detail::ValArray< T >::binary ( const ValArray< U > &  left,
const ValArray< V > &  right,
const Op &  op 
)
inline

Binary vector operation.

Perform a binary vector operation with left and right, and store the result in this array. The data elements are given by: *this[i] = op(left[i], right[i]).

Template Parameters
UThe element type of arg
OpThe binary operation
Parameters
leftThe left-hand argument
rightThe right-hand argument
opThe binary operation
Exceptions
TiledArray::ExceptionWhen the sizes of left and right are not equal to the size of this array.

Definition at line 255 of file val_array.h.

Here is the call graph for this function:

◆ col_reduce() [1/2]

template<typename T >
template<typename U , typename Op >
void TiledArray::detail::ValArray< T >::col_reduce ( const ValArray< U > &  arg,
const Op &  op 
)
inline

Reduce column operation.

Reduce columns of arg to this array, where a columns have arg.size()/size() elements. The reduced result is computed by op(*this[i], arg[i][j]).

Template Parameters
UThe element type of arg
OpThe reduction operation
Parameters
argThe array to be reduced
opThe reduction operation
Exceptions
TiledArray::ExceptionWhen (arg.size() % size()) != 0.

Definition at line 363 of file val_array.h.

Here is the call graph for this function:

◆ col_reduce() [2/2]

template<typename T >
template<typename U , typename V , typename Op >
void TiledArray::detail::ValArray< T >::col_reduce ( const ValArray< U > &  left,
const ValArray< V > &  right,
const Op &  op 
)
inline

Reduce column operation.

Reduce columns of left to this array, where columns have right.size() elements. The reduced result is computed by op(*this[j], left[i][j], right[i]).

Template Parameters
UThe element type of left
VThe element type of right
OpThe reduction operation
Parameters
leftThe array to be reduced of size size()*right.size()
rightThe right-hand array
opThe reduction operation
Exceptions
TiledArray::ExceptionWhen left.size() != (size() * right.size()).

Definition at line 346 of file val_array.h.

Here is the call graph for this function:

◆ operator!=()

template<typename T >
template<typename U >
bool TiledArray::detail::ValArray< T >::operator!= ( const ValArray< U > &  other) const
inline

Definition at line 447 of file val_array.h.

Here is the call graph for this function:

◆ operator=()

template<typename T >
ValArray_& TiledArray::detail::ValArray< T >::operator= ( const ValArray_ other)
inline

Definition at line 177 of file val_array.h.

Here is the call graph for this function:

◆ operator==()

template<typename T >
template<typename U >
bool TiledArray::detail::ValArray< T >::operator== ( const ValArray< U > &  other) const
inline

Definition at line 442 of file val_array.h.

Here is the call graph for this function:

◆ outer()

template<typename T >
template<typename U , typename V , typename Op >
void TiledArray::detail::ValArray< T >::outer ( const ValArray< U > &  left,
const ValArray< V > &  right,
const Op &  op 
)
inline

Outer operation.

This function use two arrays, left and right, to modify this array ( which is treated as a matrix of size left.size() * right.size() ). Elements of this array are modified by op(*this[i][j], left[i], right[j]).

Template Parameters
UThe left-hand argument type
VThe right-hand argument type
Parameters
leftThe left-hand array
rightThe right-hand array
opThe outer operation
Exceptions
TiledArray::ExceptionWhen size() != (left.size() * right.size()).

Definition at line 382 of file val_array.h.

Here is the call graph for this function:

◆ outer_fill() [1/2]

template<typename T >
template<typename U , typename V , typename Op >
void TiledArray::detail::ValArray< T >::outer_fill ( const ValArray< U > &  left,
const ValArray< V > &  right,
const Op &  op 
)
inline

Outer fill operation.

This function use two arrays, left and right, to fill this array ( which is treated as a matrix of size left.size() * right.size() ). Elements of this array are filled by op(*this[i][j], left[i], right[j]).

Template Parameters
UThe left-hand argument type
VThe right-hand argument type
Parameters
leftThe left-hand array
rightThe right-hand array
opThe outer operation
Exceptions
TiledArray::ExceptionWhen size() != (left.size() * right.size()).

Definition at line 402 of file val_array.h.

Here is the call graph for this function:

◆ outer_fill() [2/2]

template<typename T >
template<typename U , typename V , typename A , typename Op >
void TiledArray::detail::ValArray< T >::outer_fill ( const ValArray< U > &  left,
const ValArray< V > &  right,
const ValArray< A > &  a,
const Op &  op 
)
inline

Outer operation.

This function use two arrays, left and right, to modify this array ( which is treated as a matrix of size left.size() * right.size() ). Elements of this array are modified by op(*this[i][j], left[i], right[j]).

Template Parameters
UThe left-hand argument type
VThe right-hand argument type
Parameters
[in]leftThe left-hand array
[in]rightThe right-hand array
[out]aThe array that will hold the result
[in]opThe outer operation
Exceptions
TiledArray::ExceptionWhen size() != (left.size() * right.size()).

Definition at line 424 of file val_array.h.

Here is the call graph for this function:

◆ reduce()

template<typename T >
template<typename U , typename Result , typename Op >
Result TiledArray::detail::ValArray< T >::reduce ( const ValArray< U > &  arg,
Result &  result,
const Op &  op 
)
inline

Binary reduce operation.

Binary reduction operation where this object is the left-hand argument type. The reduced result is computed by op(result, *this[i], arg[i]).

Template Parameters
UThe element type of arg
ResultThe result type of the reduction
OpThe reduction operation.
Parameters
argThe right-hand array argument
resultThe initial value of the reduction
opThe binary reduction operation
Returns
The reduced value
Exceptions
TiledArray::ExceptionWhen arg.size() != size().

Definition at line 291 of file val_array.h.

Here is the call graph for this function:

◆ row_reduce() [1/2]

template<typename T >
template<typename U , typename Op >
void TiledArray::detail::ValArray< T >::row_reduce ( const ValArray< U > &  arg,
const Op &  op 
)
inline

Reduce row operation.

Reduce rows of arg to this array, where a row have arg.size()/size() elements. The reduced result is computed by op(*this[i], arg[i][j]).

Template Parameters
UThe element type of arg
OpThe reduction operation
Parameters
argThe array to be reduced
opThe reduction operation
Exceptions
TiledArray::ExceptionWhen (arg.size() % size()) != 0.

Definition at line 327 of file val_array.h.

Here is the call graph for this function:

◆ row_reduce() [2/2]

template<typename T >
template<typename U , typename V , typename Op >
void TiledArray::detail::ValArray< T >::row_reduce ( const ValArray< U > &  left,
const ValArray< V > &  right,
const Op &  op 
)
inline

Reduce row operation.

Reduce rows of left to this array, where the size of rows is equal to right.size(). The reduced result is computed by op(*this[i], left[i][j], right[j]).

Template Parameters
UThe element type of left
VThe element type of right
OpThe reduction operation
Parameters
leftThe array to be reduced of size size()*right.size()
rightThe right-hand array
opThe reduction operation
Exceptions
TiledArray::ExceptionWhen left.size() != (size() * right.size()).

Definition at line 310 of file val_array.h.

Here is the call graph for this function:

◆ serialize() [1/2]

template<typename T >
template<typename Archive , typename = std::enable_if_t< madness::archive::is_input_archive<Archive>::value>>
void TiledArray::detail::ValArray< T >::serialize ( Archive &  ar)
inline

(De)serialization

Template Parameters
ArchiveAn input archive type
Parameters
[out]aran Archive object

Definition at line 470 of file val_array.h.

Here is the call graph for this function:

◆ serialize() [2/2]

template<typename T >
template<typename Archive , typename = std::enable_if_t< madness::archive::is_output_archive<Archive>::value>>
void TiledArray::detail::ValArray< T >::serialize ( Archive &  ar) const
inline

Serialization.

Template Parameters
ArchiveAn output archive type
Parameters
[out]aran Archive object

Definition at line 458 of file val_array.h.

Here is the call graph for this function:

◆ swap()

template<typename T >
void TiledArray::detail::ValArray< T >::swap ( ValArray_ other)
inline

Definition at line 432 of file val_array.h.

Here is the call graph for this function:

◆ unary()

template<typename T >
template<typename U , typename Op >
void TiledArray::detail::ValArray< T >::unary ( const ValArray< U > &  arg,
const Op &  op 
)
inline

Unary vector operation.

Perform a unary vector operation, and store the result in this array. The data elements are given by: *this[i] = op(arg[i]).

Template Parameters
UThe element type of arg
OpThe binary operation
Parameters
argThe right-hand argument
opThe binary operation
Exceptions
TiledArray::ExceptionWhen the size of arg is not equal to the size of this array.

Definition at line 272 of file val_array.h.

Here is the call graph for this function:

Member Data Documentation

◆ alignment

template<typename T >
const std::size_t TiledArray::detail::ValArray< T >::alignment = TILEDARRAY_DEFAULT_ALIGNMENT
static

Definition at line 61 of file val_array.h.


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