TiledArray  0.7.0
TiledArray::math Namespace Reference

Classes

struct  BinaryReduceWrapper
 Binary reduction wrapper class that handles lazy tile evaluation. More...
 
struct  BinaryReduceWrapper< typename Op::first_argument_type, typename Op::second_argument_type, Op >
 Binary reduction operation wrapper. More...
 
class  Block
 
class  GemmHelper
 Contraction to *GEMM helper. More...
 
class  GemmTask
 
class  MatrixBlockTask
 
class  OuterVectorOpUnwind
 Outer algorithm automatic loop unwinding. More...
 
class  OuterVectorOpUnwind< 0 >
 
class  PartialReduceUnwind
 Partial reduce algorithm automatic loop unwinding. More...
 
class  PartialReduceUnwind< 0 >
 
class  TransposeUnwind
 Partial transpose algorithm automatic loop unwinding. More...
 
class  TransposeUnwind< 0 >
 
class  UnaryReduceWrapper
 Unary reduction wrapper class that handles lazy tile evaluation. More...
 
class  UnaryReduceWrapper< typename Op::argument_type, Op >
 Unary reduction wrapper class that handles lazy tile evaluation. More...
 
struct  VectorOpUnwind
 Vector loop unwind helper class. More...
 
struct  VectorOpUnwind< 0ul >
 Vector loop unwind helper class. More...
 

Typedefs

typedef OuterVectorOpUnwind< TILEDARRAY_LOOP_UNWIND - 1 > OuterVectorOpUnwindN
 
typedef PartialReduceUnwind< TILEDARRAY_LOOP_UNWIND - 1 > PartialReduceUnwindN
 
typedef TransposeUnwind< TILEDARRAY_LOOP_UNWIND - 1 > TransposeUnwindN
 
typedef std::integral_constant< std::size_t, TILEDARRAY_CACHELINE_SIZE/sizeof(double)> LoopUnwind
 
typedef std::integral_constant< std::size_t, ~std::size_t(TILEDARRAY_LOOP_UNWIND - 1ul)> index_mask
 
typedef VectorOpUnwind< TILEDARRAY_LOOP_UNWIND - 1 > VecOpUnwindN
 

Functions

template<typename S1 , typename T1 , typename T2 , typename S2 , typename T3 >
void gemm (madness::cblas::CBLAS_TRANSPOSE op_a, madness::cblas::CBLAS_TRANSPOSE op_b, const integer m, const integer n, const integer k, const S1 alpha, const T1 *a, const integer lda, const T2 *b, const integer ldb, const S2 beta, T3 *c, const integer ldc)
 
void gemm (madness::cblas::CBLAS_TRANSPOSE op_a, madness::cblas::CBLAS_TRANSPOSE op_b, const integer m, const integer n, const integer k, const float alpha, const float *a, const integer lda, const float *b, const integer ldb, const float beta, float *c, const integer ldc)
 
void gemm (madness::cblas::CBLAS_TRANSPOSE op_a, madness::cblas::CBLAS_TRANSPOSE op_b, const integer m, const integer n, const integer k, const double alpha, const double *a, const integer lda, const double *b, const integer ldb, const double beta, double *c, const integer ldc)
 
void gemm (madness::cblas::CBLAS_TRANSPOSE op_a, madness::cblas::CBLAS_TRANSPOSE op_b, const integer m, const integer n, const integer k, const std::complex< float > alpha, const std::complex< float > *a, const integer lda, const std::complex< float > *b, const integer ldb, const std::complex< float > beta, std::complex< float > *c, const integer ldc)
 
void gemm (madness::cblas::CBLAS_TRANSPOSE op_a, madness::cblas::CBLAS_TRANSPOSE op_b, const integer m, const integer n, const integer k, const std::complex< double > alpha, const std::complex< double > *a, const integer lda, const std::complex< double > *b, const integer ldb, const std::complex< double > beta, std::complex< double > *c, const integer ldc)
 
template<typename T , typename U >
std::enable_if< detail::is_numeric< T >::value >::type scale (const integer n, const T alpha, U *x)
 
void scale (const integer n, const float alpha, float *x)
 
void scale (const integer n, const double alpha, double *x)
 
void scale (const integer n, const std::complex< float > alpha, std::complex< float > *x)
 
void scale (const integer n, const std::complex< double > alpha, std::complex< double > *x)
 
void scale (const integer n, const float alpha, std::complex< float > *x)
 
void scale (const integer n, const double alpha, std::complex< double > *x)
 
template<typename T , typename U >
dot (const integer n, const T *x, const U *y)
 
float dot (integer n, const float *x, const float *y)
 
double dot (integer n, const double *x, const double *y)
 
std::complex< float > dot (integer n, const std::complex< float > *x, const std::complex< float > *y)
 
std::complex< double > dot (integer n, const std::complex< double > *x, const std::complex< double > *y)
 
template<typename T >
Eigen::Map< const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor >, Eigen::AutoAlign > eigen_map (const T *t, const std::size_t m, const std::size_t n)
 Construct a const Eigen::Map object for a given Tensor object. More...
 
template<typename T >
Eigen::Map< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor >, Eigen::AutoAlign > eigen_map (T *t, const std::size_t m, const std::size_t n)
 Construct an Eigen::Map object for a given Tensor object. More...
 
template<typename T >
Eigen::Map< const Eigen::Matrix< T, Eigen::Dynamic, 1 >, Eigen::AutoAlign > eigen_map (const T *t, const std::size_t n)
 Construct a const Eigen::Map object for a given Tensor object. More...
 
