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

Documentation

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

Array wrapper.

This object is a wrapper for raw memory buffers so that it has the same interface, and can be used in place of, standard containers (e.g. std::vector). SizeArray does not own the buffer, therefore it is the user's responsibility to manage (allocate, free, etc.) the memory buffer.

Template Parameters
TThe type of the array referenced by this array object

Definition at line 40 of file size_array.h.

Public Types

typedef T value_type
 
typedef T * iterator
 
typedef const T * const_iterator
 
typedef T & reference
 
typedef const T & const_reference
 
typedef T * pointer
 
typedef const T * const_pointer
 
typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 

Public Member Functions

 SizeArray ()=default
 
 SizeArray (const SizeArray &)=default
 
 SizeArray (SizeArray< T > &&)=default
 
 ~SizeArray ()=default
 
 SizeArray (pointer const first, pointer const last)
 
 SizeArray (pointer const first, const size_type n)
 
void set (pointer const first, const size_type n)
 
void set (pointer const first, pointer const last)
 
SizeArray< T > & operator= (const SizeArray< T > &other)
 
template<typename U >
SizeArray< T > & operator= (const U &other)
 
template<typename U >
 operator std::vector< U > () const
 
template<typename U , std::size_t N>
 operator std::array< U, N > () const
 
template<typename U , std::size_t Size>
 operator boost::container::small_vector< U, Size > () const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
reference operator[] (size_type i)
 
const_reference operator[] (size_type i) const
 
reference at (size_type i)
 
const_reference at (size_type i) const
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
size_type size () const
 
bool empty () const
 
size_type max_size () const
 
void swap (SizeArray< T > &other)
 
const_pointer data () const
 
pointer data ()
 
void assign (const_reference value)
 
template<typename U >
bool operator== (const SizeArray< U > &other) const
 
template<typename U >
bool operator!= (const SizeArray< U > &other) const
 
template<typename Arg , typename Op >
void binary (const Arg *const arg, const Op &op)
 Binary vector operation. More...
 
template<typename Left , typename Right , typename Op >
void binary (const Left *const left, const Right *const right, const Op &op)
 Binary vector operation. More...
 
template<typename Op >
void unary (const Op &op)
 Unary vector operation. More...
 
template<typename Arg , typename Op >
void unary (const Arg *const arg, const Op &op)
 Unary vector operation. More...
 
template<typename Arg , typename Result , typename ReduceOp , typename JoinOp >
Result reduce (const Arg *const arg, Result result, const ReduceOp &reduce_op, const JoinOp &join_op) const
 Binary reduction operation. More...
 
template<typename Result , typename ReduceOp , typename JoinOp >
Result reduce (Result result, const ReduceOp &reduce_op, const JoinOp &join_op) const
 Unary reduction operation. More...
 
template<typename Left , typename Right , typename Op >
void row_reduce (const size_type n, const Left *const left, const Right *right, const Op &op)
 Row reduce operation. More...
 
template<typename Arg , typename Op >
void row_reduce (const size_type n, const Arg *const arg, const Op &op)
 Row reduce operation. More...
 
template<typename Left , typename Right , typename Op >
void col_reduce (const size_type m, const Left *const left, const Right *right, const Op &op)
 Column reduce operation. More...
 
template<typename Arg , typename Op >
void col_reduce (const size_type m, const Arg *const arg, const Op &op)
 Columns reduce operation. More...
 
template<typename Left , typename Right , typename Op >
void outer (const size_type m, const size_type n, const Left *const left, const Right *const right, const Op &op)
 Outer operation. More...
 
template<typename Left , typename Right , typename Op >
void outer_fill (const size_type m, const size_type n, const Left *const left, const Right *const right, const Op &op)
 Outer fill operation. More...
 
template<typename Left , typename Right , typename Base , typename Op >
void outer_fill (const size_type m, const size_type n, const Left *const left, const Right *const right, const Base *const base, const Op &op)
 Outer operation. More...
 

Member Typedef Documentation

◆ const_iterator

template<typename T >
typedef const T* TiledArray::detail::SizeArray< T >::const_iterator

