TiledArray  0.7.0
TiledArray::expressions::MultEngine< Left, Right, Result > Class Template Reference

Multiplication expression engine. More...

#include <mult_engine.h>

Inheritance diagram for TiledArray::expressions::MultEngine< Left, Right, Result >:
Collaboration diagram for TiledArray::expressions::MultEngine< Left, Right, Result >:

Public Types

typedef MultEngine< Left, Right, Result > MultEngine_
 This class type. More...
 
typedef ContEngine< MultEngine_ContEngine_
 Contraction engine base class. More...
 
typedef BinaryEngine< MultEngine_BinaryEngine_
 Binary base class type. More...
 
typedef BinaryEngine< MultEngine_ExprEngine_
 Expression engine base class type. More...
 
typedef EngineTrait< MultEngine_ >::left_type left_type
 The left-hand expression type. More...
 
typedef EngineTrait< MultEngine_ >::right_type right_type
 The right-hand expression type. More...
 
typedef EngineTrait< MultEngine_ >::value_type value_type
 The result tile type. More...
 
typedef EngineTrait< MultEngine_ >::op_base_type op_base_type
 The tile operation type. More...
 
typedef EngineTrait< MultEngine_ >::op_type op_type
 The tile operation type. More...
 
typedef EngineTrait< MultEngine_ >::policy policy
 The result policy type. More...
 
typedef EngineTrait< MultEngine_ >::dist_eval_type dist_eval_type
 The distributed evaluator type. More...
 
typedef EngineTrait< MultEngine_ >::size_type size_type
 Size type. More...
 
typedef EngineTrait< MultEngine_ >::trange_type trange_type
 Tiled range type. More...
 
typedef EngineTrait< MultEngine_ >::shape_type shape_type
 Shape type. More...
 
typedef EngineTrait< MultEngine_ >::pmap_interface pmap_interface
 Process map interface type. More...
 
- Public Types inherited from TiledArray::expressions::ContEngine< MultEngine< Left, Right, Result > >
typedef ContEngine< MultEngine< Left, Right, Result > > ContEngine_
 This class type. More...
 
typedef BinaryEngine< MultEngine< Left, Right, Result > > BinaryEngine_
 Binary base class type. More...
 
typedef ExprEngine< MultEngine< Left, Right, Result > > ExprEngine_
 Expression engine base class type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::left_type left_type
 The left-hand expression type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::right_type right_type
 The right-hand expression type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::value_type value_type
 The result tile type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::scalar_type scalar_type
 Tile scalar type. More...
 
typedef TiledArray::detail::ContractReduce< value_type, typename eval_trait< typename left_type::value_type >::type, typename eval_trait< typename right_type::value_type >::type, scalar_typeop_type
 The tile operation type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::policy policy
 The result policy type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::dist_eval_type dist_eval_type
 The distributed evaluator type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::size_type size_type
 Size type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::trange_type trange_type
 Tiled range type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::shape_type shape_type
 Shape type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::pmap_interface pmap_interface
 Process map interface type. More...
 
- Public Types inherited from TiledArray::expressions::BinaryEngine< MultEngine< Left, Right, Result > >
typedef BinaryEngine< MultEngine< Left, Right, Result > > BinaryEngine_
 This class type. More...
 
typedef ExprEngine< MultEngine< Left, Right, Result > > ExprEngine_
 Base class type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::left_type left_type
 The left-hand expression type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::right_type right_type
 The right-hand expression type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::value_type value_type
 The result tile type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::op_type op_type
 The tile operation type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::policy policy
 The result policy type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::dist_eval_type dist_eval_type
 The distributed evaluator type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::size_type size_type
 Size type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::trange_type trange_type
 Tiled range type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::shape_type shape_type
 Shape type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::pmap_interface pmap_interface
 Process map interface type. More...
 
- Public Types inherited from TiledArray::expressions::ExprEngine< MultEngine< Left, Right, Result > >
typedef ExprEngine< MultEngine< Left, Right, Result > > ExprEngine_
 
typedef MultEngine< Left, Right, Result > derived_type
 The derived object type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::value_type value_type
 Tensor value type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::op_type op_type
 Tile operation type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::policy policy
 The result policy type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::dist_eval_type dist_eval_type
 This expression's distributed evaluator type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::size_type size_type
 Size type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::trange_type trange_type
 Tiled range type type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::shape_type shape_type
 Tensor shape type. More...
 
typedef EngineTrait< MultEngine< Left, Right, Result > >::pmap_interface pmap_interface
 Process map interface type. More...
 

Public Member Functions