template<typename T >
Eigen::Map< Eigen::Matrix< T, Eigen::Dynamic, 1 >, Eigen::AutoAlign > eigen_map (T *t, const std::size_t n)
 Construct an Eigen::Map object for a given Tensor object. More...
 
template<typename X , typename Y , typename A , typename Op >
void outer_fill (const std::size_t m, const std::size_t n, const X *const x, const Y *const y, A *a, const Op &op)
 Compute and store outer of x and y in a. More...
 
template<typename X , typename Y , typename A , typename Op >
void outer (const std::size_t m, const std::size_t n, const X *const x, const Y *const y, A *a, const Op &op)
 Compute the outer of x and y to modify a. More...
 
template<typename X , typename Y , typename A , typename B , typename Op >
void outer_fill (const std::size_t m, const std::size_t n, const X *MADNESS_RESTRICT const x, const Y *MADNESS_RESTRICT const y, const A *MADNESS_RESTRICT a, B *MADNESS_RESTRICT b, const Op &op)
 Compute the outer of x, y, and a, and store the result in b. More...
 
template<typename Left , typename Right , typename Result , typename Op >
void row_reduce (const std::size_t m, const std::size_t n, const Left *MADNESS_RESTRICT const left, const Right *MADNESS_RESTRICT const right, Result *MADNESS_RESTRICT const result, const Op &op)
 Reduce the rows of a matrix. More...
 
template<typename Arg , typename Result , typename Op >
void row_reduce (const std::size_t m, const std::size_t n, const Arg *MADNESS_RESTRICT const arg, Result *MADNESS_RESTRICT const result, const Op &op)
 Reduce the rows of a matrix. More...
 
template<typename Left , typename Right , typename Result , typename Op >
void col_reduce (const std::size_t m, const std::size_t n, const Left *MADNESS_RESTRICT const left, const Right *MADNESS_RESTRICT const right, Result *MADNESS_RESTRICT const result, const Op &op)
 Reduce the columns of a matrix. More...
 
template<typename Arg , typename Result , typename Op >
void col_reduce (const std::size_t m, const std::size_t n, const Arg *MADNESS_RESTRICT const arg, Result *MADNESS_RESTRICT const result, const Op &op)
 Reduce the columns of a matrix. More...
 
template<typename InputOp , typename OutputOp , typename Result , typename... Args>
TILEDARRAY_FORCE_INLINE void transpose_block (InputOp &&input_op, OutputOp &&output_op, const std::size_t result_stride, Result *const result, const std::size_t arg_stride, const Args *const ... args)
 
template<typename InputOp , typename OutputOp , typename Result , typename... Args>
TILEDARRAY_FORCE_INLINE void transpose_block (InputOp &&input_op, OutputOp &&output_op, const std::size_t m, const std::size_t n, const std::size_t result_stride, Result *MADNESS_RESTRICT const result, const std::size_t arg_stride, const Args *MADNESS_RESTRICT const ... args)
 
template<typename InputOp , typename OutputOp , typename Result , typename... Args>
void transpose (InputOp &&input_op, OutputOp &&output_op, const std::size_t m, const std::size_t n, const std::size_t result_stride, Result *result, const std::size_t arg_stride, const Args *const ... args)
 Matrix transpose and initialization. More...
 
template<typename Op , typename Result , typename... Args>
TILEDARRAY_FORCE_INLINE void for_each_block (Op &&op, Result *const result, const Args *const ... args)
 
template<typename Op , typename Result , typename... Args>
TILEDARRAY_FORCE_INLINE void for_each_block (Op &&op, Block< Result > &result, Block< Args > &&... args)
 
template<typename Op , typename Result , typename... Args>
TILEDARRAY_FORCE_INLINE void for_each_block_n (Op &&op, const std::size_t n, Result *MADNESS_RESTRICT const result, const Args *MADNESS_RESTRICT const ... args)
 
template<typename Op , typename Result , typename... Args>
TILEDARRAY_FORCE_INLINE std::enable_if<(sizeof...(Args) >=0)>::type for_each_block_ptr (Op &&op, Result *const result, const Args *const ... args)
 
template<typename Op , typename Result , typename... Args>
TILEDARRAY_FORCE_INLINE std::enable_if<(sizeof...(Args) > 0)>::type for_each_block_ptr (Op &&op, Result *const result, Block< Args > &&... args)
 
template<typename Op , typename Result , typename... Args>
TILEDARRAY_FORCE_INLINE void for_each_block_ptr_n (Op &&op, const std::size_t n, Result *MADNESS_RESTRICT const result, const Args *MADNESS_RESTRICT const ... args)
 
template<typename Op , typename Result , typename... Args>
TILEDARRAY_FORCE_INLINE void reduce_block (Op &&op, Result &result, const Args *const ... args)
 
template<typename Op , typename Result , typename... Args>
TILEDARRAY_FORCE_INLINE void reduce_block (Op &&op, Result &result, Block< Args > &&... args)
 
template<typename Op , typename Result , typename... Args>
TILEDARRAY_FORCE_INLINE void reduce_block_n (Op &&op, const std::size_t n, Result &MADNESS_RESTRICT result, const Args *MADNESS_RESTRICT const ... args)
 
template<typename Result , typename Arg >
TILEDARRAY_FORCE_INLINE void copy_block (Result *const result, const Arg *const arg)
 
template<typename Arg , typename Result >
TILEDARRAY_FORCE_INLINE void copy_block_n (std::size_t n, Result *const result, const Arg *const arg)
 
template<typename Arg , typename Result >
TILEDARRAY_FORCE_INLINE void scatter_block (Result *const result, const std::size_t stride, const Arg *const arg)
 
