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 >
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();
511 template<
typename MT1
513 inline typename RowExprTrait< TDMatSMatSubExpr<MT1,MT2> >::Type
514 row(
const TDMatSMatSubExpr<MT1,MT2>& dm,
size_t index )
518 return row( dm.leftOperand(), index ) -
row( dm.rightOperand(), index );
537 template<
typename MT1
539 inline typename ColumnExprTrait< TDMatSMatSubExpr<MT1,MT2> >::Type
540 column(
const TDMatSMatSubExpr<MT1,MT2>& dm,
size_t index )
544 return column( dm.leftOperand(), index ) -
column( dm.rightOperand(), index );
560 template<
typename MT1,
typename MT2,
typename MT3 >
561 struct DMatDMatAddExprTrait< 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 && IsRowMajorMatrix<MT3>::value
569 ,
typename DMatSMatSubExprTrait< typename TDMatDMatAddExprTrait<MT1,MT3>::Type, MT2 >::Type
570 , INVALID_TYPE >::Type Type;
580 template<
typename MT1,
typename MT2,
typename MT3 >
581 struct DMatTDMatAddExprTrait< TDMatSMatSubExpr<MT1,MT2>, MT3 >
586 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
587 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
588 IsDenseMatrix<MT3>::value && IsColumnMajorMatrix<MT3>::value
589 ,
typename TDMatSMatSubExprTrait< typename TDMatTDMatAddExprTrait<MT1,MT3>::Type, MT2 >::Type
590 , INVALID_TYPE >::Type Type;
600 template<
typename MT1,
typename MT2,
typename MT3 >
601 struct DMatDMatSubExprTrait< TDMatSMatSubExpr<MT1,MT2>, MT3 >
606 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
607 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
608 IsDenseMatrix<MT3>::value && IsRowMajorMatrix<MT3>::value
609 ,
typename DMatSMatSubExprTrait< typename TDMatDMatSubExprTrait<MT1,MT3>::Type, MT2 >::Type
610 , INVALID_TYPE >::Type Type;
620 template<
typename MT1,
typename MT2,
typename MT3 >
621 struct DMatTDMatSubExprTrait< TDMatSMatSubExpr<MT1,MT2>, MT3 >
626 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
627 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
628 IsDenseMatrix<MT3>::value && IsColumnMajorMatrix<MT3>::value
629 ,
typename TDMatSMatSubExprTrait< typename TDMatTDMatSubExprTrait<MT1,MT3>::Type, MT2 >::Type
630 , INVALID_TYPE >::Type Type;
640 template<
typename MT1,
typename MT2 >
641 struct RowExprTrait< TDMatSMatSubExpr<MT1,MT2> >
645 typedef typename SubExprTrait< typename RowExprTrait<const MT1>::Type
646 ,
typename RowExprTrait<const MT2>::Type >::Type Type;
655 template<
typename MT1,
typename MT2 >
656 struct ColumnExprTrait< TDMatSMatSubExpr<MT1,MT2> >
660 typedef typename SubExprTrait< typename ColumnExprTrait<const MT1>::Type
661 ,
typename ColumnExprTrait<const MT2>::Type >::Type Type;