template<typename L , typename R >
 MultEngine (const MultExpr< L, R > &expr)
 Constructor. More...
 
void perm_vars (const VariableList &target_vars)
 Set the variable list for this expression. More...
 
void perm_vars ()
 Set the variable list for this expression. More...
 
void init_vars (const VariableList &target_vars)
 Initialize the variable list of this expression. More...
 
void init_vars ()
 Initialize the variable list of this expression. More...
 
void init_struct (const VariableList &target_vars)
 Initialize result tensor structure. More...
 
void init_distribution (World *world, std::shared_ptr< pmap_interface > pmap)
 Initialize result tensor distribution. More...
 
trange_type make_trange () const
 Non-permuting tiled range factory function. More...
 
trange_type make_trange (const Permutation &perm) const
 Permuting tiled range factory function. More...
 
shape_type make_shape () const
 Non-permuting shape factory function. More...
 
shape_type make_shape (const Permutation &perm) const
 Permuting shape factory function. More...
 
dist_eval_type make_dist_eval () const
 Construct the distributed evaluator for this expression. More...
 
const char * make_tag () const
 Expression identification tag. More...
 
void print (ExprOStream os, const VariableList &target_vars) const
 Expression print. More...
 
- Public Member Functions inherited from TiledArray::expressions::ContEngine< MultEngine< Left, Right, Result > >
 ContEngine (const MultExpr< L, R > &expr)
 Constructor. More...
 
 ContEngine (const ScalMultExpr< L, R, S > &expr)
 Constructor. More...
 
void perm_vars (const VariableList &target_vars)
 Set the variable list for this expression. More...
 
void init_vars ()
 Initialize the variable list of this expression. More...
 
void init_struct (const VariableList &target_vars)
 Initialize result tensor structure. More...
 
void init_distribution (World *world, std::shared_ptr< pmap_interface > pmap)
 Initialize result tensor distribution. More...
 
trange_type make_trange (const Permutation &perm=Permutation()) const
 Tiled range factory function. More...
 
shape_type make_shape () const
 Non-permuting shape factory function. More...
 
shape_type make_shape (const Permutation &perm) const
 Permuting shape factory function. More...
 
dist_eval_type make_dist_eval () const
 
std::string make_tag () const
 Expression identification tag. More...
 
void print (ExprOStream os, const VariableList &target_vars) const
 Expression print. More...
 
derived_typederived ()
 Cast this object to it's derived type. More...
 
const derived_typederived () const
 Cast this object to it's derived type. More...
 
const VariableListvars () const
 Variable list accessor. More...
 
- Public Member Functions inherited from TiledArray::expressions::BinaryEngine< MultEngine< Left, Right, Result > >
 BinaryEngine (const BinaryExpr< D > &expr)
 
void perm_vars (const VariableList &target_vars)
 Set the variable list for this expression. More...
 
void init_vars (const VariableList &target_vars)
 Initialize the variable list of this expression. More...
 
void init_vars ()
 Initialize the variable list of this expression. More...
 
void init_struct (const VariableList &target_vars)
 Initialize result tensor structure. More...
 
void init_distribution (World *world, const std::shared_ptr< pmap_interface > &pmap)
 Initialize result tensor distribution. More...
 
trange_type make_trange () const
 Non-permuting tiled range factory function. More...
 
trange_type make_trange (const Permutation &perm) const
 Permuting tiled range factory function. More...
 
dist_eval_type make_dist_eval () const
 Construct the distributed evaluator for this expression. More...
 
void print (ExprOStream os, const VariableList &target_vars) const
 Expression print. More...
 
- Public Member Functions inherited from TiledArray::expressions::ExprEngine< MultEngine< Left, Right, Result > >
 ExprEngine (const Expr< D > &expr)
 Default constructor. More...
 
void init (World &world, std::shared_ptr< pmap_interface > pmap, const VariableList &target_vars)
 Construct and initialize the expression engine. More...
 
void init_struct (const VariableList &target_vars)
 Initialize result tensor structure. More...
 
void init_distribution (World *world, const std::shared_ptr< pmap_interface > &pmap)
 Initialize result tensor distribution. More...
 
Permutation make_perm (const VariableList &target_vars) const
 Permutation factory function. More...
 
op_type make_op () const
 Tile operation factory function. More...
 
derived_typederived ()
 Cast this object to it's derived type. More...
 
const derived_typederived () const
 Cast this object to it's derived type. More...
 
World * world () const
 World accessor. More...
 
const VariableListvars () const
 Variable list accessor. More...
 
const Permutationperm () const
 Permutation accessor. More...
 