template<typename Result , typename Arg >
TILEDARRAY_FORCE_INLINE void scatter_block_n (const std::size_t n, Result *result, const std::size_t stride, const Arg *const arg)
 
template<typename Result , typename Arg >
TILEDARRAY_FORCE_INLINE void gather_block (Result *const result, const Arg *const arg, const std::size_t stride)
 
template<typename Arg , typename Result >
TILEDARRAY_FORCE_INLINE void gather_block_n (const std::size_t n, Result *const result, const Arg *const arg, const std::size_t stride)
 
template<typename Op , typename Result , typename... Args, typename std::enable_if< std::is_void< typename std::result_of< Op(Result &, Args...)>::type >::value >::type * = nullptr>
void inplace_vector_op_serial (Op &&op, const std::size_t n, Result *const result, const Args *const ... args)
 
template<typename Op , typename Result , typename... Args, typename std::enable_if< std::is_void< typename std::result_of< Op(Result &, Args...)>::type >::value >::type * = nullptr>
void inplace_vector_op (Op &&op, const std::size_t n, Result *const result, const Args *const ... args)
 
template<typename Op , typename Result , typename... Args, typename std::enable_if<! std::is_void< typename std::result_of< Op(Args...)>::type >::value >::type * = nullptr>
void vector_op_serial (Op &&op, const std::size_t n, Result *const result, const Args *const ... args)
 
template<typename Op , typename Result , typename... Args, typename std::enable_if<! std::is_void< typename std::result_of< Op(Args...)>::type >::value >::type * = nullptr>
void vector_op (Op &&op, const std::size_t n, Result *const result, const Args *const ... args)
 
template<typename Op , typename Result , typename... Args>
void vector_ptr_op_serial (Op &&op, const std::size_t n, Result *const result, const Args *const ... args)
 
template<typename Op , typename Result , typename... Args>
void vector_ptr_op (Op &&op, const std::size_t n, Result *const result, const Args *const ... args)
 
template<typename Op , typename Result , typename... Args>
void reduce_op_serial (Op &&op, const std::size_t n, Result &result, const Args *const ... args)
 
template<typename ReduceOp , typename JoinOp , typename Result , typename... Args>
void reduce_op (ReduceOp &&reduce_op, JoinOp &&join_op, const Result &identity, const std::size_t n, Result &result, const Args *const ... args)
 
template<typename Arg , typename Result >
std::enable_if<!(std::is_same< Arg, Result >::value &&std::is_scalar< Arg >::value)>::type copy_vector (const std::size_t n, const Arg *const arg, Result *const result)
 
template<typename T >
std::enable_if< std::is_scalar< T >::value >::type copy_vector (const std::size_t n, const T *const arg, T *const result)
 
template<typename Arg , typename Result >
void fill_vector (const std::size_t n, const Arg &arg, Result *const result)
 
template<typename Arg , typename Result >
std::enable_if<!(std::is_scalar< Arg >::value &&std::is_scalar< Result >::value)>::type uninitialized_copy_vector (const std::size_t n, const Arg *const arg, Result *const result)
 
template<typename Arg , typename Result >
std::enable_if< std::is_scalar< Arg >::value &&std::is_scalar< Result >::value >::type uninitialized_copy_vector (const std::size_t n, const Arg *const arg, Result *const result)
 
template<typename Arg , typename Result >
std::enable_if<!(std::is_scalar< Arg >::value &&std::is_scalar< Result >::value)>::type uninitialized_fill_vector (const std::size_t n, const Arg &arg, Result *const result)
 
template<typename Arg , typename Result >
std::enable_if< std::is_scalar< Arg >::value &&std::is_scalar< Result >::value >::type uninitialized_fill_vector (const std::size_t n, const Arg &arg, Result *const result)
 
template<typename Arg >
std::enable_if<! std::is_scalar< Arg >::value >::type destroy_vector (const std::size_t n, Arg *const arg)
 
template<typename Arg >
std::enable_if< std::is_scalar< Arg >::value >::type destroy_vector (const std::size_t, const Arg *const)
 
template<typename Arg , typename Result , typename Op >
std::enable_if<!(std::is_scalar< Arg >::value &&std::is_scalar< Result >::value)>::type uninitialized_unary_vector_op (const std::size_t n, const Arg *const arg, Result *const result, Op &&op)
 
template<typename Arg , typename Result , typename Op >
std::enable_if< std::is_scalar< Arg >::value &&std::is_scalar< Result >::value >::type uninitialized_unary_vector_op (const std::size_t n, const Arg *const arg, Result *const result, Op &&op)
 
template<typename Left , typename Right , typename Result , typename Op >
std::enable_if<!(std::is_scalar< Left >::value &&std::is_scalar< Right >::value &&std::is_scalar< Result >::value)>::type uninitialized_binary_vector_op (const std::size_t n, const Left *const left, const Right *const right, Result *const result, Op &&op)
 
template<typename Left , typename Right , typename Result , typename Op >
std::enable_if< std::is_scalar< Left >::value &&std::is_scalar< Right >::value &&std::is_scalar< Result >::value >::type uninitialized_binary_vector_op (const std::size_t n, const Left *const left, const Right *const right, Result *const result, Op &&op)
 

Typedef Documentation

◆ index_mask

typedef std::integral_constant<std::size_t, ~std::size_t(TILEDARRAY_LOOP_UNWIND - 1ul)> TiledArray::math::index_mask

Definition at line 44 of file vector_op.h.

◆ LoopUnwind

typedef std::integral_constant<std::size_t, TILEDARRAY_CACHELINE_SIZE / sizeof(double)> TiledArray::math::LoopUnwind

Definition at line 43 of file vector_op.h.

