22 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATTDMATSUBEXPR_H_
23 #define _BLAZE_MATH_EXPRESSIONS_SMATTDMATSUBEXPR_H_
71 template<
typename MT1
73 class SMatTDMatSubExpr :
public DenseMatrix< SMatTDMatSubExpr<MT1,MT2>, false >
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 >
201 return (
lhs_.canAlias( alias ) ) ||
212 template<
typename T >
214 return lhs_.isAliased( alias ) &&
rhs_.isAliased( alias );
236 template<
typename MT
245 assign ( ~lhs, -rhs.rhs_ );
263 template<
typename MT
281 const TmpType tmp( rhs );
300 template<
typename MT
332 template<
typename MT
410 template<
typename T1
412 inline const SMatTDMatSubExpr<T1,T2>
418 throw std::invalid_argument(
"Matrix sizes do not match" );
446 template<
typename T1
450 inline const typename AddExprTrait< SMatTDMatSubExpr<T1,T2>, T3 >::Type
451 operator+(
const SMatTDMatSubExpr<T1,T2>& lhs,
const DenseMatrix<T3,SO>& rhs )
455 return ( (~rhs) - lhs.rightOperand() ) + lhs.leftOperand();
474 template<
typename T1
478 inline const typename SubExprTrait< SMatTDMatSubExpr<T1,T2>, T3 >::Type
479 operator-(
const SMatTDMatSubExpr<T1,T2>& lhs,
const DenseMatrix<T3,SO>& rhs )
483 return lhs.leftOperand() - ( lhs.rightOperand() + (~rhs) );
510 template<
typename MT1
512 inline typename RowExprTrait< SMatTDMatSubExpr<MT1,MT2> >::Type
513 row(
const SMatTDMatSubExpr<MT1,MT2>& dm,
size_t index )
517 return row( dm.leftOperand(), index ) -
row( dm.rightOperand(), index );
536 template<
typename MT1
538 inline typename ColumnExprTrait< SMatTDMatSubExpr<MT1,MT2> >::Type
539 column(
const SMatTDMatSubExpr<MT1,MT2>& dm,
size_t index )
543 return column( dm.leftOperand(), index ) -
column( dm.rightOperand(), index );
559 template<
typename MT1,
typename MT2,
typename MT3 >
560 struct DMatDMatAddExprTrait< SMatTDMatSubExpr<MT1,MT2>, MT3 >
565 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
566 IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
567 IsDenseMatrix<MT3>::value && IsRowMajorMatrix<MT3>::value
568 ,
typename DMatSMatAddExprTrait< typename DMatTDMatSubExprTrait<MT3,MT2>::Type, MT1 >::Type
569 , INVALID_TYPE >::Type Type;
579 template<
typename MT1,
typename MT2,
typename MT3 >
580 struct DMatTDMatAddExprTrait< SMatTDMatSubExpr<MT1,MT2>, MT3 >
585 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
586 IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
587 IsDenseMatrix<MT3>::value && IsColumnMajorMatrix<MT3>::value
588 ,
typename TDMatSMatAddExprTrait< typename TDMatTDMatSubExprTrait<MT3,MT2>::Type, MT1 >::Type
589 , INVALID_TYPE >::Type Type;
599 template<
typename MT1,
typename MT2,
typename MT3 >
600 struct DMatDMatSubExprTrait< SMatTDMatSubExpr<MT1,MT2>, MT3 >
605 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
606 IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
607 IsDenseMatrix<MT3>::value && IsRowMajorMatrix<MT3>::value
608 ,
typename SMatDMatSubExprTrait< MT1, typename TDMatDMatAddExprTrait<MT2,MT3>::Type >::Type
609 , INVALID_TYPE >::Type Type;
619 template<
typename MT1,
typename MT2,
typename MT3 >
620 struct DMatTDMatSubExprTrait< SMatTDMatSubExpr<MT1,MT2>, MT3 >
625 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
626 IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
627 IsDenseMatrix<MT3>::value && IsColumnMajorMatrix<MT3>::value
628 ,
typename SMatTDMatSubExprTrait< MT1, typename TDMatTDMatAddExprTrait<MT2,MT3>::Type >::Type
629 , INVALID_TYPE >::Type Type;
639 template<
typename MT1,
typename MT2 >
640 struct RowExprTrait< SMatTDMatSubExpr<MT1,MT2> >
644 typedef typename SubExprTrait< typename RowExprTrait<const MT1>::Type
645 ,
typename RowExprTrait<const MT2>::Type >::Type Type;
654 template<
typename MT1,
typename MT2 >
655 struct ColumnExprTrait< SMatTDMatSubExpr<MT1,MT2> >
659 typedef typename SubExprTrait< typename ColumnExprTrait<const MT1>::Type
660 ,
typename ColumnExprTrait<const MT2>::Type >::Type Type;