const trange_typetrange () const
 Tiled range accessor. More...
 
const shape_typeshape () const
 Shape accessor. More...
 
const std::shared_ptr< pmap_interface > & pmap () const
 Process map accessor. More...
 
void permute_tiles (const bool status)
 Set the permute tiles flag. More...
 
void print (ExprOStream &os, const VariableList &target_vars) const
 Expression print. More...
 
const char * make_tag () const
 Expression identification tag. More...
 

Static Public Member Functions

static op_type make_tile_op ()
 Non-permuting tile operation factory function. More...
 
static op_type make_tile_op (const Permutation &perm)
 Permuting tile operation factory function. More...
 

Additional Inherited Members

- Static Public Attributes inherited from TiledArray::expressions::BinaryEngine< MultEngine< Left, Right, Result > >
static constexpr bool consumable
 
static constexpr unsigned int leaves
 
- Protected Attributes inherited from TiledArray::expressions::ContEngine< MultEngine< Left, Right, Result > >
scalar_type factor_
 Contraction scaling factor. More...
 
World * world_
 The world where this expression will be evaluated. More...
 
VariableList vars_
 The variable list of this expression. More...
 
Permutation perm_
 The permutation that will be applied to the result. More...
 
trange_type trange_
 The tiled range of the result tensor. More...
 
shape_type shape_
 The shape of the result tensor. More...
 
std::shared_ptr< pmap_interfacepmap_
 The process map for the result tensor. More...
 
bool permute_tiles_
 Result tile permutation flag (true == permute tile) More...
 
left_type left_
 The left-hand argument. More...
 
right_type right_
 The right-hand argument. More...
 
- Protected Attributes inherited from TiledArray::expressions::BinaryEngine< MultEngine< Left, Right, Result > >
left_type left_
 The left-hand argument. More...
 
right_type right_
 The right-hand argument. More...
 
World * world_
 The world where this expression will be evaluated. More...
 
VariableList vars_
 The variable list of this expression. More...
 
Permutation perm_
 The permutation that will be applied to the result. More...
 
trange_type trange_
 The tiled range of the result tensor. More...
 
shape_type shape_
 The shape of the result tensor. More...
 
std::shared_ptr< pmap_interfacepmap_
 The process map for the result tensor. More...
 
bool permute_tiles_
 Result tile permutation flag (true == permute tile) More...
 
- Protected Attributes inherited from TiledArray::expressions::ExprEngine< MultEngine< Left, Right, Result > >
World * world_
 The world where this expression will be evaluated. More...
 
VariableList vars_
 The variable list of this expression. More...
 
bool permute_tiles_
 Result tile permutation flag (true == permute tile) More...
 
Permutation perm_
 The permutation that will be applied to the result. More...
 
trange_type trange_
 The tiled range of the result tensor. More...
 
shape_type shape_
 The shape of the result tensor. More...
 
std::shared_ptr< pmap_interfacepmap_
 The process map for the result tensor. More...
 
std::shared_ptr< EngineParamOverride< MultEngine< Left, Right, Result > > > override_ptr_
 The engine params overriding the default. More...
 

Detailed Description

template<typename Left, typename Right, typename Result>
class TiledArray::expressions::MultEngine< Left, Right, Result >

Multiplication expression engine.

This implements any expression encoded with the multiplication operator. This includes Hadamard product, e.g.

(c("i,j")=)a("i,j")*b("i,j")

, and pure contractions, e.g.

(c("i,j")=)a("i,k")*b("k,j")

.

Definition at line 40 of file mult_engine.h.

Member Typedef Documentation

◆ BinaryEngine_

template<typename Left , typename Right , typename Result >
typedef BinaryEngine<MultEngine_> TiledArray::expressions::MultEngine< Left, Right, Result >::BinaryEngine_

Binary base class type.

Definition at line 141 of file mult_engine.h.

◆ ContEngine_

template<typename Left , typename Right , typename Result >
typedef ContEngine<MultEngine_> TiledArray::expressions::MultEngine< Left, Right, Result >::ContEngine_

Contraction engine base class.

Definition at line 139 of file mult_engine.h.

◆ dist_eval_type

template<typename Left , typename Right , typename Result >
typedef EngineTrait<MultEngine_>::dist_eval_type TiledArray::expressions::MultEngine< Left, Right, Result >::dist_eval_type

The distributed evaluator type.

Definition at line 161 of file mult_engine.h.

◆ ExprEngine_

template<typename Left , typename Right , typename Result >
typedef BinaryEngine<MultEngine_> TiledArray::expressions::MultEngine< Left, Right, Result >::ExprEngine_