◆ OuterVectorOpUnwindN

◆ PartialReduceUnwindN

◆ TransposeUnwindN

◆ VecOpUnwindN

Function Documentation

◆ col_reduce() [1/2]

template<typename Left , typename Right , typename Result , typename Op >
void TiledArray::math::col_reduce ( const std::size_t  m,
const std::size_t  n,
const Left *MADNESS_RESTRICT const  left,
const Right *MADNESS_RESTRICT const  right,
Result *MADNESS_RESTRICT const  result,
const Op &  op 
)

Reduce the columns of a matrix.

op(result[j], left[i][j], right[i]).

Template Parameters
LeftThe left-hand vector element type
RightThe right-hand vector element type
ResultThe a matrix element type
OpThe operator type
Parameters
[in]mThe number of rows in left
[in]nThe size of the right-hand vector
[in]leftAn m*n matrix
[in]rightA vector of size m
[out]resultThe result vector of size n
[in]opThe operation that will reduce the columns of left

Definition at line 336 of file partial_reduce.h.

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

◆ col_reduce() [2/2]

template<typename Arg , typename Result , typename Op >
void TiledArray::math::col_reduce ( const std::size_t  m,
const std::size_t  n,
const Arg *MADNESS_RESTRICT const  arg,
Result *MADNESS_RESTRICT const  result,
const Op &  op 
)

Reduce the columns of a matrix.

op(result[j], arg[i][j]).

Template Parameters
ArgThe argument vector element type
ResultThe a matrix element type
OpThe operator type
Parameters
[in]mThe number of rows in left
[in]nThe size of the right-hand vector
[in]argAn m*n matrix
[out]resultThe result vector of size n
[in]opThe operation that will reduce the columns of left

Definition at line 408 of file partial_reduce.h.

Here is the call graph for this function:

◆ copy_block()

template<typename Result , typename Arg >
TILEDARRAY_FORCE_INLINE void TiledArray::math::copy_block ( Result *const  result,
const Arg *const  arg 
)

Definition at line 220 of file vector_op.h.

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

◆ copy_block_n()

template<typename Arg , typename Result >
TILEDARRAY_FORCE_INLINE void TiledArray::math::copy_block_n ( std::size_t  n,
Result *const  result,
const Arg *const  arg 
)

Definition at line 227 of file vector_op.h.

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

◆ copy_vector() [1/2]

template<typename Arg , typename Result >
std::enable_if<! (std::is_same<Arg, Result>::value && std::is_scalar<Arg>::value)>::type TiledArray::math::copy_vector ( const std::size_t  n,
const Arg *const  arg,
Result *const  result 
)

Definition at line 659 of file vector_op.h.

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

◆ copy_vector() [2/2]

template<typename T >
std::enable_if<std::is_scalar<T>::value>::type TiledArray::math::copy_vector ( const std::size_t  n,
const T *const  arg,
T *const  result 
)
inline

Definition at line 675 of file vector_op.h.

◆ destroy_vector() [1/2]

template<typename Arg >
std::enable_if<! std::is_scalar<Arg>::value>::type TiledArray::math::destroy_vector ( const std::size_t  n,
Arg *const  arg 
)

Definition at line 720 of file vector_op.h.

Here is the call graph for this function:

◆ destroy_vector() [2/2]

template<typename Arg >
std::enable_if<std::is_scalar<Arg>::value>::type TiledArray::math::destroy_vector ( const std::size_t  ,
const Arg *  const 
)
inline

Definition at line 727 of file vector_op.h.

◆ dot() [1/5]

template<typename T , typename U >
T TiledArray::math::dot ( const integer  n,
const T *  x,
const U *  y 
)

Definition at line 203 of file blas.h.

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

◆ dot() [2/5]

float TiledArray::math::dot ( integer  n,
const float *  x,
const float *  y 
)
inline

Definition at line 207 of file blas.h.

Here is the call graph for this function:

◆ dot() [3/5]

double TiledArray::math::dot ( integer  n,
const double *  x,
const double *  y 
)
inline

Definition at line 211 of file blas.h.

Here is the call graph for this function:

◆ dot() [4/5]

std::complex<float> TiledArray::math::dot ( integer  n,
const std::complex< float > *  x,
const std::complex< float > *  y 
)
inline

Definition at line 215 of file blas.h.

Here is the call graph for this function:

◆ dot() [5/5]

std::complex<double> TiledArray::math::dot ( integer  n,
const std::complex< double > *  x,
const std::complex< double > *  y 
)
inline

Definition at line 219 of file blas.h.

Here is the caller graph for this function:

◆ eigen_map() [1/4]

template<typename T >
Eigen::Map<const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>, Eigen::AutoAlign> TiledArray::math::eigen_map ( const T *  t,
const std::size_t  m,
const std::size_t  n 
)
inline

Construct a const Eigen::Map object for a given Tensor object.

Template Parameters
TThe element type
Parameters
tThe buffer pointer
mThe number of rows in the result matrix
nThe number of columns in the result matrix
Returns
An m x n Eigen matrix map for tensor
Exceptions
TiledArray::ExceptionWhen m * n is not equal to tensor size

Definition at line 51 of file eigen.h.

Here is the caller graph for this function:

◆ eigen_map() [2/4]

template<typename T >
Eigen::Map<Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>, Eigen::AutoAlign> TiledArray::math::eigen_map ( T *  t,
const std::size_t  m,
const std::size_t  n 
)
inline

Construct an Eigen::Map object for a given Tensor object.

Template Parameters
TThe tensor element type
Parameters
tThe tensor object
mThe number of rows in the result matrix
nThe number of columns in the result matrix
Returns
An m x n Eigen matrix map for tensor
Exceptions
TiledArray::ExceptionWhen m * n is not equal to tensor size

