22 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATTSMATSUBEXPR_H_
23 #define _BLAZE_MATH_EXPRESSIONS_DMATTSMATSUBEXPR_H_
71 template<
typename MT1
79 typedef typename MT1::ResultType
RT1;
80 typedef typename MT2::ResultType
RT2;
81 typedef typename MT1::ReturnType
RN1;
82 typedef typename MT2::ReturnType
RN2;
121 enum { vectorizable = 0 };
169 return lhs_.columns();
199 template<
typename T >
202 (
rhs_.canAlias( alias ) );
212 template<
typename T >
214 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
236 template<
typename MT
268 template<
typename MT
286 const TmpType tmp( rhs );
305 template<
typename MT
337 template<
typename MT
414 template<
typename T1
416 inline const DMatTSMatSubExpr<T1,T2>
422 throw std::invalid_argument(
"Matrix sizes do not match" );
450 template<
typename T1
454 inline const typename AddExprTrait< DMatTSMatSubExpr<T1,T2>, T3 >::Type
455 operator+(
const DMatTSMatSubExpr<T1,T2>& lhs,
const DenseMatrix<T3,SO>& rhs )
459 return ( lhs.leftOperand() + (~rhs) ) - lhs.rightOperand();
478 template<
typename T1
482 inline const typename SubExprTrait< DMatTSMatSubExpr<T1,T2>, T3 >::Type
483 operator-(
const DMatTSMatSubExpr<T1,T2>& lhs,
const DenseMatrix<T3,SO>& rhs )
487 return ( lhs.leftOperand() - (~rhs) ) - lhs.rightOperand();
514 template<
typename MT1
516 inline typename RowExprTrait< DMatTSMatSubExpr<MT1,MT2> >::Type
517 row(
const DMatTSMatSubExpr<MT1,MT2>& dm,
size_t index )
521 return row( dm.leftOperand(), index ) -
row( dm.rightOperand(), index );
540 template<
typename MT1
542 inline typename ColumnExprTrait< DMatTSMatSubExpr<MT1,MT2> >::Type
543 column(
const DMatTSMatSubExpr<MT1,MT2>& dm,
size_t index )
547 return column( dm.leftOperand(), index ) -
column( dm.rightOperand(), index );
563 template<
typename MT1,
typename MT2,
typename MT3 >
564 struct DMatDMatAddExprTrait< DMatTSMatSubExpr<MT1,MT2>, MT3 >
569 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
570 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
571 IsDenseMatrix<MT3>::value && IsRowMajorMatrix<MT3>::value
572 ,
typename DMatTSMatSubExprTrait< typename DMatDMatAddExprTrait<MT1,MT3>::Type, MT2 >::Type
573 , INVALID_TYPE >::Type Type;
583 template<
typename MT1,
typename MT2,
typename MT3 >
584 struct DMatTDMatAddExprTrait< DMatTSMatSubExpr<MT1,MT2>, MT3 >
589 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
590 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
591 IsDenseMatrix<MT3>::value && IsColumnMajorMatrix<MT3>::value
592 ,
typename DMatTSMatSubExprTrait< typename DMatTDMatAddExprTrait<MT1,MT3>::Type, MT2 >::Type
593 , INVALID_TYPE >::Type Type;
603 template<
typename MT1,
typename MT2,
typename MT3 >
604 struct DMatDMatSubExprTrait< DMatTSMatSubExpr<MT1,MT2>, MT3 >
609 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
610 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
611 IsDenseMatrix<MT3>::value && IsRowMajorMatrix<MT3>::value
612 ,
typename DMatTSMatSubExprTrait< typename DMatDMatSubExprTrait<MT1,MT3>::Type, MT2 >::Type
613 , INVALID_TYPE >::Type Type;
623 template<
typename MT1,
typename MT2,
typename MT3 >
624 struct DMatTDMatSubExprTrait< DMatTSMatSubExpr<MT1,MT2>, MT3 >
629 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
630 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
631 IsDenseMatrix<MT3>::value && IsColumnMajorMatrix<MT3>::value
632 ,
typename DMatTSMatSubExprTrait< typename DMatTDMatSubExprTrait<MT1,MT3>::Type, MT2 >::Type
633 , INVALID_TYPE >::Type Type;
643 template<
typename MT1,
typename MT2 >
644 struct RowExprTrait< DMatTSMatSubExpr<MT1,MT2> >
648 typedef typename SubExprTrait< typename RowExprTrait<const MT1>::Type
649 ,
typename RowExprTrait<const MT2>::Type >::Type Type;
658 template<
typename MT1,
typename MT2 >
659 struct ColumnExprTrait< DMatTSMatSubExpr<MT1,MT2> >
663 typedef typename SubExprTrait< typename ColumnExprTrait<const MT1>::Type
664 ,
typename ColumnExprTrait<const MT2>::Type >::Type Type;