Definition at line 49 of file size_array.h.

◆ const_pointer

template<typename T >
typedef const T* TiledArray::detail::SizeArray< T >::const_pointer

Definition at line 53 of file size_array.h.

◆ const_reference

template<typename T >
typedef const T& TiledArray::detail::SizeArray< T >::const_reference

Definition at line 51 of file size_array.h.

◆ const_reverse_iterator

template<typename T >
typedef std::reverse_iterator<const_iterator> TiledArray::detail::SizeArray< T >::const_reverse_iterator

Definition at line 119 of file size_array.h.

◆ difference_type

template<typename T >
typedef std::ptrdiff_t TiledArray::detail::SizeArray< T >::difference_type

Definition at line 55 of file size_array.h.

◆ iterator

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

Definition at line 48 of file size_array.h.

◆ pointer

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

Definition at line 52 of file size_array.h.

◆ reference

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

Definition at line 50 of file size_array.h.

◆ reverse_iterator

template<typename T >
typedef std::reverse_iterator<iterator> TiledArray::detail::SizeArray< T >::reverse_iterator

Definition at line 118 of file size_array.h.

◆ size_type

template<typename T >
typedef std::size_t TiledArray::detail::SizeArray< T >::size_type

Definition at line 54 of file size_array.h.

◆ value_type

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

Definition at line 47 of file size_array.h.

Constructor & Destructor Documentation

◆ SizeArray() [1/5]

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

◆ SizeArray() [2/5]

template<typename T >
TiledArray::detail::SizeArray< T >::SizeArray ( const SizeArray< T > &  )
default

◆ SizeArray() [3/5]

template<typename T >
TiledArray::detail::SizeArray< T >::SizeArray ( SizeArray< T > &&  )
default

◆ ~SizeArray()

template<typename T >
TiledArray::detail::SizeArray< T >::~SizeArray ( )
default

◆ SizeArray() [4/5]

template<typename T >
TiledArray::detail::SizeArray< T >::SizeArray ( pointer const  first,
pointer const  last 
)
inline

Definition at line 63 of file size_array.h.

◆ SizeArray() [5/5]

template<typename T >
TiledArray::detail::SizeArray< T >::SizeArray ( pointer const  first,
const size_type  n 
)
inline

Definition at line 66 of file size_array.h.

Member Function Documentation

◆ assign()

template<typename T >
void TiledArray::detail::SizeArray< T >::assign ( const_reference  value)
inline

Definition at line 183 of file size_array.h.

Here is the call graph for this function:

◆ at() [1/2]

template<typename T >
reference TiledArray::detail::SizeArray< T >::at ( size_type  i)
inline

Definition at line 135 of file size_array.h.

Here is the call graph for this function:

◆ at() [2/2]

template<typename T >
const_reference TiledArray::detail::SizeArray< T >::at ( size_type  i) const
inline

Definition at line 140 of file size_array.h.

Here is the call graph for this function:

◆ back() [1/2]

template<typename T >
reference TiledArray::detail::SizeArray< T >::back ( )
inline

Definition at line 156 of file size_array.h.

◆ back() [2/2]

template<typename T >
const_reference TiledArray::detail::SizeArray< T >::back ( ) const
inline

Definition at line 161 of file size_array.h.

◆ begin() [1/2]

template<typename T >
iterator TiledArray::detail::SizeArray< T >::begin ( )
inline

Definition at line 112 of file size_array.h.

Here is the caller graph for this function:

◆ begin() [2/2]

template<typename T >
const_iterator TiledArray::detail::SizeArray< T >::begin ( ) const
inline

Definition at line 113 of file size_array.h.

◆ binary() [1/2]

template<typename T >
template<typename Arg , typename Op >
void TiledArray::detail::SizeArray< T >::binary ( const Arg *const  arg,
const Op &  op 
)
inline

Binary vector operation.

Binary operation where this object is the left-hand argument. The values of this array is set by op(*this[i], arg[i]).

Template Parameters
ArgThe right-hand argument type
OpThe binary operation type
Parameters
argThe right-hand argument
opThe binary operation