Definition at line 69 of file eigen.h.

◆ eigen_map() [3/4]

template<typename T >
Eigen::Map<const Eigen::Matrix<T, Eigen::Dynamic, 1>, Eigen::AutoAlign> TiledArray::math::eigen_map ( const T *  t,
const std::size_t  n 
)
inline

Construct a const Eigen::Map object for a given Tensor object.

Template Parameters
TThe element type
Parameters
tThe vector pointer
nThe number of elements in the result matrix
Returns
An n element Eigen vector map for tensor
Exceptions
TiledArray::ExceptionWhen n is not equal to tensor size

Definition at line 86 of file eigen.h.

◆ eigen_map() [4/4]

template<typename T >
Eigen::Map<Eigen::Matrix<T, Eigen::Dynamic, 1>, Eigen::AutoAlign> TiledArray::math::eigen_map ( T *  t,
const std::size_t  n 
)
inline

Construct an Eigen::Map object for a given Tensor object.

Template Parameters
TThe element type
Parameters
tThe vector pointer
nThe number of elements in the result matrix
Returns
An n element Eigen vector map for tensor
Exceptions
TiledArray::ExceptionWhen m * n is not equal to tensor size

Definition at line 101 of file eigen.h.

◆ fill_vector()

template<typename Arg , typename Result >
void TiledArray::math::fill_vector ( const std::size_t  n,
const Arg &  arg,
Result *const  result 
)

Definition at line 680 of file vector_op.h.

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

◆ for_each_block() [1/2]

template<typename Op , typename Result , typename... Args>
TILEDARRAY_FORCE_INLINE void TiledArray::math::for_each_block ( Op &&  op,
Result *const  result,
const Args *const ...  args 
)

Definition at line 152 of file vector_op.h.

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

◆ for_each_block() [2/2]

template<typename Op , typename Result , typename... Args>
TILEDARRAY_FORCE_INLINE void TiledArray::math::for_each_block ( Op &&  op,
Block< Result > &  result,
Block< Args > &&...  args 
)

Definition at line 160 of file vector_op.h.

Here is the call graph for this function:

◆ for_each_block_n()

template<typename Op , typename Result , typename... Args>
TILEDARRAY_FORCE_INLINE void TiledArray::math::for_each_block_n ( Op &&  op,
const std::size_t  n,
Result *MADNESS_RESTRICT const  result,
const Args *MADNESS_RESTRICT const ...  args 
)

Definition at line 166 of file vector_op.h.

Here is the caller graph for this function:

◆ for_each_block_ptr() [1/2]

template<typename Op , typename Result , typename... Args>
TILEDARRAY_FORCE_INLINE std::enable_if<(sizeof...(Args) >= 0)>::type TiledArray::math::for_each_block_ptr ( Op &&  op,
Result *const  result,
const Args *const ...  args 
)

Definition at line 175 of file vector_op.h.

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

◆ for_each_block_ptr() [2/2]

template<typename Op , typename Result , typename... Args>
TILEDARRAY_FORCE_INLINE std::enable_if<(sizeof...(Args) > 0)>::type TiledArray::math::for_each_block_ptr ( Op &&  op,
Result *const  result,
Block< Args > &&...  args 
)

Definition at line 184 of file vector_op.h.

Here is the call graph for this function:

◆ for_each_block_ptr_n()

template<typename Op , typename Result , typename... Args>
TILEDARRAY_FORCE_INLINE void TiledArray::math::for_each_block_ptr_n ( Op &&  op,
const std::size_t  n,
Result *MADNESS_RESTRICT const  result,
const Args *MADNESS_RESTRICT const ...  args 
)

Definition at line 190 of file vector_op.h.

Here is the caller graph for this function:

◆ gather_block()

template<typename Result , typename Arg >
TILEDARRAY_FORCE_INLINE void TiledArray::math::gather_block ( Result *const  result,
const Arg *const  arg,
const std::size_t  stride 
)

Definition at line 250 of file vector_op.h.

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

◆ gather_block_n()

template<typename Arg , typename Result >
TILEDARRAY_FORCE_INLINE void TiledArray::math::gather_block_n ( const std::size_t  n,
Result *const  result,
const Arg *const  arg,
const std::size_t  stride 
)

Definition at line 256 of file vector_op.h.

◆ gemm() [1/5]

template<typename S1 , typename T1 , typename T2 , typename S2 , typename T3 >
void TiledArray::math::gemm ( madness::cblas::CBLAS_TRANSPOSE  op_a,
madness::cblas::CBLAS_TRANSPOSE  op_b,
const integer  m,
const integer  n,
const integer  k,
const S1  alpha,
const T1 *  a,
const integer  lda,
const T2 *  b,
const integer  ldb,
const S2  beta,
T3 *  c,
const integer  ldc 
)
inline

Definition at line 39 of file blas.h.

Here is the caller graph for this function:

◆ gemm() [2/5]

void TiledArray::math::gemm ( madness::cblas::CBLAS_TRANSPOSE  op_a,
madness::cblas::CBLAS_TRANSPOSE  op_b,
const integer  m,
const integer  n,
const integer  k,
const float  alpha,
const float *  a,
const integer  lda,
const float *  b,
const integer  ldb,
const float  beta,
float *  c,
const integer  ldc 
)
inline

Definition at line 132 of file blas.h.

Here is the call graph for this function:

◆ gemm() [3/5]

