27 #ifndef TILEDARRAY_EXPRESSIONS_SUBT_EXPR_H__INCLUDED 28 #define TILEDARRAY_EXPRESSIONS_SUBT_EXPR_H__INCLUDED 34 namespace expressions {
36 template <
typename Left,
typename Right>
40 template <
typename Left,
typename Right,
typename Scalar>
49 template <
typename Left,
typename Right>
60 typedef numeric_t<typename EngineTrait<engine_type>::eval_type>
62 typedef scalar_t<typename EngineTrait<engine_type>::eval_type>
66 template <
typename Left,
typename Right,
typename Scalar>
78 typedef numeric_t<typename EngineTrait<engine_type>::eval_type>
87 template <
typename Left,
typename Right>
119 template <
typename Left,
typename Right,
typename Scalar>
120 class ScalSubtExpr :
public BinaryExpr<ScalSubtExpr<Left, Right, Scalar> > {
170 template <
typename Left,
typename Right>
171 inline SubtExpr<Left, Right>
174 "no_alias() expressions are not allowed on the right-hand side of " 175 "the assignment operator.");
177 "no_alias() expressions are not allowed on the right-hand side of " 178 "the assignment operator.");
190 template <
typename Left,
typename Right,
typename Scalar,
191 typename std::enable_if<
194 inline ScalSubtExpr<Left, Right, Scalar>
208 template <
typename Left,
typename Right,
typename Scalar,
209 typename std::enable_if<
212 inline ScalSubtExpr<Left, Right, Scalar>
227 template <
typename Left,
typename Right,
typename Scalar1,
typename Scalar2,
228 typename std::enable_if<
231 inline ScalSubtExpr<Left, Right, mult_t<Scalar1, Scalar2> >
233 const Scalar2& factor)
236 expr.right(), expr.factor() * factor);
248 template <
typename Left,
typename Right,
typename Scalar1,
typename Scalar2,
249 typename std::enable_if<
252 inline ScalSubtExpr<Left, Right, mult_t<Scalar2, Scalar1> >
255 expr.right(), expr.factor() * factor);
265 template <
typename Left,
typename Right>
266 inline ScalSubtExpr<Left, Right,
267 typename ExprTrait<SubtExpr<Left, Right> >::numeric_type>
280 template <
typename Left,
typename Right,
typename Scalar>
281 inline ScalSubtExpr<Left, Right, Scalar>
292 template <
typename Left,
typename Right>
303 template <
typename Left,
typename Right>
315 template <
typename Left,
typename Right,
typename Scalar>
316 inline ScalConjSubtExpr<Left, Right, Scalar>
329 template <
typename Left,
typename Right,
typename Scalar>
330 inline ScalSubtExpr<Left, Right, Scalar>
344 template <
typename Left,
typename Right,
typename Scalar,
345 typename std::enable_if<
348 inline ScalConjSubtExpr<Left, Right, Scalar>
362 template <
typename Left,
typename Right,
typename Scalar,
363 typename std::enable_if<
366 inline ScalConjSubtExpr<Left, Right, Scalar>
381 template <
typename Left,
typename Right,
typename Scalar1,
typename Scalar2,
382 typename std::enable_if<
385 inline ScalConjSubtExpr<Left, Right, mult_t<Scalar1, Scalar2> >
400 template <
typename Left,
typename Right,
typename Scalar1,
typename Scalar2,
401 typename std::enable_if<
404 inline ScalConjSubtExpr<Left, Right, mult_t<Scalar2, Scalar1> >
416 template <
typename Left,
typename Right>
418 typename ExprTrait<ConjSubtExpr<Left, Right> >::numeric_type>
423 expr.
right(), conj_op<scalar_type>(-1));
433 template <
typename Left,
typename Right,
typename Scalar>
434 inline ScalConjSubtExpr<Left, Right, Scalar>
443 #endif // TILEDARRAY_EXPRESSIONS_SUBT_EXPR_H__INCLUDED Right right_type
The right-hand expression type.
ExprTrait< ScalSubtExpr_ >::engine_type engine_type
Expression engine type.
Subtraction expression engine.
SubtExpr_ & operator=(const SubtExpr_ &)=delete
ScalSubtExpr< Left, Right, Scalar > ScalSubtExpr_
This class type.
SubtExpr(const left_type &left, const right_type &right)
Expression constructor.
result_of_subt_t< typename EngineTrait< typename ExprTrait< Left >::engine_type >::eval_type, typename EngineTrait< typename ExprTrait< Right >::engine_type >::eval_type > result_type
Result tile type.
numeric_t< typename EngineTrait< engine_type >::eval_type > numeric_type
Subtraction result numeric type.
ScalSubtExpr< Left, Right, TiledArray::detail::ComplexConjugate< Scalar > > ScalConjSubtExpr
ExprTrait< SubtExpr_ >::right_type 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.
Right right_type
The right-hand expression type.
SubtExpr(const SubtExpr_ &)=default
BinaryExpr< ScalSubtExpr_ > BinaryExpr_
Binary base class type.
decltype(std::declval< Scalar1 >() *std::declval< Scalar2 >()) mult_t
Left left_type
The left-hand expression type.
const right_type & right() const
Right-hand expression argument accessor.
typename TiledArray::detail::numeric_type< T >::type numeric_t
ExprTrait< ScalSubtExpr_ >::left_type left_type
The left-hand expression type.
ExprTrait< SubtExpr_ >::engine_type engine_type
Expression engine type.
ExprTrait< ScalSubtExpr_ >::scalar_type scalar_type
Scalar type.
SubtExpr< Left, Right > SubtExpr_
Subtraction expression engine.
BinaryExpr< SubtExpr_ > BinaryExpr_
Binary base class type.
const left_type & left() const
Left-hand expression argument accessor.
Binary expression object.
ExprTrait< ScalSubtExpr_ >::right_type right_type
The right-hand expression type.
typename TiledArray::detail::scalar_type< T >::type scalar_t
SubtEngine< typename ExprTrait< Left >::engine_type, typename ExprTrait< Right >::engine_type, result_type > engine_type
Expression engine type.
ScalSubtExpr(const ScalSubtExpr_ &)=default
numeric_t< typename EngineTrait< engine_type >::eval_type > numeric_type
Subtraction result numeric type.
scalar_type factor() const
Scaling factor accessor.
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.
ScalSubtExpr_ & operator=(const ScalSubtExpr_ &)=delete
ScalAddExpr< Left, Right, typename ExprTrait< AddExpr< Left, Right > >::numeric_type > operator-(const AddExpr< Left, Right > &expr)
Negated addition expression factor.
Left left_type
The left-hand expression type.
TILEDARRAY_FORCE_INLINE R conj(const R r)
Wrapper function for std::conj
Scalar scalar_type
Tile scalar type.
scalar_t< typename EngineTrait< engine_type >::eval_type > scalar_type
Subtraction result scalar type.
ComplexConjugate< S > conj_op(const S factor)
ComplexConjugate operator factory function.
ScalSubtEngine< typename ExprTrait< Left >::engine_type, typename ExprTrait< Right >::engine_type, Scalar, result_type > engine_type
Expression engine type.
ScalSubtExpr(const left_type &left, const right_type &right, const scalar_type factor)
Expression constructor.
decltype(subt(std::declval< T >()...)) result_of_subt_t
ExprTrait< SubtExpr_ >::left_type left_type
The left-hand expression type.
ScalSubtExpr< Left, Right, TiledArray::detail::ComplexConjugate< void > > ConjSubtExpr
result_of_subt_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.