26 #ifndef TILEDARRAY_EXPRESSIONS_MULT_ENGINE_H__INCLUDED 27 #define TILEDARRAY_EXPRESSIONS_MULT_ENGINE_H__INCLUDED 35 namespace expressions {
38 template <
typename,
typename>
class MultExpr;
39 template <
typename,
typename,
typename>
class ScalMultExpr;
40 template <
typename,
typename,
typename>
class MultEngine;
43 template <
typename Left,
typename Right,
typename Result>
47 "The left- and right-hand expressions must use the same policy class");
67 typedef typename Left::policy
policy;
75 typedef typename policy::pmap_interface
79 static constexpr
unsigned int leaves =
83 template <
typename Left,
typename Right,
typename Scalar,
typename Result>
87 "The left- and right-hand expressions must use the same policy class");
114 typedef typename policy::pmap_interface
118 static constexpr
unsigned int leaves =
133 template <
typename Left,
typename Right,
typename Result>
185 template <
typename L,
typename R>
240 if(left_type::leaves <= right_type::leaves)
358 template <
typename Left,
typename Right,
typename Scalar,
typename Result>
359 class ScalMultEngine :
360 public ContEngine<ScalMultEngine<Left, Right, Scalar, Result> >
364 typedef ScalMultEngine<Left, Right, Scalar, Result>
416 template <
typename L,
typename R,
typename S>
468 if(left_type::leaves <= right_type::leaves)
570 std::stringstream ss;
591 #endif // TILEDARRAY_EXPRESSIONS_MULT_ENGINE_H__INCLUDED BinaryEngine< MultEngine_ > BinaryEngine_
Binary base class type.
Multiplication expression.
dist_eval_type make_dist_eval() const
Construct the distributed evaluator for this expression.
right_type right_
The right-hand argument.
void init_vars()
Initialize the variable list of this expression.
Op::result_type result_type
The result tile type.
ContEngine< ScalMultEngine_ > ContEngine_
Contraction engine base class.
TiledArray::detail::BinaryWrapper< op_base_type > op_type
The tile operation type.
void init_struct(const VariableList &target_vars)
Initialize result tensor structure.
void print(ExprOStream os, const VariableList &target_vars) const
Expression print.
void init_struct(const VariableList &target_vars)
Initialize result tensor structure.
eval_trait< value_type >::type eval_type
Evaluation tile type.
EngineTrait< ScalMultEngine_ >::right_type right_type
The right-hand expression type.
const Permutation & perm() const
Permutation accessor.
trange_type make_trange(const Permutation &perm) const
Permuting tiled range factory function.
EngineTrait< MultEngine_ >::shape_type shape_type
Shape type.
scalar_type factor_
Contraction scaling factor.
Left::policy policy
The result policy type.
BinaryEngine< MultEngine_ > ExprEngine_
Expression engine base class type.
TiledArray::detail::DistEval< value_type, policy > dist_eval_type
The distributed evaluator type.
EngineTrait< ScalMultEngine_ >::policy policy
The result policy type.
void init_struct(const VariableList &target_vars)
Initialize result tensor structure.
op_type::result_type value_type
The result tile type.
policy::shape_type shape_type
Shape type.
World * world() const
World accessor.
Type trait for extracting the numeric type of tensors and arrays.
shape_type make_shape(const Permutation &perm) const
Permuting shape factory function.
static op_type make_tile_op()
Non-permuting tile operation factory function.
void perm_vars(const VariableList &target_vars)
Set the variable list for this expression.
EngineTrait< ScalMultEngine_ >::left_type left_type
The left-hand expression type.
policy::shape_type shape_type
Shape type.
const shape_type & shape() const
Shape accessor.
EngineTrait< MultEngine_ >::value_type value_type
The result tile type.
void init_distribution(World *world, const std::shared_ptr< pmap_interface > &pmap)
Initialize result tensor distribution.
op_type make_tile_op() const
Non-permuting tile operation factory function.
ContEngine< MultEngine_ > ContEngine_
Contraction engine base class.
EngineTrait< MultEngine_ >::size_type size_type
Size type.
EngineTrait< ScalMultEngine_ >::op_base_type op_base_type
The tile operation type.
Multiplication expression.
const std::shared_ptr< pmap_interface > & pmap() const
Process map accessor.
VariableList vars_
The variable list of this expression.
void init_vars()
Initialize the variable list of this expression.
Left left_type
The left-hand expression type.
EngineTrait< MultEngine_ >::dist_eval_type dist_eval_type
The distributed evaluator type.
Right right_type
The right-hand expression type.
EngineTrait< MultEngine_ >::op_type op_type
The tile operation type.
const VariableList & vars() const
Variable list accessor.
TiledArray::detail::Mult< Result, typename EngineTrait< Left >::eval_type, typename EngineTrait< Right >::eval_type, EngineTrait< Left >::consumable, EngineTrait< Right >::consumable > op_base_type
The base tile operation type.
Left::policy policy
The result policy type.
policy::size_type size_type
Size type.
void print(ExprOStream os, const VariableList &target_vars) const
Expression print.
EngineTrait< MultEngine_ >::op_base_type op_base_type
The tile operation type.
void perm_vars(const VariableList &target_vars)
Set the variable list for this expression.
EngineTrait< MultEngine_ >::pmap_interface pmap_interface
Process map interface type.
void init_vars(const VariableList &target_vars)
Initialize the variable list of this expression.
EngineTrait< ScalMultEngine_ >::value_type value_type
The result tile type.
EngineTrait< ScalMultEngine_ >::op_type op_type
The tile operation type.
shape_type make_shape(const Permutation &perm) const
Permuting shape factory function.
EngineTrait< ScalMultEngine_ >::pmap_interface pmap_interface
Process map interface type.
MultEngine< Left, Right, Result > MultEngine_
This class type.
MultEngine(const MultExpr< L, R > &expr)
Constructor.
trange_type make_trange(const Permutation &perm) const
Permuting tiled range factory function.
Tensor expression object.
void init_distribution(World *world, std::shared_ptr< pmap_interface > pmap)
Initialize result tensor distribution.
Binary tile operation wrapper.
Variable list manages a list variable strings.
void init_distribution(World *world, std::shared_ptr< pmap_interface > pmap)
Initialize result tensor distribution.
BinaryEngine< ScalMultEngine_ > BinaryEngine_
Binary base class type.
void perm_vars()
Set the variable list for this expression.
Tile scale-multiplication operation.
EngineTrait< ScalMultEngine_ >::size_type size_type
Size type.
shape_type make_shape() const
Non-permuting shape factory function.
void init_struct(const VariableList &target_vars)
Initialize result tensor structure.
const char * make_tag() const
Expression identification tag.
std::string make_tag() const
Expression identification tag.
Scalar scalar_type
Tile scalar type.
policy::trange_type trange_type
Tiled range type.
void init_vars(const VariableList &target_vars)
Initialize the variable list of this expression.
policy::pmap_interface pmap_interface
Process map interface type.
TiledArray::detail::DistEval< value_type, policy > dist_eval_type
The distributed evaluator type.
ScalMultEngine< Left, Right, Scalar, Result > ScalMultEngine_
This class type.
trange_type make_trange() const
Non-permuting tiled range factory function.
eval_trait< value_type >::type eval_type
Evaluation tile type.
void perm_vars(const VariableList &target_vars)
Set the variable list for this expression.
Multiplication expression engine.
BinaryEngine< ScalMultEngine_ > ExprEngine_
Expression engine base class type.
policy::trange_type trange_type
Tiled range type.
dist_eval_type make_dist_eval() const
Construct the distributed evaluator for this expression.
Left left_type
The left-hand expression type.
policy::size_type size_type
Size type.
Consumable tile type trait.
Tile multiplication operation.
Right right_type
The right-hand expression type.
static op_type make_tile_op(const Permutation &perm)
Permuting tile operation factory function.
EngineTrait< MultEngine_ >::trange_type trange_type
Tiled range type.
EngineTrait< ScalMultEngine_ >::dist_eval_type dist_eval_type
The distributed evaluator type.
ScalMultEngine(const ScalMultExpr< L, R, S > &expr)
Constructor.
Permutation of a sequence of objects indexed by base-0 indices.
op_type::result_type value_type
The result tile type.
trange_type make_trange() const
Non-permuting tiled range factory function.
void init_vars()
Initialize the variable list of this expression.
void init_distribution(World *world, std::shared_ptr< pmap_interface > pmap)
Initialize result tensor distribution.
shape_type make_shape() const
Non-permuting shape factory function.
trange_type make_trange() const
Non-permuting tiled range factory function.
op_type make_tile_op(const Permutation &perm) const
Permuting tile operation factory function.
TiledArray::detail::numeric_type< value_type >::type scalar_type
Tile scalar type.
EngineTrait< MultEngine_ >::right_type right_type
The right-hand expression type.
EngineTrait< MultEngine_ >::left_type left_type
The left-hand expression type.
EngineTrait< ScalMultEngine_ >::shape_type shape_type
Shape type.
void perm_vars()
Set the variable list for this expression.
EngineTrait< ScalMultEngine_ >::scalar_type scalar_type
Tile scalar type.
Expression output stream.
Multiplication expression engine.
dist_eval_type make_dist_eval() const
void perm_vars(const VariableList &target_vars)
Set the variable list for this expression.
EngineTrait< MultEngine_ >::policy policy
The result policy type.
void print(ExprOStream os, const VariableList &target_vars) const
Expression print.
EngineTrait< ScalMultEngine_ >::trange_type trange_type
Tiled range type.
TiledArray::detail::ScalMult< Result, typename EngineTrait< Left >::eval_type, typename EngineTrait< Right >::eval_type, scalar_type, EngineTrait< Left >::consumable, EngineTrait< Right >::consumable > op_base_type
The base tile operation type.
left_type left_
The left-hand argument.
Scaled multiplication expression engine.
TiledArray::detail::BinaryWrapper< op_base_type > op_type
The tile operation type.
void print(ExprOStream os, const VariableList &target_vars) const
Expression print.
dist_eval_type make_dist_eval() const
Construct the distributed evaluator for this expression.
policy::pmap_interface pmap_interface
Process map interface type.