void TiledArray::math::gemm ( madness::cblas::CBLAS_TRANSPOSE  op_a,
madness::cblas::CBLAS_TRANSPOSE  op_b,
const integer  m,
const integer  n,
const integer  k,
const double  alpha,
const double *  a,
const integer  lda,
const double *  b,
const integer  ldb,
const double  beta,
double *  c,
const integer  ldc 
)
inline

Definition at line 140 of file blas.h.

Here is the call graph for this function:

◆ gemm() [4/5]

void TiledArray::math::gemm ( madness::cblas::CBLAS_TRANSPOSE  op_a,
madness::cblas::CBLAS_TRANSPOSE  op_b,
const integer  m,
const integer  n,
const integer  k,
const std::complex< float >  alpha,
const std::complex< float > *  a,
const integer  lda,
const std::complex< float > *  b,
const integer  ldb,
const std::complex< float >  beta,
std::complex< float > *  c,
const integer  ldc 
)
inline

Definition at line 148 of file blas.h.

Here is the call graph for this function:

◆ gemm() [5/5]

void TiledArray::math::gemm ( madness::cblas::CBLAS_TRANSPOSE  op_a,
madness::cblas::CBLAS_TRANSPOSE  op_b,
const integer  m,
const integer  n,
const integer  k,
const std::complex< double >  alpha,
const std::complex< double > *  a,
const integer  lda,
const std::complex< double > *  b,
const integer  ldb,
const std::complex< double >  beta,
std::complex< double > *  c,
const integer  ldc 
)
inline

Definition at line 157 of file blas.h.

Here is the caller graph for this function:

◆ inplace_vector_op()

template<typename Op , typename Result , typename... Args, typename std::enable_if< std::is_void< typename std::result_of< Op(Result &, Args...)>::type >::value >::type * = nullptr>
void TiledArray::math::inplace_vector_op ( Op &&  op,
const std::size_t  n,
Result *const  result,
const Args *const ...  args 
)

Definition at line 397 of file vector_op.h.

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

◆ inplace_vector_op_serial()

template<typename Op , typename Result , typename... Args, typename std::enable_if< std::is_void< typename std::result_of< Op(Result &, Args...)>::type >::value >::type * = nullptr>
void TiledArray::math::inplace_vector_op_serial ( Op &&  op,
const std::size_t  n,
Result *const  result,
const Args *const ...  args 
)

Definition at line 344 of file vector_op.h.

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

◆ outer()

template<typename X , typename Y , typename A , typename Op >
void TiledArray::math::outer ( const std::size_t  m,
const std::size_t  n,
const X *const  x,
const Y *const  y,
A *  a,
const Op &  op 
)

Compute the outer of x and y to modify a.

Compute op(a[i][j], x[i], y[j]) for each i and j pair, where a[i][j] is modified by op.

Template Parameters
XThe left hand vector element type
YThe right-hand vector element type
AThe a matrix element type
OpThe operation that will compute outer product elements
Parameters
[in]mThe size of the left-hand vector
[in]nThe size of the right-hand vector
[in]xThe left-hand vector
[in]yThe right-hand vector
[in,out]aThe result matrix of size m*n
[in]opThe operation used to generate the result

Definition at line 248 of file outer.h.

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

◆ outer_fill() [1/2]

template<typename X , typename Y , typename A , typename Op >
void TiledArray::math::outer_fill ( const std::size_t  m,
const std::size_t  n,
const X *const  x,
const Y *const  y,
A *  a,
const Op &  op 
)

Compute and store outer of x and y in a.

a[i][j] = op(x[i], y[j]).

Template Parameters
XThe left-hand vector element type
YThe right-hand vector element type
AThe a matrix element type
Parameters
[in]mThe size of the left-hand vector
[in]nThe size of the right-hand vector
[in]xThe left-hand vector
[in]yThe right-hand vector
[out]aThe result matrix of size m*n
[in]opThe operation that will compute the outer product elements

Definition at line 180 of file outer.h.

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

◆ outer_fill() [2/2]

template<typename X , typename Y , typename A , typename B , typename Op >
void TiledArray::math::outer_fill ( const std::size_t  m,
const std::size_t  n,
const X *MADNESS_RESTRICT const  x,
const Y *MADNESS_RESTRICT const  y,
const A *MADNESS_RESTRICT  a,
B *MADNESS_RESTRICT  b,
const Op &  op 
)

Compute the outer of x, y, and a, and store the result in b.

Store a modified copy of a in b, where modified elements are generated using the following algorithm:

A temp = a[i][j];
op(temp, x[i], y[j]);
b[i][j] = temp;

for each unique pair of i and j.

Template Parameters
XThe left hand vector element type
YThe right-hand vector element type
AThe a matrix element type
BThe b matrix element type
OpThe operation that will compute outer product elements
Parameters
[in]mThe size of the left-hand vector
[in]nThe size of the right-hand vector
[in]xThe left-hand vector
[in]yThe right-hand vector
[in]aThe input matrix of size m*n
[out]bThe output matrix of size m*n
[in]opThe operation that will compute the outer product elements

Definition at line 329 of file outer.h.

Here is the call graph for this function:

◆ reduce_block() [1/2]

template<typename Op , typename Result , typename... Args>
TILEDARRAY_FORCE_INLINE void TiledArray::math::reduce_block ( Op &&  op,
Result &  result,
const Args *const ...  args 
)

Definition at line 199 of file vector_op.h.

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

◆ reduce_block() [2/2]

template<typename Op , typename Result , typename... Args>
TILEDARRAY_FORCE_INLINE void TiledArray::math::reduce_block ( Op &&  op,
Result &  result,
Block< Args > &&...  args 
)

Definition at line 205 of file vector_op.h.

Here is the call graph for this function:

◆ reduce_block_n()

