22 #ifndef _BLAZE_MATH_EXPRESSIONS_TSMATDMATSUBEXPR_H_
23 #define _BLAZE_MATH_EXPRESSIONS_TSMATDMATSUBEXPR_H_
67 template<
typename MT1
69 class TSMatDMatSubExpr :
public DenseMatrix< TSMatDMatSubExpr<MT1,MT2>, false >
70 ,
private MatMatSubExpr
75 typedef typename MT1::ResultType
RT1;
76 typedef typename MT2::ResultType
RT2;
77 typedef typename MT1::ReturnType
RN1;
78 typedef typename MT2::ReturnType
RN2;
117 enum { vectorizable = 0 };
165 return lhs_.columns();
195 template<
typename T >
197 return (
lhs_.canAlias( alias ) ) ||
208 template<
typename T >
210 return lhs_.isAliased( alias ) ||
rhs_.isAliased( alias );
232 template<
typename MT
241 assign ( ~lhs, -rhs.rhs_ );
259 template<
typename MT
277 const TmpType tmp( rhs );
296 template<
typename MT
328 template<
typename MT
405 template<
typename T1
407 inline const TSMatDMatSubExpr<T1,T2>
413 throw std::invalid_argument(
"Matrix sizes do not match" );
441 template<
typename T1
445 inline const typename AddExprTrait< TSMatDMatSubExpr<T1,T2>, T3 >::Type
446 operator+(
const TSMatDMatSubExpr<T1,T2>& lhs,
const DenseMatrix<T3,SO>& rhs )
450 return ( (~rhs) - lhs.rightOperand() ) + lhs.leftOperand();
469 template<
typename T1
473 inline const typename SubExprTrait< TSMatDMatSubExpr<T1,T2>, T3 >::Type
474 operator-(
const TSMatDMatSubExpr<T1,T2>& lhs,
const DenseMatrix<T3,SO>& rhs )
478 return lhs.leftOperand() - ( lhs.rightOperand() + (~rhs) );
494 template<
typename MT1,
typename MT2,
typename MT3 >
495 struct DMatDMatAddExprTrait< TSMatDMatSubExpr<MT1,MT2>, MT3 >
500 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
501 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
502 IsDenseMatrix<MT3>::value && IsRowMajorMatrix<MT3>::value
503 ,
typename DMatTSMatAddExprTrait< typename DMatDMatSubExprTrait<MT3,MT2>::Type, MT1 >::Type
504 , INVALID_TYPE >::Type Type;
514 template<
typename MT1,
typename MT2,
typename MT3 >
515 struct DMatTDMatAddExprTrait< TSMatDMatSubExpr<MT1,MT2>, MT3 >
520 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
521 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
522 IsDenseMatrix<MT3>::value && IsColumnMajorMatrix<MT3>::value
523 ,
typename DMatTSMatAddExprTrait< typename TDMatDMatSubExprTrait<MT3,MT2>::Type, MT1 >::Type
524 , INVALID_TYPE >::Type Type;
534 template<
typename MT1,
typename MT2,
typename MT3 >
535 struct DMatDMatSubExprTrait< TSMatDMatSubExpr<MT1,MT2>, MT3 >
540 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
541 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
542 IsDenseMatrix<MT3>::value && IsRowMajorMatrix<MT3>::value
543 ,
typename TSMatDMatSubExprTrait< MT1, typename DMatDMatAddExprTrait<MT2,MT3>::Type >::Type
544 , INVALID_TYPE >::Type Type;
554 template<
typename MT1,
typename MT2,
typename MT3 >
555 struct DMatTDMatSubExprTrait< TSMatDMatSubExpr<MT1,MT2>, MT3 >
560 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
561 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
562 IsDenseMatrix<MT3>::value && IsColumnMajorMatrix<MT3>::value
563 ,
typename TSMatDMatSubExprTrait< MT1, typename DMatTDMatAddExprTrait<MT2,MT3>::Type >::Type
564 , INVALID_TYPE >::Type Type;
574 template<
typename MT1,
typename MT2 >
575 struct RowExprTrait< TSMatDMatSubExpr<MT1,MT2> >
579 typedef typename SubExprTrait< typename RowExprTrait<const MT1>::Type
580 ,
typename RowExprTrait<const MT2>::Type >::Type Type;
589 template<
typename MT1,
typename MT2 >
590 struct ColumnExprTrait< TSMatDMatSubExpr<MT1,MT2> >
594 typedef typename SubExprTrait< typename ColumnExprTrait<const MT1>::Type
595 ,
typename ColumnExprTrait<const MT2>::Type >::Type Type;