Definition at line 225 of file size_array.h.

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

◆ binary() [2/2]

template<typename T >
template<typename Left , typename Right , typename Op >
void TiledArray::detail::SizeArray< T >::binary ( const Left *const  left,
const Right *const  right,
const Op &  op 
)
inline

Binary vector operation.

Binary operation sets the values of this array such that, *this[i] = op(left[i], right[i]). The result type of op must be value_type or implicitly convertible to value_type.

Template Parameters
LeftThe left-hand argument type
RightThe right-hand argument type
OpThe binary operation type
Parameters
leftThe left-hand argument
rightThe right-hand argument
opThe binary operation

Definition at line 241 of file size_array.h.

Here is the call graph for this function:

◆ col_reduce() [1/2]

template<typename T >
template<typename Arg , typename Op >
void TiledArray::detail::SizeArray< T >::col_reduce ( const size_type  m,
const Arg *const  arg,
const Op &  op 
)
inline

Columns reduce operation.

Reduce columns of arg matrix to this array. The reduced result is computed by op(*this[j], arg[i][j]).

Template Parameters
ArgThe matrix element type
OpThe reduction operation
Parameters
mThe number of rows in the matrix
argThe matrix pointer of size m*size()
opThe reduction operation

Definition at line 365 of file size_array.h.

Here is the call graph for this function:

◆ col_reduce() [2/2]

template<typename T >
template<typename Left , typename Right , typename Op >
void TiledArray::detail::SizeArray< T >::col_reduce ( const size_type  m,
const Left *const  left,
const Right *  right,
const Op &  op 
)
inline

Column reduce operation.

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

Template Parameters
LeftThe matrix element type
RightThe vector element type
OpThe reduction operation
Parameters
mThe number of rows in the matrix
leftThe matrix pointer of size m*size()
rightThe vector pointer of size m
opThe reduction operation

Definition at line 350 of file size_array.h.

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

◆ data() [1/2]

template<typename T >
pointer TiledArray::detail::SizeArray< T >::data ( )
inline

Definition at line 180 of file size_array.h.

◆ data() [2/2]

template<typename T >
const_pointer TiledArray::detail::SizeArray< T >::data ( ) const
inline

Definition at line 177 of file size_array.h.

Here is the caller graph for this function:

◆ empty()

template<typename T >
bool TiledArray::detail::SizeArray< T >::empty ( ) const
inline

Definition at line 168 of file size_array.h.

◆ end() [1/2]

template<typename T >
iterator TiledArray::detail::SizeArray< T >::end ( )
inline

Definition at line 114 of file size_array.h.

Here is the caller graph for this function:

◆ end() [2/2]

template<typename T >
const_iterator TiledArray::detail::SizeArray< T >::end ( ) const
inline

Definition at line 115 of file size_array.h.

◆ front() [1/2]

template<typename T >
reference TiledArray::detail::SizeArray< T >::front ( )
inline

Definition at line 146 of file size_array.h.

◆ front() [2/2]

template<typename T >
const_reference TiledArray::detail::SizeArray< T >::front ( ) const
inline

Definition at line 151 of file size_array.h.

◆ max_size()

template<typename T >
size_type TiledArray::detail::SizeArray< T >::max_size ( ) const
inline

Definition at line 169 of file size_array.h.

◆ operator boost::container::small_vector< U, Size >()

template<typename T >
template<typename U , std::size_t Size>
TiledArray::detail::SizeArray< T >::operator boost::container::small_vector< U, Size > ( ) const
inline

Definition at line 107 of file size_array.h.

◆ operator std::array< U, N >()

template<typename T >
template<typename U , std::size_t N>
TiledArray::detail::SizeArray< T >::operator std::array< U, N > ( ) const
inline

Definition at line 98 of file size_array.h.

Here is the call graph for this function:

◆ operator std::vector< U >()

template<typename T >
template<typename U >
TiledArray::detail::SizeArray< T >::operator std::vector< U > ( ) const
inline

Definition at line 93 of file size_array.h.

◆ operator!=()

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

Definition at line 202 of file size_array.h.

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

◆ operator=() [1/2]

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