template<typename Op , typename Result , typename... Args>
TILEDARRAY_FORCE_INLINE void TiledArray::math::reduce_block_n ( Op &&  op,
const std::size_t  n,
Result &MADNESS_RESTRICT  result,
const Args *MADNESS_RESTRICT const ...  args 
)

Definition at line 211 of file vector_op.h.

Here is the caller graph for this function:

◆ reduce_op()

template<typename ReduceOp , typename JoinOp , typename Result , typename... Args>
void TiledArray::math::reduce_op ( ReduceOp &&  reduce_op,
JoinOp &&  join_op,
const Result &  identity,
const std::size_t  n,
Result &  result,
const Args *const ...  args 
)

Definition at line 640 of file vector_op.h.

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

◆ reduce_op_serial()

template<typename Op , typename Result , typename... Args>
void TiledArray::math::reduce_op_serial ( Op &&  op,
const std::size_t  n,
Result &  result,
const Args *const ...  args 
)

Definition at line 567 of file vector_op.h.

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

◆ row_reduce() [1/2]

template<typename Left , typename Right , typename Result , typename Op >
void TiledArray::math::row_reduce ( const std::size_t  m,
const std::size_t  n,
const Left *MADNESS_RESTRICT const  left,
const Right *MADNESS_RESTRICT const  right,
Result *MADNESS_RESTRICT const  result,
const Op &  op 
)

Reduce the rows of a matrix.

op(result[i], left[i][j], right[j]).

Template Parameters
LeftThe left-hand matrix element type
RightThe right-hand vector element type
ResultThe result vector element type
Parameters
[in]mThe number of rows in left
[in]nThe size of the right-hand vector
[in]leftAn m*n matrix
[in]rightA vector of size n
[out]resultThe result vector of size m
[in]opThe operation that will reduce the rows of left

Definition at line 204 of file partial_reduce.h.

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

◆ row_reduce() [2/2]

template<typename Arg , typename Result , typename Op >
void TiledArray::math::row_reduce ( const std::size_t  m,
const std::size_t  n,
const Arg *MADNESS_RESTRICT const  arg,
Result *MADNESS_RESTRICT const  result,
const Op &  op 
)

Reduce the rows of a matrix.

op(result[i], arg[i][j]).

Template Parameters
ArgThe left-hand vector element type
ResultThe a matrix element type
OpThe operator type
Parameters
[in]mThe number of rows in left
[in]nThe size of the right-hand vector
[in]argAn m*n matrix
[out]resultThe result vector of size m
[in]opThe operation that will reduce the rows of left

Definition at line 274 of file partial_reduce.h.

Here is the call graph for this function:

◆ scale() [1/7]

template<typename T , typename U >
std::enable_if<detail::is_numeric<T>::value>::type TiledArray::math::scale ( const integer  n,
const T  alpha,
U *  x 
)
inline

Definition at line 171 of file blas.h.

Here is the call graph for this function:

◆ scale() [2/7]

void TiledArray::math::scale ( const integer  n,
const float  alpha,
float *  x 
)
inline

Definition at line 175 of file blas.h.

◆ scale() [3/7]

void TiledArray::math::scale ( const integer  n,
const double  alpha,
double *  x 
)
inline

Definition at line 179 of file blas.h.

◆ scale() [4/7]

void TiledArray::math::scale ( const integer  n,
const std::complex< float >  alpha,
std::complex< float > *  x 
)
inline

Definition at line 183 of file blas.h.

◆ scale() [5/7]

void TiledArray::math::scale ( const integer  n,
const std::complex< double >  alpha,
std::complex< double > *  x 
)
inline

Definition at line 187 of file blas.h.

◆ scale() [6/7]

void TiledArray::math::scale ( const integer  n,
const float  alpha,
std::complex< float > *  x 
)
inline

Definition at line 191 of file blas.h.

◆ scale() [7/7]

void TiledArray::math::scale ( const integer  n,
const double  alpha,
std::complex< double > *  x 
)
inline

Definition at line 195 of file blas.h.

◆ scatter_block()

template<typename Arg , typename Result >
TILEDARRAY_FORCE_INLINE void TiledArray::math::scatter_block ( Result *const  result,
const std::size_t  stride,
const Arg *const  arg 
)

Definition at line 234 of file vector_op.h.

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

◆ scatter_block_n()

template<typename Result , typename Arg >
TILEDARRAY_FORCE_INLINE void TiledArray::math::scatter_block_n ( const std::size_t  n,
Result *  result,
const std::size_t  stride,
const Arg *const  arg 
)

Definition at line 241 of file vector_op.h.

◆ transpose()

template<typename InputOp , typename OutputOp , typename Result , typename... Args>
void TiledArray::math::transpose ( InputOp &&  input_op,
OutputOp &&  output_op,
const std::size_t  m,
const std::size_t  n,
const std::size_t  result_stride,
Result *  result,
const std::size_t  arg_stride,
const Args *const ...  args 
)

Matrix transpose and initialization.

This function will transpose and transform argument matrices into an uninitialized block of memory

Template Parameters
InputOpThe input transform operation type
OutputOpThe output transform operation type
ResultThe result element type
ArgsThe argument element type
Parameters
[in]input_opThe transformation operation applied to input arguments
[in]output_opThe transformation operation used to set the result
[in]mThe number of rows in the argument matrix
[in]nThe number of columns in the argument matrix
[in]result_strideTHe stride between result rows
[out]resultA pointer to the first element of the result matrix
[in]arg_strideThe stride between argument rows
[in]argsA pointer to the first element of the argument matrix
Note
The data layout is expected to be row-major.

Definition at line 176 of file transpose.h.

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

