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 >
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) );
505 template<
typename MT1
507 inline typename RowExprTrait< TSMatDMatSubExpr<MT1,MT2> >::Type
508 row(
const TSMatDMatSubExpr<MT1,MT2>& dm,
size_t index )
512 return row( dm.leftOperand(), index ) -
row( dm.rightOperand(), index );
531 template<
typename MT1
533 inline typename ColumnExprTrait< TSMatDMatSubExpr<MT1,MT2> >::Type
534 column(
const TSMatDMatSubExpr<MT1,MT2>& dm,
size_t index )
538 return column( dm.leftOperand(), index ) -
column( dm.rightOperand(), index );
554 template<
typename MT1,
typename MT2,
typename MT3 >
555 struct DMatDMatAddExprTrait< 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 && IsRowMajorMatrix<MT3>::value
563 ,
typename DMatTSMatAddExprTrait< typename DMatDMatSubExprTrait<MT3,MT2>::Type, MT1 >::Type
564 , INVALID_TYPE >::Type Type;
574 template<
typename MT1,
typename MT2,
typename MT3 >
575 struct DMatTDMatAddExprTrait< TSMatDMatSubExpr<MT1,MT2>, MT3 >
580 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
581 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
582 IsDenseMatrix<MT3>::value && IsColumnMajorMatrix<MT3>::value
583 ,
typename DMatTSMatAddExprTrait< typename TDMatDMatSubExprTrait<MT3,MT2>::Type, MT1 >::Type
584 , INVALID_TYPE >::Type Type;
594 template<
typename MT1,
typename MT2,
typename MT3 >
595 struct DMatDMatSubExprTrait< TSMatDMatSubExpr<MT1,MT2>, MT3 >
600 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
601 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
602 IsDenseMatrix<MT3>::value && IsRowMajorMatrix<MT3>::value
603 ,
typename TSMatDMatSubExprTrait< MT1, typename DMatDMatAddExprTrait<MT2,MT3>::Type >::Type
604 , INVALID_TYPE >::Type Type;
614 template<
typename MT1,
typename MT2,
typename MT3 >
615 struct DMatTDMatSubExprTrait< TSMatDMatSubExpr<MT1,MT2>, MT3 >
620 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
621 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
622 IsDenseMatrix<MT3>::value && IsColumnMajorMatrix<MT3>::value
623 ,
typename TSMatDMatSubExprTrait< MT1, typename DMatTDMatAddExprTrait<MT2,MT3>::Type >::Type
624 , INVALID_TYPE >::Type Type;
634 template<
typename MT1,
typename MT2 >
635 struct RowExprTrait< TSMatDMatSubExpr<MT1,MT2> >
639 typedef typename SubExprTrait< typename RowExprTrait<const MT1>::Type
640 ,
typename RowExprTrait<const MT2>::Type >::Type Type;
649 template<
typename MT1,
typename MT2 >
650 struct ColumnExprTrait< TSMatDMatSubExpr<MT1,MT2> >
654 typedef typename SubExprTrait< typename ColumnExprTrait<const MT1>::Type
655 ,
typename ColumnExprTrait<const MT2>::Type >::Type Type;