Definition at line 79 of file size_array.h.

Here is the call graph for this function:

◆ operator=() [2/2]

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

Definition at line 86 of file size_array.h.

Here is the call graph for this function:

◆ operator==()

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

Definition at line 189 of file size_array.h.

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

◆ operator[]() [1/2]

template<typename T >
reference TiledArray::detail::SizeArray< T >::operator[] ( size_type  i)
inline

Definition at line 131 of file size_array.h.

◆ operator[]() [2/2]

template<typename T >
const_reference TiledArray::detail::SizeArray< T >::operator[] ( size_type  i) const
inline

Definition at line 132 of file size_array.h.

◆ outer()

template<typename T >
template<typename Left , typename Right , typename Op >
void TiledArray::detail::SizeArray< T >::outer ( const size_type  m,
const size_type  n,
const Left *const  left,
const Right *const  right,
const Op &  op 
)
inline

Outer operation.

This function use two vectors, left and right, and this vector to modify this vector ( which is treated as a matrix of size m*n ) such that op(*this[i][j], left[i], right[j]).

Template Parameters
LeftThe left-hand argument type
RightThe right-hand argument type
Parameters
mThe size of the left-hand array
nThe size of the right-hand array
leftA pointer to the left-hand array
rightA pointer to the right-hand array
opThe outer operation

Definition at line 382 of file size_array.h.

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

◆ outer_fill() [1/2]

template<typename T >
template<typename Left , typename Right , typename Base , typename Op >
void TiledArray::detail::SizeArray< T >::outer_fill ( const size_type  m,
const size_type  n,
const Left *const  left,
const Right *const  right,
const Base *const  base,
const Op &  op 
)
inline

Outer operation.

This function use two vectors, left and right, and base array to modify this array ( which are treated as a matrix of size m*n ) such that *this[i][j] = op(base[i][j], left[i], right[j]).

Template Parameters
LeftThe left-hand argument type
RightThe right-hand argument type
BaseThe base argument type
Parameters
mThe size of the left-hand array
nThe size of the right-hand array
leftA pointer to the left-hand array
rightA pointer to the right-hand array
baseA pointer to the base array
opThe outer operation

Definition at line 422 of file size_array.h.

Here is the call graph for this function:

◆ outer_fill() [2/2]

template<typename T >
template<typename Left , typename Right , typename Op >
void TiledArray::detail::SizeArray< T >::outer_fill ( const size_type  m,
const size_type  n,
const Left *const  left,
const Right *const  right,
const Op &  op 
)
inline

Outer fill operation.

This function use two vectors, left and right, to fill this vector ( which is treated as a matrix of size m*n ) such that *this[i][j] = op(left[i], right[j]).

Template Parameters
LeftThe left-hand array type
RightThe right-hand array type
Parameters
mThe size of the left-hand array
nThe size of the right-hand array
leftA pointer to the left-hand array
rightA pointer to the right-hand array
opThe outer operation

Definition at line 401 of file size_array.h.

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

◆ rbegin() [1/2]

template<typename T >
reverse_iterator TiledArray::detail::SizeArray< T >::rbegin ( )
inline

Definition at line 121 of file size_array.h.

Here is the call graph for this function:

◆ rbegin() [2/2]

template<typename T >
const_reverse_iterator TiledArray::detail::SizeArray< T >::rbegin ( ) const
inline

Definition at line 122 of file size_array.h.

Here is the call graph for this function:

◆ reduce() [1/2]

template<typename T >
template<typename Arg , typename Result , typename ReduceOp , typename JoinOp >
Result TiledArray::detail::SizeArray< T >::reduce ( const Arg *const  arg,
Result  result,
const ReduceOp &  reduce_op,
const JoinOp &  join_op 
) const
inline

Binary reduction operation.

Perform an element-wise binary reduction of the data of this and arg by executing join_op(result, reduce_op(*this[i], arg[i])) for each i in the index range of this . result is initialized to identity . If HAVE_INTEL_TBB is defined the reduction will be executed in an undefined order, otherwise will execute in the order of increasing i .