◆ transpose_block() [1/2]

template<typename InputOp , typename OutputOp , typename Result , typename... Args>
TILEDARRAY_FORCE_INLINE void TiledArray::math::transpose_block ( InputOp &&  input_op,
OutputOp &&  output_op,
const std::size_t  result_stride,
Result *const  result,
const std::size_t  arg_stride,
const Args *const ...  args 
)

Definition at line 113 of file transpose.h.

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

◆ transpose_block() [2/2]

template<typename InputOp , typename OutputOp , typename Result , typename... Args>
TILEDARRAY_FORCE_INLINE void TiledArray::math::transpose_block ( InputOp &&  input_op,
OutputOp &&  output_op,
const std::size_t  m,
const std::size_t  n,
const std::size_t  result_stride,
Result *MADNESS_RESTRICT const  result,
const std::size_t  arg_stride,
const Args *MADNESS_RESTRICT const ...  args 
)

Definition at line 131 of file transpose.h.

◆ uninitialized_binary_vector_op() [1/2]

template<typename Left , typename Right , typename Result , typename Op >
std::enable_if<! (std::is_scalar<Left>::value && std::is_scalar<Right>::value && std::is_scalar<Result>::value)>::type TiledArray::math::uninitialized_binary_vector_op ( const std::size_t  n,
const Left *const  left,
const Right *const  right,
Result *const  result,
Op &&  op 
)

Definition at line 752 of file vector_op.h.

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

◆ uninitialized_binary_vector_op() [2/2]

template<typename Left , typename Right , typename Result , typename Op >
std::enable_if<std::is_scalar<Left>::value && std::is_scalar<Right>::value && std::is_scalar<Result>::value>::type TiledArray::math::uninitialized_binary_vector_op ( const std::size_t  n,
const Left *const  left,
const Right *const  right,
Result *const  result,
Op &&  op 
)

Definition at line 764 of file vector_op.h.

Here is the call graph for this function:

◆ uninitialized_copy_vector() [1/2]

template<typename Arg , typename Result >
std::enable_if<! (std::is_scalar<Arg>::value && std::is_scalar<Result>::value)>::type TiledArray::math::uninitialized_copy_vector ( const std::size_t  n,
const Arg *const  arg,
Result *const  result 
)

Definition at line 688 of file vector_op.h.

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

◆ uninitialized_copy_vector() [2/2]

template<typename Arg , typename Result >
std::enable_if<std::is_scalar<Arg>::value && std::is_scalar<Result>::value>::type TiledArray::math::uninitialized_copy_vector ( const std::size_t  n,
const Arg *const  arg,
Result *const  result 
)
inline

Definition at line 697 of file vector_op.h.

Here is the call graph for this function:

◆ uninitialized_fill_vector() [1/2]

template<typename Arg , typename Result >
std::enable_if<! (std::is_scalar<Arg>::value && std::is_scalar<Result>::value)>::type TiledArray::math::uninitialized_fill_vector ( const std::size_t  n,
const Arg &  arg,
Result *const  result 
)

Definition at line 703 of file vector_op.h.

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

◆ uninitialized_fill_vector() [2/2]

template<typename Arg , typename Result >
std::enable_if<std::is_scalar<Arg>::value && std::is_scalar<Result>::value>::type TiledArray::math::uninitialized_fill_vector ( const std::size_t  n,
const Arg &  arg,
Result *const  result 
)
inline

Definition at line 713 of file vector_op.h.

Here is the call graph for this function:

◆ uninitialized_unary_vector_op() [1/2]

template<typename Arg , typename Result , typename Op >
std::enable_if<! (std::is_scalar<Arg>::value && std::is_scalar<Result>::value)>::type TiledArray::math::uninitialized_unary_vector_op ( const std::size_t  n,
const Arg *const  arg,
Result *const  result,
Op &&  op 
)

Definition at line 732 of file vector_op.h.

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

◆ uninitialized_unary_vector_op() [2/2]

template<typename Arg , typename Result , typename Op >
std::enable_if<std::is_scalar<Arg>::value && std::is_scalar<Result>::value>::type TiledArray::math::uninitialized_unary_vector_op ( const std::size_t  n,
const Arg *const  arg,
Result *const  result,
Op &&  op 
)
inline

Definition at line 742 of file vector_op.h.

Here is the call graph for this function:

◆ vector_op()

template<typename Op , typename Result , typename... Args, typename std::enable_if<! std::is_void< typename std::result_of< Op(Args...)>::type >::value >::type * = nullptr>
void TiledArray::math::vector_op ( Op &&  op,
const std::size_t  n,
Result *const  result,
const Args *const ...  args 
)

Definition at line 478 of file vector_op.h.

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

◆ vector_op_serial()

template<typename Op , typename Result , typename... Args, typename std::enable_if<! std::is_void< typename std::result_of< Op(Args...)>::type >::value >::type * = nullptr>
void TiledArray::math::vector_op_serial ( Op &&  op,
const std::size_t  n,
Result *const  result,
const Args *const ...  args 
)

Definition at line 422 of file vector_op.h.

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

◆ vector_ptr_op()

template<typename Op , typename Result , typename... Args>
void TiledArray::math::vector_ptr_op ( Op &&  op,
const std::size_t  n,
Result *const  result,
const Args *const ...  args 
)

Definition at line 546 of file vector_op.h.

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

◆ vector_ptr_op_serial()

template<typename Op , typename Result , typename... Args>
void TiledArray::math::vector_ptr_op_serial ( Op &&  op,
const std::size_t  n,
Result *const  result,
const Args *const ...  args 
)

Definition at line 501 of file vector_op.h.

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