26 #ifndef TILEDARRAY_TILE_OP_SCAL_H__INCLUDED 27 #define TILEDARRAY_TILE_OP_SCAL_H__INCLUDED 29 #include <type_traits> 30 #include "../tile_interface/scale.h" 45 template <
typename Result,
typename Arg,
typename Scalar,
bool Consumable>
54 Consumable && std::is_same<result_type, argument_type>::value;
66 return scale(arg, factor_, perm);
73 template <bool C, typename std::enable_if<!C>::type* =
nullptr>
76 return scale(arg, factor_);
79 template <bool C, typename std::enable_if<C>::type* =
nullptr>
107 return eval(arg, perm);
115 template <
typename A>
117 return Scal_::template eval<is_consumable>(std::forward<A>(arg));
126 std::is_same<result_type, argument_type>::value;
127 return Scal_::template eval<can_consume>(arg);
135 #endif // TILEDARRAY_TILE_OP_SCAL_H__INCLUDED
Tile< Result > & scale_to(Tile< Result > &result, const Scalar factor)
Scale to the result tile.
void scale(DistArray< Tile, Policy > &a, typename DistArray< Tile, Policy >::element_type scaling_factor)
result_type operator()(const argument_type &arg, const Permutation &perm) const
Scale and permute operator.
Scal_ & operator=(const Scal_ &)=default
static constexpr bool is_consumable
Scal(const scalar_type factor)
Constructor.
result_type operator()(A &&arg) const
Consuming scale operation.
result_type consume(argument_type &arg) const
Explicit consuming scale operation.
Result result_type
The result tile type.
Arg argument_type
The argument type.
Scalar scalar_type
The scaling factor type.
Consumable tile type trait.
Permutation of a sequence of objects indexed by base-0 indices.
Scal(const Scal_ &)=default
Scal< Result, Arg, Scalar, Consumable > Scal_
This object type.