22 #ifndef _BLAZE_MATH_EXPRESSIONS_TDMATSMATSUBEXPR_H_
23 #define _BLAZE_MATH_EXPRESSIONS_TDMATSMATSUBEXPR_H_
67 template<
typename MT1
69 class TDMatSMatSubExpr :
public DenseMatrix< TDMatSMatSubExpr<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 >
198 (
rhs_.canAlias( alias ) );
208 template<
typename T >
210 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
232 template<
typename MT
245 assign ( ~lhs, rhs.lhs_ );
264 template<
typename MT
282 const TmpType tmp( rhs );
301 template<
typename MT
333 template<
typename MT
411 template<
typename T1
413 inline const TDMatSMatSubExpr<T1,T2>
419 throw std::invalid_argument(
"Matrix sizes do not match" );
447 template<
typename T1
451 inline const typename AddExprTrait< TDMatSMatSubExpr<T1,T2>, T3 >::Type
452 operator+(
const TDMatSMatSubExpr<T1,T2>& lhs,
const DenseMatrix<T3,SO>& rhs )
456 return ( lhs.leftOperand() + (~rhs) ) - lhs.rightOperand();
475 template<
typename T1
479 inline const typename SubExprTrait< TDMatSMatSubExpr<T1,T2>, T3 >::Type
480 operator-(
const TDMatSMatSubExpr<T1,T2>& lhs,
const DenseMatrix<T3,SO>& rhs )
484 return ( lhs.leftOperand() - (~rhs) ) - lhs.rightOperand();
500 template<
typename MT1,
typename MT2,
typename MT3 >
501 struct DMatDMatAddExprTrait< TDMatSMatSubExpr<MT1,MT2>, MT3 >
506 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
507 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
508 IsDenseMatrix<MT3>::value && IsRowMajorMatrix<MT3>::value
509 ,
typename DMatSMatSubExprTrait< typename TDMatDMatAddExprTrait<MT1,MT3>::Type, MT2 >::Type
510 , INVALID_TYPE >::Type Type;
520 template<
typename MT1,
typename MT2,
typename MT3 >
521 struct DMatTDMatAddExprTrait< TDMatSMatSubExpr<MT1,MT2>, MT3 >
526 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
527 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
528 IsDenseMatrix<MT3>::value && IsColumnMajorMatrix<MT3>::value
529 ,
typename TDMatSMatSubExprTrait< typename TDMatTDMatAddExprTrait<MT1,MT3>::Type, MT2 >::Type
530 , INVALID_TYPE >::Type Type;
540 template<
typename MT1,
typename MT2,
typename MT3 >
541 struct DMatDMatSubExprTrait< TDMatSMatSubExpr<MT1,MT2>, MT3 >
546 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
547 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
548 IsDenseMatrix<MT3>::value && IsRowMajorMatrix<MT3>::value
549 ,
typename DMatSMatSubExprTrait< typename TDMatDMatSubExprTrait<MT1,MT3>::Type, MT2 >::Type
550 , INVALID_TYPE >::Type Type;
560 template<
typename MT1,
typename MT2,
typename MT3 >
561 struct DMatTDMatSubExprTrait< TDMatSMatSubExpr<MT1,MT2>, MT3 >
566 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
567 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
568 IsDenseMatrix<MT3>::value && IsColumnMajorMatrix<MT3>::value
569 ,
typename TDMatSMatSubExprTrait< typename TDMatTDMatSubExprTrait<MT1,MT3>::Type, MT2 >::Type
570 , INVALID_TYPE >::Type Type;
580 template<
typename MT1,
typename MT2 >
581 struct RowExprTrait< TDMatSMatSubExpr<MT1,MT2> >
585 typedef typename SubExprTrait< typename RowExprTrait<const MT1>::Type
586 ,
typename RowExprTrait<const MT2>::Type >::Type Type;
595 template<
typename MT1,
typename MT2 >
596 struct ColumnExprTrait< TDMatSMatSubExpr<MT1,MT2> >
600 typedef typename SubExprTrait< typename ColumnExprTrait<const MT1>::Type
601 ,
typename ColumnExprTrait<const MT2>::Type >::Type Type;