TiledArray::detail::Subt< Result, Left, Right, LeftConsumable, RightConsumable > Class Template Reference

Documentation

template<typename Result, typename Left, typename Right, bool LeftConsumable, bool RightConsumable>
class TiledArray::detail::Subt< Result, Left, Right, LeftConsumable, RightConsumable >

Tile subtraction operation.

This subtraction operation will subtract the content two tiles, and accepts an optional permute argument.

Template Parameters
ResultThe result tile type
LeftThe left-hand argument base type
RightThe right-hand argument base type
LeftConsumableIf true, the left-hand tile is a temporary and may be consumed
RightConsumableIf true, the right-hand tile is a temporary and may be consumed
Note
Input tiles can be consumed only if their type matches the result type.

Definition at line 53 of file subt.h.

Public Types

typedef Subt< Result, Left, Right, LeftConsumable, RightConsumable > Subt_
 
typedef Left left_type
 Left-hand argument base type. More...
 
typedef Right right_type
 Right-hand argument base type. More...
 
typedef Result result_type
 The result tile type. More...
 

Public Member Functions

template<typename L , typename R , typename Perm , typename = std::enable_if_t<TiledArray::detail::is_permutation_v<Perm>>>
result_type operator() (L &&left, R &&right, const Perm &perm) const
 Subtract-and-permute operator. More...
 
template<typename L , typename R >
result_type operator() (L &&left, R &&right) const
 Subtract operator. More...
 
template<typename R >
result_type consume_left (left_type &left, R &&right) const
 Subtract right to left. More...
 
template<typename L >
result_type consume_right (L &&left, right_type &right) const
 Subtract left to right. More...
 

Static Public Attributes

static constexpr bool left_is_consumable
 Indicates whether it is possible to consume the left tile. More...
 
static constexpr bool right_is_consumable
 Indicates whether it is possible to consume the right tile. More...
 

Member Typedef Documentation

◆ left_type

template<typename Result , typename Left , typename Right , bool LeftConsumable, bool RightConsumable>
typedef Left TiledArray::detail::Subt< Result, Left, Right, LeftConsumable, RightConsumable >::left_type

Left-hand argument base type.

Definition at line 56 of file subt.h.

◆ result_type

template<typename Result , typename Left , typename Right , bool LeftConsumable, bool RightConsumable>
typedef Result TiledArray::detail::Subt< Result, Left, Right, LeftConsumable, RightConsumable >::result_type

The result tile type.

Definition at line 58 of file subt.h.

◆ right_type

template<typename Result , typename Left , typename Right , bool LeftConsumable, bool RightConsumable>
typedef Right TiledArray::detail::Subt< Result, Left, Right, LeftConsumable, RightConsumable >::right_type

Right-hand argument base type.

Definition at line 57 of file subt.h.

◆ Subt_

template<typename Result , typename Left , typename Right , bool LeftConsumable, bool RightConsumable>
typedef Subt<Result, Left, Right, LeftConsumable, RightConsumable> TiledArray::detail::Subt< Result, Left, Right, LeftConsumable, RightConsumable >::Subt_

Definition at line 55 of file subt.h.

Member Function Documentation

◆ consume_left()

template<typename Result , typename Left , typename Right , bool LeftConsumable, bool RightConsumable>
template<typename R >
result_type TiledArray::detail::Subt< Result, Left, Right, LeftConsumable, RightConsumable >::consume_left ( left_type left,
R &&  right 
) const
inline

Subtract right to left.

Subtract the right tile to the left. The right tile may be replaced with ZeroTensor argument, in which case the argument's element values are assumed to be 0.

Template Parameters
RThe right-hand tile argument type
Parameters
leftThe left-hand tile argument
rightThe right-hand tile argument
Returns
The difference of left and right.

Definition at line 188 of file subt.h.

◆ consume_right()

template<typename Result , typename Left , typename Right , bool LeftConsumable, bool RightConsumable>
template<typename L >
result_type TiledArray::detail::Subt< Result, Left, Right, LeftConsumable, RightConsumable >::consume_right ( L &&  left,
right_type right 
) const
inline

Subtract left to right.

Subtract the left tile to the right. The left tile may be replaced with ZeroTensor argument, in which case the argument's element values are assumed to be 0.

Template Parameters
LThe left-hand tile argument type
Parameters
leftThe left-hand tile argument
rightThe right-hand tile argument
Returns
The difference of left and right.

Definition at line 208 of file subt.h.

◆ operator()() [1/2]

template<typename Result , typename Left , typename Right , bool LeftConsumable, bool RightConsumable>
template<typename L , typename R >
result_type TiledArray::detail::Subt< Result, Left, Right, LeftConsumable, RightConsumable >::operator() ( L &&  left,
R &&  right 
) const
inline

Subtract operator.

Compute the difference of two tiles. One of the argument tiles may be replaced with ZeroTensor argument, in which case the argument's element values are assumed to be 0.

Template Parameters
LThe left-hand tile argument type
RThe right-hand tile argument type
Parameters
leftThe left-hand tile argument
rightThe right-hand tile argument
Returns
The scaled difference of left and right.

Definition at line 173 of file subt.h.

◆ operator()() [2/2]

template<typename Result , typename Left , typename Right , bool LeftConsumable, bool RightConsumable>
template<typename L , typename R , typename Perm , typename = std::enable_if_t<TiledArray::detail::is_permutation_v<Perm>>>
result_type TiledArray::detail::Subt< Result, Left, Right, LeftConsumable, RightConsumable >::operator() ( L &&  left,
R &&  right,
const Perm &  perm 
) const
inline

Subtract-and-permute operator.

Compute the difference of two tiles and permute the result. One of the argument tiles may be replaced with ZeroTensor argument, in which case the argument's element values are assumed to be 0.

Template Parameters
LThe left-hand tile argument type
RThe right-hand tile argument type
Parameters
leftThe left-hand tile argument
rightThe right-hand tile argument
permThe permutation applied to the result tile
Returns
The permuted and scaled difference of left and right.

Definition at line 158 of file subt.h.

Member Data Documentation

◆ left_is_consumable

template<typename Result , typename Left , typename Right , bool LeftConsumable, bool RightConsumable>
constexpr bool TiledArray::detail::Subt< Result, Left, Right, LeftConsumable, RightConsumable >::left_is_consumable
staticconstexpr
Initial value:
=
LeftConsumable && std::is_same<result_type, left_type>::value

Indicates whether it is possible to consume the left tile.

Definition at line 61 of file subt.h.

◆ right_is_consumable

template<typename Result , typename Left , typename Right , bool LeftConsumable, bool RightConsumable>
constexpr bool TiledArray::detail::Subt< Result, Left, Right, LeftConsumable, RightConsumable >::right_is_consumable
staticconstexpr
Initial value:
=
RightConsumable && std::is_same<result_type, right_type>::value

Indicates whether it is possible to consume the right tile.

Definition at line 64 of file subt.h.


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