26 #ifndef TILEDARRAY_EXPRESSIONS_ADD_EXPR_H__INCLUDED 27 #define TILEDARRAY_EXPRESSIONS_ADD_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>
120 template <
typename Left,
typename Right,
typename Scalar>
121 class ScalAddExpr :
public BinaryExpr<ScalAddExpr<Left, Right, Scalar> > {
123 typedef ScalAddExpr<Left, Right, Scalar>
175 template <
typename Left,
typename Right>
176 inline AddExpr<Left, Right>
179 "no_alias() expressions are not allowed on the right-hand side of " 180 "the assignment operator.");
182 "no_alias() expressions are not allowed on the right-hand side of " 183 "the assignment operator.");
195 template <
typename Left,
typename Right,
typename Scalar>
196 inline typename std::enable_if<TiledArray::detail::is_numeric<Scalar>::value,
197 ScalAddExpr<Left, Right, Scalar> >::type
211 template <
typename Left,
typename Right,
typename Scalar>
212 inline typename std::enable_if<TiledArray::detail::is_numeric<Scalar>::value,
213 ScalAddExpr<Left, Right, Scalar> >::type
228 template <
typename Left,
typename Right,
typename Scalar1,
typename Scalar2,
229 typename std::enable_if<
232 inline ScalAddExpr<Left, Right, mult_t<Scalar1, Scalar2> >
235 expr.right(), expr.factor() * factor);
247 template <
typename Left,
typename Right,
typename Scalar1,
typename Scalar2,
248 typename std::enable_if<
251 inline ScalAddExpr<Left, Right, mult_t<Scalar2, Scalar1> >
254 expr.right(), expr.factor() * factor);
263 template <
typename Left,
typename Right>
264 inline ScalAddExpr<Left, Right,
265 typename ExprTrait<AddExpr<Left, Right> >::numeric_type>
279 template <
typename Left,
typename Right,
typename Scalar>
280 inline ScalAddExpr<Left, Right, Scalar>
291 template <
typename Left,
typename Right>
302 template <
typename Left,
typename Right>
314 template <
typename Left,
typename Right,
typename Scalar>
315 inline ScalConjAddExpr<Left, Right, Scalar>
328 template <
typename Left,
typename Right,
typename Scalar>
329 inline ScalAddExpr<Left, Right, Scalar>
343 template <
typename Left,
typename Right,
typename Scalar,
344 typename std::enable_if<
347 inline ScalConjAddExpr<Left, Right, Scalar>
361 template <
typename Left,
typename Right,
typename Scalar,
362 typename std::enable_if<
365 inline ScalConjAddExpr<Left, Right, Scalar>
380 template <
typename Left,
typename Right,
typename Scalar1,
typename Scalar2,
381 typename std::enable_if<
384 inline ScalConjAddExpr<Left, Right, mult_t<Scalar1, Scalar2> >
399 template <
typename Left,
typename Right,
typename Scalar1,
typename Scalar2,
400 typename std::enable_if<
403 inline ScalConjAddExpr<Left, Right, mult_t<Scalar2, Scalar1> >
415 template <
typename Left,
typename Right>
417 typename ExprTrait<ConjAddExpr<Left, Right> >::numeric_type>
422 expr.
right(), conj_op<scalar_type>(-1));
432 template <
typename Left,
typename Right,
typename Scalar>
433 inline ScalConjAddExpr<Left, Right, Scalar>
442 #endif // TILEDARRAY_EXPRESSIONS_ADD_EXPR_H__INCLUDED
ExprTrait< ScalAddExpr_ >::scalar_type scalar_type
Scalar type.
AddExpr< Left, Right > operator+(const Expr< Left > &left, const Expr< Right > &right)
Addition expression factor.
Right right_type
The right-hand expression type.
Right right_type
The right-hand expression type.
numeric_t< typename EngineTrait< engine_type >::eval_type > numeric_type
Addition numeric type.
ScalAddExpr(const ScalAddExpr_ &)=default
ScalAddExpr< Left, Right, TiledArray::detail::ComplexConjugate< void > > ConjAddExpr
ScalAddExpr< Left, Right, Scalar > ScalAddExpr_
This class type.
ScalAddEngine< typename ExprTrait< Left >::engine_type, typename ExprTrait< Right >::engine_type, Scalar, result_type > engine_type
Expression engine type.
ScalAddExpr_ & operator=(const ScalAddExpr_ &)=delete
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.
ScalAddExpr< Left, Right, TiledArray::detail::ComplexConjugate< Scalar > > ScalConjAddExpr
decltype(std::declval< Scalar1 >() *std::declval< Scalar2 >()) mult_t
ExprTrait< ScalAddExpr_ >::left_type left_type
The left-hand expression type.
AddExpr< Left, Right > AddExpr_
This class type.
const right_type & right() const
Right-hand expression argument accessor.
typename TiledArray::detail::numeric_type< T >::type numeric_t
Scalar scalar_type
Expression scalar type.
scalar_t< typename EngineTrait< engine_type >::eval_type > scalar_type
Addition result scalar type.
ExprTrait< AddExpr_ >::right_type right_type
The right-hand expression type.
const left_type & left() const
Left-hand expression argument accessor.
TiledArray::tile_interface::result_of_add_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.
AddExpr_ & operator=(const AddExpr_ &)=delete
Left left_type
The left-hand expression type.
Binary expression object.
Add-then-scale expression.
ExprTrait< ScalAddExpr_ >::engine_type engine_type
Expression engine type.
BinaryExpr< AddExpr_ > BinaryExpr_
Binary base class type.
typename TiledArray::detail::scalar_type< T >::type scalar_t
ExprTrait< AddExpr_ >::engine_type engine_type
Expression engine 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.
TiledArray::tile_interface::result_of_add_t< typename EngineTrait< typename ExprTrait< Left >::engine_type >::eval_type, typename EngineTrait< typename ExprTrait< Right >::engine_type >::eval_type > result_type
Result tile type.
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
ComplexConjugate< S > conj_op(const S factor)
ComplexConjugate operator factory function.
Left left_type
The left-hand expression type.
decltype(add(std::declval< T >()...)) result_of_add_t
BinaryExpr< ScalAddExpr_ > BinaryExpr_
Binary base class type.
Addition expression engine.
ScalAddExpr(const left_type &left, const right_type &right, const scalar_type factor)
Expression constructor.
numeric_t< typename EngineTrait< engine_type >::eval_type > numeric_type
Addition result numeric type.
AddExpr(const left_type &left, const right_type &right)
Expression constructor.
ExprTrait< ScalAddExpr_ >::right_type right_type
The right-hand expression type.
ExprTrait< AddExpr_ >::left_type left_type
The left-hand expression type.
Addition expression engine.
AddEngine< typename ExprTrait< Left >::engine_type, typename ExprTrait< Right >::engine_type, result_type > engine_type
Expression engine type.
scalar_type factor() const
Scaling factor accessor.
AddExpr(const AddExpr_ &)=default