26 #ifndef TILEDARRAY_EXPRESSIONS_MULT_EXPR_H__INCLUDED 27 #define TILEDARRAY_EXPRESSIONS_MULT_EXPR_H__INCLUDED 33 namespace expressions {
35 template <
typename Left,
typename Right>
39 template <
typename Left,
typename Right,
typename Scalar>
48 template <
typename Left,
typename Right>
59 typedef numeric_t<typename EngineTrait<engine_type>::eval_type>
61 typedef scalar_t<typename EngineTrait<engine_type>::eval_type>
65 template <
typename Left,
typename Right,
typename Scalar>
77 typedef numeric_t<typename EngineTrait<engine_type>::eval_type>
86 template <
typename Left,
typename Right>
115 template <
typename Numeric,
116 typename std::enable_if<
119 explicit operator Numeric()
const {
128 template <
typename Numeric,
129 typename std::enable_if<
132 explicit operator Future<Numeric>()
const {
143 template <
typename Left,
typename Right,
typename Scalar>
144 class ScalMultExpr :
public BinaryExpr<ScalMultExpr<Left, Right, Scalar> > {
190 template <
typename Left,
typename Right>
191 inline MultExpr<Left, Right>
194 "no_alias() expressions are not allowed on the right-hand side of the " 195 "assignment operator.");
197 "no_alias() expressions are not allowed on the right-hand side of the " 198 "assignment operator.");
210 template <
typename Left,
typename Right,
typename Scalar,
211 typename std::enable_if<
214 inline ScalMultExpr<Left, Right, Scalar>
228 template <
typename Left,
typename Right,
typename Scalar,
229 typename std::enable_if<
232 inline ScalMultExpr<Left, Right, Scalar>
247 template <
typename Left,
typename Right,
typename Scalar1,
typename Scalar2,
248 typename std::enable_if<
251 inline ScalMultExpr<Left, Right, mult_t<Scalar1, Scalar2> >
253 const Scalar2& factor)
256 expr.right(), expr.factor() * factor);
268 template <
typename Left,
typename Right,
typename Scalar1,
typename Scalar2,
269 typename std::enable_if<
272 inline ScalMultExpr<Left, Right, mult_t<Scalar2, Scalar1> >
277 expr.right(), expr.factor() * factor);
286 template <
typename Left,
typename Right>
287 inline ScalMultExpr<Left, Right, typename ExprTrait<MultExpr<Left, Right> >::numeric_type>
290 Right> >::numeric_type>(expr.
left(), expr.
right(), -1);
299 template <
typename Left,
typename Right,
typename Scalar>
300 inline ScalMultExpr<Left, Right, Scalar>
312 template <
typename Left,
typename Right>
323 template <
typename Left,
typename Right>
335 template <
typename Left,
typename Right,
typename Scalar>
336 inline ScalConjMultExpr<Left, Right, Scalar>
349 template <
typename Left,
typename Right,
typename Scalar>
350 inline ScalMultExpr<Left, Right, Scalar>
364 template <
typename Left,
typename Right,
typename Scalar,
365 typename std::enable_if<
368 inline ScalConjMultExpr<Left, Right, Scalar>
382 template <
typename Left,
typename Right,
typename Scalar,
383 typename std::enable_if<
386 inline ScalConjMultExpr<Left, Right, Scalar>
401 template <
typename Left,
typename Right,
typename Scalar1,
typename Scalar2,
402 typename std::enable_if<
405 inline ScalConjMultExpr<Left, Right, mult_t<Scalar1, Scalar2> >
420 template <
typename Left,
typename Right,
typename Scalar1,
typename Scalar2,
421 typename std::enable_if<
424 inline ScalConjMultExpr<Left, Right, mult_t<Scalar2, Scalar1> >
436 template <
typename Left,
typename Right>
438 typename ExprTrait<ConjMultExpr<Left, Right> >::numeric_type>
443 expr.
right(), conj_op<scalar_type>(-1));
453 template <
typename Left,
typename Right,
typename Scalar>
454 inline ScalConjMultExpr<Left, Right, Scalar>
469 template <
typename Numeric,
typename Left,
typename Right,
470 typename std::enable_if<
475 result += expr.
left().dot(expr.
right()).
get();
487 template <
typename Numeric,
typename Left,
typename Right,
488 typename std::enable_if<
493 result -= expr.
left().dot(expr.
right()).
get();
505 template <
typename Numeric,
typename Left,
typename Right,
506 typename std::enable_if<
511 result *= expr.
left().dot(expr.
right()).
get();
519 #endif // TILEDARRAY_EXPRESSIONS_MULT_EXPR_H__INCLUDED Multiplication expression.
scalar_type factor() const
Scaling factor accessor.
ScalMultExpr< Left, Right, TiledArray::detail::ComplexConjugate< Scalar > > ScalConjMultExpr
ExprTrait< ScalMultExpr_ >::left_type left_type
The left-hand expression type.
numeric_t< typename EngineTrait< engine_type >::eval_type > numeric_type
Multiplication result numeric type.
result_of_mult_t< typename EngineTrait< typename ExprTrait< Left >::engine_type >::eval_type, typename EngineTrait< typename ExprTrait< Right >::engine_type >::eval_type, scalar_type > result_type
Result tile type.
ScalMultExpr_ & operator=(const ScalMultExpr_ &)=delete
Right right_type
The right-hand expression type.
std::enable_if< TiledArray::detail::is_numeric< Scalar >::value, ScalAddExpr< Left, Right, Scalar > >::type operator*(const AddExpr< Left, Right > &expr, const Scalar &factor)
Scaled-addition expression factor.
MultExpr_ & operator=(const MultExpr_ &)=delete
decltype(std::declval< Scalar1 >() *std::declval< Scalar2 >()) mult_t
ExprTrait< ScalMultExpr_ >::scalar_type scalar_type
Tile scalar type.
Multiplication expression.
const right_type & right() const
Right-hand expression argument accessor.
typename TiledArray::detail::numeric_type< T >::type numeric_t
ScalMultExpr(const left_type &left, const right_type &right, const scalar_type factor)
Expression constructor.
ScalMultExpr< Left, Right, TiledArray::detail::ComplexConjugate< void > > ConjMultExpr
decltype(mult(std::declval< T >()...)) result_of_mult_t
BinaryExpr< MultExpr_ > BinaryExpr_
Binary expression base type.
ExprTrait< MultExpr_ >::engine_type engine_type
Expression engine type.
numeric_t< typename EngineTrait< engine_type >::eval_type > numeric_type
Multiplication result numeric type.
const left_type & left() const
Left-hand expression argument accessor.
MultExpr< Left, Right > MultExpr_
This class type.
ExprTrait< MultExpr_ >::right_type right_type
The right-hand expression type.
Binary expression object.
Left left_type
The left-hand expression type.
ExprTrait< ScalMultExpr_ >::right_type right_type
The right-hand expression type.
scalar_t< typename EngineTrait< engine_type >::eval_type > scalar_type
Multiplication result scalar type.
typename TiledArray::detail::scalar_type< T >::type scalar_t
ScalMultExpr(const ScalMultExpr_ &)=default
Scalar scalar_type
Tile scalar type.
Right right_type
The right-hand expression type.
Base class for expression evaluation.
derived_type & derived()
Cast this object to it's derived type.
ConjAddExpr< Left, Right > conj(const AddExpr< Left, Right > &expr)
Conjugated addition expression factory.
ScalAddExpr< Left, Right, typename ExprTrait< AddExpr< Left, Right > >::numeric_type > operator-(const AddExpr< Left, Right > &expr)
Negated addition expression factor.
TILEDARRAY_FORCE_INLINE R conj(const R r)
Wrapper function for std::conj
MultExpr(const left_type &left, const right_type &right)
Expression constructor.
Numeric & operator*=(Numeric &result, const MultExpr< Left, Right > &expr)
Dot product multiply-to operator.
ComplexConjugate< S > conj_op(const S factor)
ComplexConjugate operator factory function.
ScalMultExpr< Left, Right, Scalar > ScalMultExpr_
This class type.
ExprTrait< ScalMultExpr_ >::engine_type engine_type
Expression engine type.
ScalMultEngine< typename ExprTrait< Left >::engine_type, typename ExprTrait< Right >::engine_type, Scalar, result_type > engine_type
Expression engine type.
BinaryExpr< ScalMultExpr_ > BinaryExpr_
Binary expression base type.
Numeric & operator-=(Numeric &result, const MultExpr< Left, Right > &expr)
Dot product subtract-to operator.
ExprTrait< MultExpr_ >::left_type left_type
The left-hand expression type.
Left left_type
The left-hand expression type.
Multiplication expression engine.
MultExpr(const MultExpr_ &)=default
Scaled multiplication expression engine.
Numeric & operator+=(Numeric &result, const MultExpr< Left, Right > &expr)
Dot product add-to operator.
MultEngine< typename ExprTrait< Left >::engine_type, typename ExprTrait< Right >::engine_type, result_type > engine_type
Expression engine type.
result_of_mult_t< typename EngineTrait< typename ExprTrait< Left >::engine_type >::eval_type, typename EngineTrait< typename ExprTrait< Right >::engine_type >::eval_type > result_type
Result tile type.