22 #ifndef _BLAZE_MATH_EXPRESSIONS_TDMATSMATADDEXPR_H_
23 #define _BLAZE_MATH_EXPRESSIONS_TDMATSMATADDEXPR_H_
67 template<
typename MT1
69 class TDMatSMatAddExpr :
public DenseMatrix< TDMatSMatAddExpr<MT1,MT2>, false >
70 ,
private MatMatAddExpr
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 const TDMatSMatAddExpr<T1,T2>
419 throw std::invalid_argument(
"Matrix sizes do not match" );
457 template<
typename T1
459 const TDMatSMatAddExpr<T1,T2>
465 throw std::invalid_argument(
"Matrix sizes do not match" );
493 template<
typename T1
497 inline const typename AddExprTrait< TDMatSMatAddExpr<T1,T2>, T3 >::Type
498 operator+(
const TDMatSMatAddExpr<T1,T2>& lhs,
const DenseMatrix<T3,SO>& rhs )
502 return ( lhs.leftOperand() + (~rhs) ) + lhs.rightOperand();
521 template<
typename T1
525 inline const typename SubExprTrait< TDMatSMatAddExpr<T1,T2>, T3 >::Type
526 operator-(
const TDMatSMatAddExpr<T1,T2>& lhs,
const DenseMatrix<T3,SO>& rhs )
530 return ( lhs.leftOperand() - (~rhs) ) + lhs.rightOperand();
546 template<
typename MT1,
typename MT2,
typename MT3 >
547 struct DMatDMatAddExprTrait< TDMatSMatAddExpr<MT1,MT2>, MT3 >
552 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
553 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
554 IsDenseMatrix<MT3>::value && IsRowMajorMatrix<MT3>::value
555 ,
typename DMatSMatAddExprTrait< typename TDMatDMatAddExprTrait<MT1,MT3>::Type, MT2 >::Type
556 , INVALID_TYPE >::Type Type;
566 template<
typename MT1,
typename MT2,
typename MT3 >
567 struct DMatTDMatAddExprTrait< TDMatSMatAddExpr<MT1,MT2>, MT3 >
572 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
573 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
574 IsDenseMatrix<MT3>::value && IsColumnMajorMatrix<MT3>::value
575 ,
typename TDMatSMatAddExprTrait< typename TDMatTDMatAddExprTrait<MT1,MT3>::Type, MT2 >::Type
576 , INVALID_TYPE >::Type Type;
586 template<
typename MT1,
typename MT2,
typename MT3 >
587 struct DMatDMatSubExprTrait< TDMatSMatAddExpr<MT1,MT2>, MT3 >
592 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
593 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
594 IsDenseMatrix<MT3>::value && IsRowMajorMatrix<MT3>::value
595 ,
typename DMatSMatAddExprTrait< typename TDMatDMatSubExprTrait<MT1,MT3>::Type, MT2 >::Type
596 , INVALID_TYPE >::Type Type;
606 template<
typename MT1,
typename MT2,
typename MT3 >
607 struct DMatTDMatSubExprTrait< TDMatSMatAddExpr<MT1,MT2>, MT3 >
612 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
613 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
614 IsDenseMatrix<MT3>::value && IsColumnMajorMatrix<MT3>::value
615 ,
typename TDMatSMatAddExprTrait< typename TDMatTDMatSubExprTrait<MT1,MT3>::Type, MT2 >::Type
616 , INVALID_TYPE >::Type Type;
626 template<
typename MT1,
typename MT2 >
627 struct RowExprTrait< TDMatSMatAddExpr<MT1,MT2> >
631 typedef typename AddExprTrait< typename RowExprTrait<const MT1>::Type
632 ,
typename RowExprTrait<const MT2>::Type >::Type Type;
641 template<
typename MT1,
typename MT2 >
642 struct ColumnExprTrait< TDMatSMatAddExpr<MT1,MT2> >
646 typedef typename AddExprTrait< typename ColumnExprTrait<const MT1>::Type
647 ,
typename ColumnExprTrait<const MT2>::Type >::Type Type;