Expression engine base class type.

Definition at line 143 of file mult_engine.h.

◆ left_type

template<typename Left , typename Right , typename Result >
typedef EngineTrait<MultEngine_>::left_type TiledArray::expressions::MultEngine< Left, Right, Result >::left_type

The left-hand expression type.

Definition at line 147 of file mult_engine.h.

◆ MultEngine_

template<typename Left , typename Right , typename Result >
typedef MultEngine<Left, Right, Result> TiledArray::expressions::MultEngine< Left, Right, Result >::MultEngine_

This class type.

Definition at line 137 of file mult_engine.h.

◆ op_base_type

template<typename Left , typename Right , typename Result >
typedef EngineTrait<MultEngine_>::op_base_type TiledArray::expressions::MultEngine< Left, Right, Result >::op_base_type

The tile operation type.

Definition at line 155 of file mult_engine.h.

◆ op_type

template<typename Left , typename Right , typename Result >
typedef EngineTrait<MultEngine_>::op_type TiledArray::expressions::MultEngine< Left, Right, Result >::op_type

The tile operation type.

Definition at line 157 of file mult_engine.h.

◆ pmap_interface

template<typename Left , typename Right , typename Result >
typedef EngineTrait<MultEngine_>::pmap_interface TiledArray::expressions::MultEngine< Left, Right, Result >::pmap_interface

Process map interface type.

Definition at line 171 of file mult_engine.h.

◆ policy

template<typename Left , typename Right , typename Result >
typedef EngineTrait<MultEngine_>::policy TiledArray::expressions::MultEngine< Left, Right, Result >::policy

The result policy type.

Definition at line 159 of file mult_engine.h.

◆ right_type

template<typename Left , typename Right , typename Result >
typedef EngineTrait<MultEngine_>::right_type TiledArray::expressions::MultEngine< Left, Right, Result >::right_type

The right-hand expression type.

Definition at line 149 of file mult_engine.h.

◆ shape_type

template<typename Left , typename Right , typename Result >
typedef EngineTrait<MultEngine_>::shape_type TiledArray::expressions::MultEngine< Left, Right, Result >::shape_type

Shape type.

Definition at line 169 of file mult_engine.h.

◆ size_type

template<typename Left , typename Right , typename Result >
typedef EngineTrait<MultEngine_>::size_type TiledArray::expressions::MultEngine< Left, Right, Result >::size_type

Size type.

Definition at line 165 of file mult_engine.h.

◆ trange_type

template<typename Left , typename Right , typename Result >
typedef EngineTrait<MultEngine_>::trange_type TiledArray::expressions::MultEngine< Left, Right, Result >::trange_type

Tiled range type.

Definition at line 167 of file mult_engine.h.

◆ value_type

template<typename Left , typename Right , typename Result >
typedef EngineTrait<MultEngine_>::value_type TiledArray::expressions::MultEngine< Left, Right, Result >::value_type

The result tile type.

Definition at line 153 of file mult_engine.h.

Constructor & Destructor Documentation

◆ MultEngine()

template<typename Left , typename Right , typename Result >
template<typename L , typename R >
TiledArray::expressions::MultEngine< Left, Right, Result >::MultEngine ( const MultExpr< L, R > &  expr)
inline

Constructor.

Template Parameters
LThe left-hand argument expression type
RThe right-hand argument expression type
Parameters
exprThe parent expression

Definition at line 186 of file mult_engine.h.

Member Function Documentation

◆ init_distribution()

template<typename Left , typename Right , typename Result >
void TiledArray::expressions::MultEngine< Left, Right, Result >::init_distribution ( World *  world,
std::shared_ptr< pmap_interface pmap 
)
inline

Initialize result tensor distribution.

This function will initialize the world and process map for the result tensor.

Parameters
worldThe world were the result will be distributed
pmapThe process map for the result tensor tiles

Definition at line 268 of file mult_engine.h.

Here is the call graph for this function:

◆ init_struct()

template<typename Left , typename Right , typename Result >
void TiledArray::expressions::MultEngine< Left, Right, Result >::init_struct ( const VariableList target_vars)
inline

Initialize result tensor structure.

This function will initialize the permutation, tiled range, and shape for the result tensor.

Parameters
target_varsThe target variable list for the result tensor

Definition at line 255 of file mult_engine.h.

Here is the call graph for this function:

◆ init_vars() [1/2]

template<typename Left , typename Right , typename Result >
void TiledArray::expressions::MultEngine< Left, Right, Result >::init_vars ( const VariableList target_vars)
inline

