Go to the documentation of this file.
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>
79 typedef numeric_t<typename EngineTrait<engine_type>::eval_type>
87 template <
typename Left,
typename Right>
117 template <
typename Numeric,
118 typename std::enable_if<
119 TiledArray::detail::is_numeric_v<Numeric> >::type* =
nullptr>
120 explicit operator Numeric()
const {
129 template <
typename Numeric,
130 typename std::enable_if<
131 TiledArray::detail::is_numeric_v<Numeric> >::type* =
nullptr>
142 template <
typename Left,
typename Right,
typename Scalar>
190 template <
typename Left,
typename Right>
195 "no_alias() expressions are not allowed on the right-hand side of the "
196 "assignment operator.");
199 "no_alias() expressions are not allowed on the right-hand side of the "
200 "assignment operator.");
212 template <
typename Left,
typename Right,
typename Scalar,
213 typename std::enable_if<
214 TiledArray::detail::is_numeric_v<Scalar> >::type* =
nullptr>
228 template <
typename Left,
typename Right,
typename Scalar,
229 typename std::enable_if<
230 TiledArray::detail::is_numeric_v<Scalar> >::type* =
nullptr>
245 template <
typename Left,
typename Right,
typename Scalar1,
typename Scalar2,
246 typename std::enable_if<
247 TiledArray::detail::is_numeric_v<Scalar2> >::type* =
nullptr>
251 expr.left(), expr.right(), expr.
factor() * factor);
263 template <
typename Left,
typename Right,
typename Scalar1,
typename Scalar2,
264 typename std::enable_if<
265 TiledArray::detail::is_numeric_v<Scalar1> >::type* =
nullptr>
269 expr.left(), expr.right(), expr.
factor() * factor);
278 template <
typename Left,
typename Right>
279 inline ScalMultExpr<Left, Right,
280 typename ExprTrait<MultExpr<Left, Right> >::numeric_type>
284 expr.left(), expr.right(), -1);
293 template <
typename Left,
typename Right,
typename Scalar>
306 template <
typename Left,
typename Right>
317 template <
typename Left,
typename Right>
329 template <
typename Left,
typename Right,
typename Scalar>
333 expr.left(), expr.right(),
344 template <
typename Left,
typename Right,
typename Scalar>
348 expr.left(), expr.right(),
360 template <
typename Left,
typename Right,
typename Scalar,
361 typename std::enable_if<
362 TiledArray::detail::is_numeric_v<Scalar> >::type* =
nullptr>
377 template <
typename Left,
typename Right,
typename Scalar,
378 typename std::enable_if<
379 TiledArray::detail::is_numeric_v<Scalar> >::type* =
nullptr>
395 template <
typename Left,
typename Right,
typename Scalar1,
typename Scalar2,
396 typename std::enable_if<
397 TiledArray::detail::is_numeric_v<Scalar2> >::type* =
nullptr>
401 expr.left(), expr.right(),
conj_op(expr.
factor().factor() * factor));
413 template <
typename Left,
typename Right,
typename Scalar1,
typename Scalar2,
414 typename std::enable_if<
415 TiledArray::detail::is_numeric_v<Scalar1> >::type* =
nullptr>
419 expr.left(), expr.right(),
conj_op(expr.
factor().factor() * factor));
428 template <
typename Left,
typename Right>
430 Left, Right,
typename ExprTrait<ConjMultExpr<Left, Right> >::numeric_type>
435 conj_op<scalar_type>(-1));
445 template <
typename Left,
typename Right,
typename Scalar>
449 expr.left(), expr.right(),
conj_op(-expr.
factor().factor()));
460 template <
typename Numeric,
typename Left,
typename Right,
461 typename std::enable_if<
462 TiledArray::detail::is_numeric_v<Numeric> >::type* =
nullptr>
464 result += expr.left().dot(expr.right()).get();
476 template <
typename Numeric,
typename Left,
typename Right,
477 typename std::enable_if<
478 TiledArray::detail::is_numeric_v<Numeric> >::type* =
nullptr>
480 result -= expr.left().dot(expr.right()).get();
492 template <
typename Numeric,
typename Left,
typename Right,
493 typename std::enable_if<
494 TiledArray::detail::is_numeric_v<Numeric> >::type* =
nullptr>
496 result *= expr.left().dot(expr.right()).get();
503 #endif // TILEDARRAY_EXPRESSIONS_MULT_EXPR_H__INCLUDED
ExprTrait< ScalMultExpr_ >::right_type right_type
The right-hand expression type.
ScalMultExpr(ScalMultExpr_ &&)=default
Multiplication expression engine.
ScalAddExpr< Left, Right, typename ExprTrait< AddExpr< Left, Right > >::numeric_type > operator-(const AddExpr< Left, Right > &expr)
Negated addition expression factor.
ExprTrait< MultExpr_ >::right_type right_type
The right-hand expression type.
typename TiledArray::detail::numeric_type< T >::type numeric_t
numeric_t<T> is an alias for numeric_type<T>::type
MultExpr(const left_type &left, const right_type &right)
Expression constructor.
MultExpr(MultExpr_ &&)=default
decltype(std::declval< Scalar1 >() *std::declval< Scalar2 >()) mult_t
BinaryExpr< ScalMultExpr_ > BinaryExpr_
Binary expression base type.
ScalMultExpr(const left_type &left, const right_type &right, const scalar_type factor)
Expression constructor.
MultExpr_ & operator=(const MultExpr_ &)=delete
Base class for expression evaluation.
ScalMultExpr(const ScalMultExpr_ &)=default
Binary expression object.
numeric_t< typename EngineTrait< engine_type >::eval_type > numeric_type
Multiplication result numeric type.
std::enable_if< TiledArray::detail::is_numeric_v< Scalar >, ScalAddExpr< Left, Right, Scalar > >::type operator*(const AddExpr< Left, Right > &expr, const Scalar &factor)
Scaled-addition expression factor.
Numeric & operator+=(Numeric &result, const MultExpr< Left, Right > &expr)
Dot product add-to operator.
Left left_type
The left-hand expression 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.
ConjAddExpr< Left, Right > conj(const AddExpr< Left, Right > &expr)
Conjugated addition expression factory.
Right right_type
The right-hand expression type.
MultExpr(const MultExpr_ &)=default
Multiplication expression.
ScalMultExpr< Left, Right, TiledArray::detail::ComplexConjugate< Scalar > > ScalConjMultExpr
typename TiledArray::detail::scalar_type< T >::type scalar_t
scalar_t<T> is an alias for scalar_type<T>::type
MultExpr_ & operator=(MultExpr_ &&)=delete
BinaryExpr< MultExpr_ > BinaryExpr_
Binary expression base type.
scalar_t< typename EngineTrait< engine_type >::eval_type > scalar_type
Multiplication result scalar type.
Right right_type
The right-hand expression type.
ScalMultExpr< Left, Right, Scalar > ScalMultExpr_
This class type.
ExprTrait< ScalMultExpr_ >::engine_type engine_type
Expression engine type.
Numeric & operator-=(Numeric &result, const MultExpr< Left, Right > &expr)
Dot product subtract-to operator.
ScalMultExpr_ & operator=(ScalMultExpr_ &&)=delete
numeric_t< typename EngineTrait< engine_type >::eval_type > numeric_type
Multiplication result numeric type.
const left_type & left() const
Left-hand expression argument accessor.
Numeric & operator*=(Numeric &result, const MultExpr< Left, Right > &expr)
Dot product multiply-to operator.
MultEngine< typename ExprTrait< Left >::engine_type, typename ExprTrait< Right >::engine_type, result_type > engine_type
Expression engine type.
ComplexConjugate< S > conj_op(const S factor)
ComplexConjugate operator factory function.
Left left_type
The left-hand expression type.
ExprTrait< MultExpr_ >::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.
MultExpr< Left, Right > MultExpr_
This class type.
ExprTrait< MultExpr_ >::left_type left_type
The left-hand expression type.
scalar_type factor() const
Scaling factor accessor.
Multiplication expression.
ScalMultExpr_ & operator=(const ScalMultExpr_ &)=delete
decltype(mult(std::declval< T >()...)) result_of_mult_t
ExprTrait< ScalMultExpr_ >::left_type left_type
The left-hand expression type.
TILEDARRAY_FORCE_INLINE R conj(const R r)
Wrapper function for std::conj
ExprTrait< ScalMultExpr_ >::scalar_type scalar_type
Tile scalar type.
Scalar scalar_type
Tile scalar type.
Scaled multiplication expression engine.
const right_type & right() const
Right-hand expression argument accessor.
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.
derived_type & derived()
Cast this object to its derived type.