Template Parameters
ArgThe right-hand argument type
ResultThe reduction result type
ReduceOpThe binary reduction operation type
JoinOpThe join operation type
Parameters
argThe right-hand argument
resultThe initial value of the reduction
opThe binary reduction operation
Returns
The reduced value

Definition at line 283 of file size_array.h.

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

◆ reduce() [2/2]

template<typename T >
template<typename Result , typename ReduceOp , typename JoinOp >
Result TiledArray::detail::SizeArray< T >::reduce ( Result  result,
const ReduceOp &  reduce_op,
const JoinOp &  join_op 
) const
inline

Unary reduction operation.

Perform an element-wise unary reduction of the data by executing join_op(result, reduce_op(*this[i])) for each i in the index range of this . result is initialized to identity . If HAVE_INTEL_TBB is defined the reduction will be executed in an undefined order, otherwise will execute in the order of increasing i .

Template Parameters
ResultThe reduction result type
ReduceOpThe binary reduction operation type
JoinOpThe join operation type
Parameters
resultThe initial value of the reduction
opThe unary reduction operation
Returns
The reduced value

Definition at line 301 of file size_array.h.

Here is the call graph for this function:

◆ rend() [1/2]

template<typename T >
reverse_iterator TiledArray::detail::SizeArray< T >::rend ( )
inline

Definition at line 125 of file size_array.h.

Here is the call graph for this function:

◆ rend() [2/2]

template<typename T >
const_reverse_iterator TiledArray::detail::SizeArray< T >::rend ( ) const
inline

Definition at line 126 of file size_array.h.

Here is the call graph for this function:

◆ row_reduce() [1/2]

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

Row reduce operation.

Reduce rows of arg matrix to this array. The reduced result is computed by op(*this[i], arg[i][j]).

Template Parameters
ArgThe matrix element type
OpThe reduction operation
Parameters
nThe number of columns in the matrix
argThe matrix pointer of size size()*n
opThe reduction operation

Definition at line 334 of file size_array.h.

Here is the call graph for this function:

◆ row_reduce() [2/2]

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

Row reduce operation.

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

Template Parameters
LeftThe matrix element type
RightThe vector element type
OpThe reduction operation
Parameters
nThe number of columns in the matrix
leftThe matrix pointer of size size()*n
rightThe vector pointer of size n
opThe reduction operation

Definition at line 319 of file size_array.h.

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

◆ set() [1/2]

template<typename T >
void TiledArray::detail::SizeArray< T >::set ( pointer const  first,
const size_type  n 
)
inline

Definition at line 69 of file size_array.h.

Here is the caller graph for this function:

◆ set() [2/2]

template<typename T >
void TiledArray::detail::SizeArray< T >::set ( pointer const  first,
pointer const  last 
)
inline

Definition at line 74 of file size_array.h.

◆ size()

template<typename T >
size_type TiledArray::detail::SizeArray< T >::size ( ) const
inline

Definition at line 167 of file size_array.h.

Here is the caller graph for this function:

◆ swap()

template<typename T >
void TiledArray::detail::SizeArray< T >::swap ( SizeArray< T > &  other)
inline

Definition at line 172 of file size_array.h.

Here is the call graph for this function:

◆ unary() [1/2]

template<typename T >
template<typename Arg , typename Op >
void TiledArray::detail::SizeArray< T >::unary ( const Arg *const  arg,
const Op &  op 
)
inline

Unary vector operation.

Unary operation sets the values of this array such that, *this[i] = op(arg[i]). The result type of op must be value_type or implicitly convertible to value_type.

Template Parameters
ArgThe argument type
OpThe unary operation type
Parameters
argThe argument
opThe unary, element operation

Definition at line 266 of file size_array.h.

Here is the call graph for this function:

◆ unary() [2/2]

template<typename T >
template<typename Op >
void TiledArray::detail::SizeArray< T >::unary ( const Op &  op)
inline

Unary vector operation.

Unary operation where this object is the argument. The values of this array is set by op(*this[i]).

Template Parameters
OpThe binary operation type
Parameters
opThe binary operation

Definition at line 252 of file size_array.h.

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

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