Initialize the variable list of this expression.

Parameters
target_varsThe target variable list for this expression

Definition at line 221 of file mult_engine.h.

Here is the call graph for this function:

◆ init_vars() [2/2]

template<typename Left , typename Right , typename Result >
void TiledArray::expressions::MultEngine< Left, Right, Result >::init_vars ( )
inline

Initialize the variable list of this expression.

Definition at line 235 of file mult_engine.h.

Here is the call graph for this function:

◆ make_dist_eval()

template<typename Left , typename Right , typename Result >
dist_eval_type TiledArray::expressions::MultEngine< Left, Right, Result >::make_dist_eval ( ) const
inline

Construct the distributed evaluator for this expression.

Returns
The distributed evaluator that will evaluate this expression

Definition at line 325 of file mult_engine.h.

Here is the call graph for this function:

◆ make_shape() [1/2]

template<typename Left , typename Right , typename Result >
shape_type TiledArray::expressions::MultEngine< Left, Right, Result >::make_shape ( ) const
inline

Non-permuting shape factory function.

Returns
The result shape

Definition at line 299 of file mult_engine.h.

Here is the call graph for this function:

◆ make_shape() [2/2]

template<typename Left , typename Right , typename Result >
shape_type TiledArray::expressions::MultEngine< Left, Right, Result >::make_shape ( const Permutation perm) const
inline

Permuting shape factory function.

Parameters
permThe permutation to be applied to the array
Returns
The result shape

Definition at line 307 of file mult_engine.h.

Here is the call graph for this function:

◆ make_tag()

template<typename Left , typename Right , typename Result >
const char* TiledArray::expressions::MultEngine< Left, Right, Result >::make_tag ( ) const
inline

Expression identification tag.

Returns
An expression tag used to identify this expression

Definition at line 335 of file mult_engine.h.

◆ make_tile_op() [1/2]

template<typename Left , typename Right , typename Result >
static op_type TiledArray::expressions::MultEngine< Left, Right, Result >::make_tile_op ( )
inlinestatic

Non-permuting tile operation factory function.

Returns
The tile operation

Definition at line 314 of file mult_engine.h.

◆ make_tile_op() [2/2]

template<typename Left , typename Right , typename Result >
static op_type TiledArray::expressions::MultEngine< Left, Right, Result >::make_tile_op ( const Permutation perm)
inlinestatic

Permuting tile operation factory function.

Parameters
permThe permutation to be applied to tiles
Returns
The tile operation

Definition at line 320 of file mult_engine.h.

Here is the call graph for this function:

◆ make_trange() [1/2]

template<typename Left , typename Right , typename Result >
trange_type TiledArray::expressions::MultEngine< Left, Right, Result >::make_trange ( ) const
inline

Non-permuting tiled range factory function.

Returns
The result tiled range object

Definition at line 278 of file mult_engine.h.

Here is the call graph for this function:

◆ make_trange() [2/2]

template<typename Left , typename Right , typename Result >
trange_type TiledArray::expressions::MultEngine< Left, Right, Result >::make_trange ( const Permutation perm) const
inline

Permuting tiled range factory function.

Parameters
permThe permutation to be applied to the array
Returns
The result tiled range object

Definition at line 289 of file mult_engine.h.

Here is the call graph for this function:

◆ perm_vars() [1/2]

template<typename Left , typename Right , typename Result >
void TiledArray::expressions::MultEngine< Left, Right, Result >::perm_vars ( const VariableList target_vars)
inline

Set the variable list for this expression.

This function will set the variable list for this expression and its children such that the number of permutations is minimized. The final variable list may not be set to target, which indicates that the result of this expression will be permuted to match target_vars.

Parameters
target_varsThe target variable list for this expression

Definition at line 198 of file mult_engine.h.

Here is the call graph for this function:

◆ perm_vars() [2/2]

template<typename Left , typename Right , typename Result >
void TiledArray::expressions::MultEngine< Left, Right, Result >::perm_vars ( )
inline

Set the variable list for this expression.

This function will set the variable list for this expression and its children such that the number of permutations is minimized.

Definition at line 210 of file mult_engine.h.

Here is the call graph for this function:

◆ print()

template<typename Left , typename Right , typename Result >
void TiledArray::expressions::MultEngine< Left, Right, Result >::print ( ExprOStream  os,
const VariableList target_vars 
) const
inline

Expression print.

Parameters
osThe output stream
target_varsThe target variable list for this expression

Definition at line 341 of file mult_engine.h.

Here is the call graph for this function:

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